⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iconedit_panel.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
📖 第 1 页 / 共 4 页
字号:
	0);     iced_grid_item = panel_create_item(iced_panel, PANEL_CHOICE,	PANEL_LABEL_X,             23,	PANEL_LABEL_Y,             83,	PANEL_LABEL_STRING,        "Grid:",	PANEL_LABEL_FONT,          iced_bold_font,	PANEL_LABEL_BOLD,          FALSE,	PANEL_FEEDBACK,            PANEL_MARKED,	PANEL_MARK_IMAGES,         &tri_right,0,	PANEL_NOMARK_IMAGES,       0,	PANEL_CHOICE_OFFSET,       15,	PANEL_CHOICE_IMAGES,       &square_white,&grid_pr,0,	PANEL_MARK_XS,             76,133,0, 	PANEL_MARK_YS,             row4 + 4,0, 	PANEL_CHOICE_XS,           90,147,0,	PANEL_CHOICE_YS,           row4,0, 	PANEL_MENU_TITLE_STRING,   "Canvas Grid ",	PANEL_MENU_TITLE_FONT,     iced_bold_font,	PANEL_MENU_CHOICE_STRINGS, "Off","On",0, 	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_NOTIFY_PROC,         grid_proc,	0);	*/     iced_clear_item = panel_create_item(iced_panel, PANEL_BUTTON,	PANEL_LABEL_X,             10,	PANEL_LABEL_Y,             row5, 	PANEL_LABEL_IMAGE,        panel_button_image(iced_panel,"Clear",6,iced_bold_font),	PANEL_SHOW_MENU,           TRUE,	PANEL_MENU_CHOICE_STRINGS, "Clear canvas",0,	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_NOTIFY_PROC,         iced_clear_proc,	0);     iced_fill_canvas_item = panel_create_item(iced_panel, PANEL_BUTTON,	PANEL_LABEL_X,             89,	PANEL_LABEL_Y,             row5, 	PANEL_LABEL_IMAGE,         panel_button_image(iced_panel,"Fill",6,iced_bold_font),	PANEL_SHOW_MENU,           TRUE,	PANEL_MENU_CHOICE_STRINGS, "Fill canvas with rectangle fill pattern",0,	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_NOTIFY_PROC,         fill_canvas_proc,	0);     iced_invert_item = panel_create_item(iced_panel, PANEL_BUTTON,	PANEL_LABEL_X,             168,	PANEL_LABEL_Y,             row5, 	PANEL_LABEL_IMAGE,      panel_button_image(iced_panel,"Invert",6,iced_bold_font),	PANEL_SHOW_MENU,           TRUE,	PANEL_MENU_CHOICE_STRINGS, "Invert canvas",0,	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_NOTIFY_PROC,         invert_proc,	0);     iced_mode_item = panel_create_item(iced_panel, PANEL_CHOICE,	PANEL_FEEDBACK,            PANEL_MARKED,	PANEL_CHOICE_IMAGES,       &iced_points_pr,				   &iced_line_pr,				   &iced_box_pr,				   &iced_circle_pr,				   &iced_screenb12_pr,				   0,	PANEL_CHOICE_XS,           57,0,	PANEL_CHOICE_YS,           160,185,208,238,264,0,	PANEL_MARK_XS,             6,0,	PANEL_MARK_YS,             140,165,190,218,249,0,	PANEL_MARK_IMAGES,         &iced_drawing_hand,0,	PANEL_NOMARK_IMAGES,       0,	PANEL_MENU_TITLE_STRING,   "Drawing Mode ",	PANEL_MENU_TITLE_FONT,     iced_bold_font,	PANEL_MENU_CHOICE_STRINGS, "Points ",	                           "Line   ",	                           "Rectangle ",	                           "Circle ",				   "Text   ",	                           0, 	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_NOTIFY_PROC,         mode_proc,	0);     iced_fill_square_item  = panel_create_item(iced_panel, PANEL_CYCLE,	PANEL_LABEL_X,           97,	PANEL_LABEL_Y,           213 - 6,	PANEL_LABEL_STRING,      "Fill",	PANEL_LABEL_FONT,        iced_bold_font,	PANEL_LABEL_BOLD,        FALSE,	PANEL_MARK_YS,		    213 - 2, 0,        PANEL_CHOICE_FONTS,      iced_bold_font,0,	PANEL_CHOICE_STRINGS,    "Border",			         "White",				 "25% Grey",				 "root Grey", 				 "50% Grey",				 "75% Grey",  				 "Black",				 0, 	PANEL_MENU_TITLE_STRING, "Rectangle Fill Pattern ",	PANEL_MENU_TITLE_FONT,   iced_bold_font,	PANEL_NOTIFY_PROC,       fill_square_proc,	0);     iced_fill_circle_item  = panel_create_item(iced_panel, PANEL_CYCLE,	PANEL_LABEL_X,           97,	PANEL_LABEL_Y,           241 - 6,	PANEL_LABEL_STRING,      "Fill",	PANEL_MARK_YS,		 241 - 2, 0,	PANEL_LABEL_FONT,        iced_bold_font,	PANEL_LABEL_BOLD,        FALSE,        PANEL_CHOICE_FONTS,      iced_bold_font,0,	PANEL_CHOICE_STRINGS,    "Border",			         "White",				 "25% Grey",				 "root Grey", 				 "50% Grey",				 "75% Grey",  				 "Black",				 0, 	PANEL_MENU_TITLE_STRING, "Circle Fill Pattern ",	PANEL_MENU_TITLE_FONT,   iced_bold_font,	PANEL_NOTIFY_PROC,       fill_circle_proc,	0);     iced_font_item  = panel_create_item(iced_panel, PANEL_CHOICE,	PANEL_LABEL_X,             97,	PANEL_LABEL_Y,             268,	PANEL_LABEL_FONT,          iced_bold_font,	PANEL_LABEL_BOLD,          FALSE,	PANEL_LABEL_STRING,        "Fill:",	PANEL_DISPLAY_LEVEL,       PANEL_NONE,	PANEL_MENU_TITLE_STRING,   "Font for Inserted Text ",	PANEL_VALUE,               SCREEN_B_12,	PANEL_CHOICE_STRINGS,      "screen.r.7",				   "screen.r.11",				   "screen.r.12",				   "screen.b.12",				   "screen.r.14",				   "screen.b.14",				   "cmr.r.14",				   "cmr.b.14",				   "gallant.r.19",			           0,	PANEL_MENU_CHOICE_STRINGS, "screen 7 pt.",				   "screen 11 pt.",				   "screen 12 pt.",				   "screen 12 pt. bold",				   "screen 14 pt.",				   "screen 14 pt. bold",				   "computer modern 14 pt.",				   "computer modern 14 pt. bold ",				   "gallant 19 pt.",			           0,	PANEL_MENU_CHOICE_FONTS,   iced_screenr7,				   iced_screenr11,				   iced_screenr12,				   iced_screenb12,				   iced_screenr14,				   iced_screenb14,				   iced_cmrr14,				   iced_cmrb14,				   iced_gallantr19,				   0,	PANEL_NOTIFY_PROC,         font_proc,	0);     iced_abc_item  = panel_create_item(iced_panel, PANEL_TEXT,	PANEL_LABEL_X,             144,	PANEL_LABEL_Y,             268,	PANEL_VALUE_FONT,          iced_screenb12,	PANEL_LABEL_STRING,        "",        PANEL_VALUE_DISPLAY_LENGTH,10,	PANEL_NOTIFY_LEVEL,        PANEL_ALL,	PANEL_SHOW_MENU,           FALSE,	PANEL_NOTIFY_PROC,         abc_proc,	0);     iced_load_op_item   = panel_create_item(iced_panel, PANEL_CYCLE,		      PANEL_MARK_XS,		    32, 0,		      PANEL_MARK_YS,		    316+3, 0,		      PANEL_LABEL_Y,	       304,		      PANEL_LABEL_X,	       32,		      PANEL_VALUE_Y,           316,		      PANEL_VALUE_X,           32,		      PANEL_LABEL_STRING,      "Load",	              PANEL_LABEL_FONT,        iced_bold_font,	              PANEL_LABEL_BOLD,        FALSE,		      PANEL_CHOICE_FONTS,      iced_bold_font,0,		      PANEL_CHOICE_STRINGS,    "Src", "Or", "Xor", "And", 0,		      PANEL_MENU_TITLE_STRING, "Raster Op For Loading ",		      PANEL_MENU_TITLE_FONT,   iced_bold_font,		      0);     iced_fill_op_item   = panel_create_item(iced_panel, PANEL_CYCLE,		      PANEL_MARK_XS,		    97, 0,		      PANEL_MARK_YS,		    316+3, 0,		      PANEL_LABEL_Y,	       304,		      PANEL_LABEL_X,	       97,		      PANEL_VALUE_Y,           316,		      PANEL_VALUE_X,           97,		      PANEL_LABEL_STRING,      "Fill",	              PANEL_LABEL_FONT,        iced_bold_font,	              PANEL_LABEL_BOLD,        FALSE,		      PANEL_CHOICE_FONTS,      iced_bold_font,0,		      PANEL_CHOICE_STRINGS,    "Src", "Or", "Xor", "And", 0,		      PANEL_MENU_TITLE_STRING, "Raster Op For Filling ",		      PANEL_MENU_TITLE_FONT,   iced_bold_font,		      0);     iced_proof_op_item  = panel_create_item(iced_panel, PANEL_CYCLE,		      PANEL_MARK_XS,	       154, 0,		      PANEL_MARK_YS,	       316+3, 0,		      PANEL_LABEL_Y,	       304,		      PANEL_LABEL_X,	       154,		      PANEL_VALUE_Y,           316,		      PANEL_VALUE_X,           154,		      PANEL_LABEL_STRING,      "Proof",	              PANEL_LABEL_FONT,        iced_bold_font,	              PANEL_LABEL_BOLD,        FALSE,		      PANEL_CHOICE_FONTS,      iced_bold_font,0,		      PANEL_CHOICE_STRINGS,    "Src", "Or", "Xor", "And", 0,		      PANEL_MENU_TITLE_STRING, "Raster Op For Proof ",		      PANEL_MENU_TITLE_FONT,   iced_bold_font,		      PANEL_NOTIFY_PROC,   proof_op_proc,		      0);#define Z 33 #define Q 37     iced_proof_background_item  = panel_create_item(iced_panel, PANEL_CHOICE,	PANEL_FEEDBACK,            PANEL_MARKED,	PANEL_MARK_IMAGES,         &iced_tri_down,0,	PANEL_NOMARK_IMAGES,       0,	PANEL_CHOICE_IMAGES,       &iced_square_white,				   &iced_square_25,				   &iced_square_root,				   &iced_square_50,				   &iced_square_75,				   &iced_square_black,				   0,	PANEL_CHOICE_XS,            Z, Z+30, Z+60, Z+90, Z+120, Z+150, 0,	PANEL_CHOICE_YS,           345,345,345,345,345,345,0,	PANEL_MARK_XS,              Q, Q+30, Q+60, Q+90, Q+120, Q+150,0,	PANEL_MARK_YS,             363,363,363,363,363,363,0,	PANEL_MENU_TITLE_STRING,   "Proof Background ",	PANEL_MENU_TITLE_FONT,     iced_bold_font,	PANEL_MENU_CHOICE_STRINGS, "White",				   "25%  Grey",				   "root Grey", 				   "50%  Grey",				   "75%  Grey",  				   "Black",				   0, 	PANEL_MENU_CHOICE_FONTS,   iced_bold_font,0,	PANEL_VALUE,               GR_ROOT_GRAY,	PANEL_NOTIFY_PROC,         proof_background_proc,	0);}/************************************************************************//* handlers for the mouse and message panel items                       *//************************************************************************/static void confirm_mouse_proc() {   mousemsg("Confirm","Cancel","Cancel");}static void canvas_mouse_proc() {   mousemsg("Paint","Clear","Undo");}/************************************************************************//* handlers for the control panel items, in their creation order        *//************************************************************************/static Panel_setting dir_proc(item, event) Panel_item item; Event *event; {   iced_browser_filled = FALSE;   switch (event_action(event)) {      case CTRL_L:	 iced_load_proc(item);	 ctrl_s_pending = ctrl_q_pending = FALSE;	 return PANEL_NONE;      case CTRL_S:	 store_invoked_from_keyboard = TRUE;	 store_proc(item);	 store_invoked_from_keyboard = FALSE;	 ctrl_q_pending              = FALSE;	 ctrl_s_pending              = ctrl_s_pending ? FALSE : TRUE;	 return PANEL_NONE;      case CTRL_B: 	 iced_browse_proc();	 return PANEL_NONE;      case CTRL_Q:	 quit_invoked_from_keyboard = TRUE;	 quit_proc(item);	 quit_invoked_from_keyboard = FALSE;	 ctrl_s_pending             = FALSE;	 ctrl_q_pending             = ctrl_q_pending ? FALSE : TRUE;	 return PANEL_NONE;      default:	 if (ctrl_s_pending || ctrl_q_pending) {	    iced_panelmsg("","");	    ctrl_s_pending = ctrl_q_pending = FALSE;	 }	 return panel_text_notify(item, event);   }}inticed_change_directory(){   struct stat      stat_buf;   char *new_dir;      new_dir = (char *)panel_get_value(iced_dir_item);   if (stat(new_dir, &stat_buf) < 0)      return (0);   if (chdir(new_dir) < 0)      return (0);   return (1);}/*static inttextsw_change_directory(textsw, filename, might_not_be_dir, locx, locy)        Text_handle      textsw;        char            *filename;        int              might_not_be_dir;        int              locx, locy;{        char            *sys_msg;        char            *full_pathname;        char             msg[MAXNAMLEN+100];        struct stat      stat_buf;        int              result = 0;         errno = 0;        if (stat(filename, &stat_buf) < 0) {            result = -1;            goto Error;        }        if ((stat_buf.st_mode&S_IFMT) != S_IFDIR) {            if (might_not_be_dir)                return(-2);        }        if (chdir(filename) < 0) {            result = errno;            goto Error;        }        textsw_notify(textsw, TEXTSW_ACTION_CHANGED_DIRECTORY, filename, 0);        return(result);Error:        full_pathname = textsw_full_pathname(filename);        sprintf(msg, "Cannot %s '%s': ",                (might_not_be_dir ? "access file" : "cd to directory"),                full_pathname);        free(full_pathname);        sys_msg = (errno > 0 && errno < sys_nerr) ? sys_errlist[errno] : NULL;        textsw_post_error(textsw, locx, locy, msg, sys_msg);        return(result);}*/static Panel_setting fname_proc(item,event) Panel_item item; struct inputevent *event; {   iced_browser_filled = FALSE;   switch (event_action(event)) {      case ESC:	 iced_complete_filename();         ctrl_s_pending = ctrl_q_pending = FALSE;         return PANEL_NONE;      case CTRL_L:	 iced_load_proc(item);	 ctrl_s_pending = ctrl_q_pending = FALSE;	 return PANEL_NONE;      case CTRL_S:	 store_invoked_from_keyboard = TRUE;	 store_proc(item);	 store_invoked_from_keyboard = FALSE;	 ctrl_q_pending              = FALSE;	 ctrl_s_pending              = ctrl_s_pending ? FALSE : TRUE;	 return PANEL_NONE;      case CTRL_B: iced_browse_proc();	 return PANEL_NONE;      case CTRL_Q:	 quit_invoked_from_keyboard = TRUE;	 quit_proc(item);	 quit_invoked_from_keyboard = FALSE;	 ctrl_s_pending             = FALSE;	 ctrl_q_pending             = ctrl_q_pending ? FALSE : TRUE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -