void createimg_s (void) { Ihandle *img_restart, *img_play, *img_forward, *img_rewind, *img_pause; img_restart = IupImage(22,22, pixmap_restart); img_play = IupImage(22,22, pixmap_play); img_forward = IupImage(22,22, pixmap_forward); img_rewind = IupImage(22,22, pixmap_rewind); img_pause = IupImage(22,22, pixmap_pause); IupSetHandle ("img_restart", img_restart); IupSetHandle ("img_play", img_play); IupSetHandle ("img_forward", img_forward); IupSetHandle ("img_rewind", img_rewind); IupSetHandle ("img_pause", img_pause); IupSetAttribute (img_restart, "1", "0 0 0"); IupSetAttribute (img_restart, "2", "BGCOLOR"); IupSetAttribute (img_play, "1", "0 0 0"); IupSetAttribute (img_play, "2", "BGCOLOR"); IupSetAttribute (img_forward, "1", "0 0 0"); IupSetAttribute (img_forward, "2", "BGCOLOR"); IupSetAttribute (img_rewind, "1", "0 0 0"); IupSetAttribute (img_rewind, "2", "BGCOLOR"); IupSetAttribute (img_pause, "1", "0 0 0"); IupSetAttribute (img_pause, "2", "BGCOLOR"); }
static void iSpinLoadImages(void) { Ihandle* img; /* Spin UP image */ unsigned char iupspin_up_img[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* Spin DOWN image */ unsigned char iupspin_down_img[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; img = IupImage(9, 6, iupspin_up_img); IupSetAttribute(img, "0", "0 0 0"); IupSetAttribute(img, "1", "BGCOLOR"); IupSetHandle("IupSpinUpImage", img); img = IupImage(9, 6, iupspin_down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4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -1 }; decl( "icon_lib_configure", IupImage( 26, 26, map ), "0", "0 0 0", "1", "132 132 0", "2", "132 132 132", "3", "198 198 198", "4", "BGCOLOR", "5", "255 255 0", "6", "255 255 255", NULL ); decl( "icon_lib_configure_inactive", IupImage( 26, 26, map ), "0", "96 96 96", "1", "96 96 96", "2", "132 132 132", "3", "198 198 198", "4", "BGCOLOR", "5", "192 192 192", "6", "192 192 192", NULL ); }
static void iDetachBoxCreateCursor(void) { Ihandle *imgcursor; unsigned char detach_img_cur[16*16] = { 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,1,4,4,4,4,4,4,4,4,4,4,4,4,1, 0,0,1,4,4,4,4,4,4,4,4,4,4,4,4,1, 0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,1, 0,0,1,3,3,3,2,2,2,3,3,3,3,3,3,1, 1,1,1,1,1,1,2,2,2,1,1,1,1,1,3,1, 1,4,4,4,4,4,2,2,2,4,4,4,4,1,3,1, 1,4,4,4,4,4,2,2,2,4,4,4,4,1,1,1, 1,3,3,3,3,3,2,2,2,3,3,3,3,1,0,0, 1,3,3,3,2,2,2,2,2,2,2,3,3,1,0,0, 1,3,3,3,3,2,2,2,2,2,3,3,3,1,0,0, 1,3,3,3,3,3,2,2,2,3,3,3,3,1,0,0, 1,3,3,3,3,3,3,2,3,3,3,3,3,1,0,0, 1,3,3,3,3,3,3,3,3,3,3,3,3,1,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 }; imgcursor = IupImage(16, 16, detach_img_cur); IupSetAttribute(imgcursor, "0", "BGCOLOR"); IupSetAttribute(imgcursor, "1", "0 0 0"); IupSetAttribute(imgcursor, "2", "110 150 255"); IupSetAttribute(imgcursor, "3", "255 255 255"); IupSetAttribute(imgcursor, "4", "64 92 255"); IupSetHandle("IupDetachBoxCursor", imgcursor); }
static void iMatrixCreateCursor(void) { Ihandle *imgcursor; unsigned char matrx_img_cur_excel[15*15] = { 0,0,0,0,1,1,1,1,1,1,0,0,0,0,0, 0,0,0,0,1,2,2,2,2,1,1,0,0,0,0, 0,0,0,0,1,2,2,2,2,1,1,0,0,0,0, 0,0,0,0,1,2,2,2,2,1,1,0,0,0,0, 1,1,1,1,1,2,2,2,2,1,1,1,1,1,0, 1,2,2,2,2,2,2,2,2,2,2,2,2,1,1, 1,2,2,2,2,2,2,2,2,2,2,2,2,1,1, 1,2,2,2,2,2,2,2,2,2,2,2,2,1,1, 1,1,1,1,1,2,2,2,2,1,1,1,1,1,1, 0,1,1,1,1,2,2,2,2,1,1,1,1,1,1, 0,0,0,0,1,2,2,2,2,1,1,0,0,0,0, 0,0,0,0,1,2,2,2,2,1,1,0,0,0,0, 0,0,0,0,1,1,1,1,1,1,1,0,0,0,0, 0,0,0,0,0,1,1,1,1,1,1,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; imgcursor = IupImage(15, 15, matrx_img_cur_excel); IupSetAttribute(imgcursor, "0", "BGCOLOR"); IupSetAttribute(imgcursor, "1", "0 0 0"); IupSetAttribute(imgcursor, "2", "255 255 255"); IupSetAttribute(imgcursor, "HOTSPOT", "7:7"); /* Centered Hotspot */ IupSetHandle("IupMatrixCrossCursor", imgcursor); IupSetHandle("matrx_img_cur_excel", imgcursor); /* for backward compatibility */ }
static void icon_lib_copy (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_search", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "000 000 000", "2", "255 255 255", NULL ); }
void TrayTest(void) { Ihandle *dlg, *img; img = IupImage(16, 16, pixmap); IupSetAttribute(img, "0", "BGCOLOR"); IupSetAttribute(img, "1", "255 255 0"); IupSetAttribute(img, "2", "255 0 0"); IupSetAttribute(img, "3", "255 255 0"); IupSetHandle ("img", img); dlg = IupDialog(NULL); IupSetAttribute(dlg, "TITLE", "Tray Test"); IupSetAttribute(dlg, "TRAY", "YES"); IupSetAttribute(dlg, "TRAYTIP", "Tip at Tray"); IupSetAttribute(dlg, "TRAYIMAGE", "img"); IupSetAttribute(dlg, "SIZE", "100x100"); IupSetCallback(dlg, "TRAYCLICK_CB", (Icallback)trayclick); IupSetCallback(dlg, "CLOSE_CB", (Icallback)close_cb); IupSetCallback(dlg, "K_ESC", (Icallback)k_esc); IupShowXY(dlg, IUP_CENTER, IUP_CENTER); /* start only the task bar icon */ IupSetAttribute(dlg, "HIDETASKBAR", "YES"); }
static Ihandle* load_image_TestImage(void) { unsigned char image_data_8 [TEST_IMAGE_SIZE*TEST_IMAGE_SIZE] = { 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,0,0,0,1,1,1,1,2,2,2,2,0,0,0,5, 5,0,0,0,1,1,1,1,2,2,2,2,0,0,0,5, 5,0,0,0,1,1,1,1,2,2,2,2,0,0,0,5, 5,0,0,0,1,1,1,1,2,2,2,2,0,0,0,5, 5,0,0,0,3,3,3,3,4,4,4,4,0,0,0,5, 5,0,0,0,3,3,3,3,4,4,4,4,0,0,0,5, 5,0,0,0,3,3,3,3,4,4,4,4,0,0,0,5, 5,0,0,0,3,3,3,3,4,4,4,4,0,0,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, }; Ihandle* image = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8); IupSetAttribute(image, "0", "BGCOLOR"); IupSetAttribute(image, "1", "255 0 0"); IupSetAttribute(image, "2", "0 255 0"); IupSetAttribute(image, "3", "0 0 255"); IupSetAttribute(image, "4", "255 255 255"); IupSetAttribute(image, "5", "0 0 0"); return image; }
static void icon_lib_zoom_out (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,3,3,3,3,3,3,4,4,4,4,4,4,0,5, 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, }; Ihandle* image = IupImage(16, 16, imgdata); IupSetAttribute(image, "0", "BGCOLOR"); IupSetAttribute(image, "1", "255 0 0"); IupSetAttribute(image, "2", "0 255 0"); IupSetAttribute(image, "3", "0 0 255"); IupSetAttribute(image, "4", "255 255 255"); IupSetAttribute(image, "5", "0 0 0"); return image; }
static void icon_lib_save (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_save", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "074 074 074", "2", "234 234 142", "3", "255 255 255", NULL ); }
/* Main program */ int main(int argc, char **argv) { /* IUP identifiers */ Ihandle *dlg; Ihandle *img_star; Ihandle *lbl, *lbl_explain, *lbl_star; /* Initializes IUP */ IupOpen(&argc, &argv); /* Program begin */ /* Creates the star image */ img_star = IupImage ( 13, 13, pixmap_star ); /* Sets star image colors */ IupSetAttribute ( img_star, "1", "0 0 0"); IupSetAttribute ( img_star, "2", "0 198 0"); /* Associates "img_star" to image img_star */ IupSetHandle ( "img_star", img_star ); /* Creates a label */ lbl = IupLabel ( "This label has the following attributes set:\nBGCOLOR = 255 255 0\nFGCOLOR = 0 0 255\nFONT = COURIER_NORMAL_14\nTITLE = All text contained here\nALIGNMENT = ACENTER" ); /* Sets all the attributes of label lbl, except for IMAGE */ IupSetAttributes ( lbl, "BGCOLOR = \"255 255 0\", FGCOLOR = \"0 0 255\", FONT = COURIER_NORMAL_14, ALIGNMENT = ACENTER"); /* Creates a label to explain that the label on the right has an image */ lbl_explain = IupLabel ( "The label on the right has the image of a star" ); /* Creates a label whose title is not important, cause it will have an image */ lbl_star = IupLabel (NULL); /* Associates image "img_star" with label lbl_star */ IupSetAttribute ( lbl_star, "IMAGE", "img_star" ); /* Creates dialog with the label */ dlg = IupDialog ( IupVbox ( lbl, IupHbox ( lbl_explain, lbl_star, NULL ), NULL ) ); /* Sets title of the dialog */ IupSetAttribute ( dlg, "TITLE", "IupLabel Example" ); /* Shows dialog in the center of the screen */ IupShowXY ( dlg, IUP_CENTER, IUP_CENTER ); /* Initializes IUP main loop */ IupMainLoop(); /* Finishes IUP */ IupClose(); /* Program finished successfully */ return EXIT_SUCCESS; }
static void create_images(void) { Ihandle *image; image = IupImage(11, 11, pixmap_x); IupSetAttribute(image, "0", "BGCOLOR"); IupSetAttribute(image, "1", "0 1 0"); IupSetAttribute(image, "2", "255 0 0"); IupSetAttribute(image, "3", "255 255 0"); IupSetHandle("DLG_ICON", image); image = IupImage(32, 32, pixmap_cursor); IupSetAttribute(image, "0", "BGCOLOR"); /* always for cursor */ IupSetAttribute(image, "1", "255 0 0"); IupSetAttribute(image, "2", "128 0 0"); IupSetAttribute(image, "HOTSPOT", "21:10"); IupSetHandle("DLG_CURSOR", image); }
static void CreateImage(void) { int i, j; lua_Object linha; int width, height; unsigned char *pixels; lua_Object obj = luaL_tablearg(3); width = luaL_check_int(1); height = luaL_check_int(2); pixels = (unsigned char *) malloc(width*height); for (i = 1; i <= height; i++) { lua_beginblock(); lua_pushobject(obj); lua_pushnumber(i); linha = lua_gettable(); if (!lua_istable(linha)) { lua_endblock(); lua_error("iupCreateImage: incorrect value in argument"); } for (j = 1; j <= width; j++) { lua_Object n; lua_beginblock(); lua_pushobject(linha); lua_pushnumber(j); n = lua_gettable(); if (!lua_isnumber(n)) { lua_endblock(); lua_error("iupCreateImage: incorrect value in argument"); } pixels[(i - 1) * width + (j - 1)] = (unsigned char) lua_getnumber(n); lua_endblock(); } lua_pushobject(obj); lua_pushnumber(i); lua_pushnil(); lua_settable(); lua_endblock(); } lua_pushusertag(IupImage(width, height, pixels), iuplua_tag); free(pixels); }
static void icon_lib_freeze (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 1, 1, 1, 1, 0, 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0,13, 4, 8, 8, 2, 4, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 0, 0, 3, 7, 9, 8, 2,11, 2, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 1, 0, 9,11,11, 8, 2,15, 2,14, 6,10, 0, 0, 0, 0, 0, 0, 0, 0,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, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "153 150 158", "2", "127 062 032", "3", "255 239 239", "4", "241 239 209", "5", "129 139 079", "6", "004 000 000", "7", "187 164 039", "8", "255 255 148", "9", "253 244 188", "10", "017 009 000", "11", "255 255 214", "12", "255 206 008", "13", "255 189 008", "14", "002 006 008", "15", "255 255 222", NULL ); }
static void icon_lib_transfer (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 1, 2, 1, 1,11, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 5, 4, 6, 4, 5, 6, 5, 4, 4, 5,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 7, 9,10, 5, 5, 4, 5, 4, 4, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 7, 5, 4, 6, 4, 4, 5, 6, 4,15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 8, 9,10, 4, 5, 4, 5, 5, 4, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 6, 9, 9, 5, 9, 9, 9, 1, 2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 5, 4, 5, 5, 4, 5, 3,13,13,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 5, 9,10, 4, 8, 1,13,13,13, 1,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 7, 9, 9, 5,12,13,13,13,13, 1, 1,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 1, 5, 4, 5, 4, 4, 1,13, 1, 1, 1,11,14, 1,13, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 5, 4, 5, 5, 2,13,11, 1, 2, 1, 1,11,13, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 2, 1,11, 1,13,13,13,13, 1, 1,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,13,13,13, 1,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,14,13,13,13,13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_transfer", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "000 000 000", "2", "020 016 000", "3", "000 000 008", "4", "247 255 247", "5", "204 204 204", "6", "247 247 255", "7", "239 239 247", "8", "247 255 239", "9", "000 000 123", "10", "136 135 175", "11", "000 008 008", "12", "016 004 012", "13", "255 255 000", "14", "008 000 000", "15", "239 247 243", NULL ); }
static void icon_lib_connect (void) { char map[] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,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5", "255 0 0", "7", "255 255 255", "6", "BGCOLOR", NULL ); }
static void iTreeCreateCursor(void) { Ihandle *imgcursor; unsigned char tree_img_drag_cur[16*24] = { 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0 ,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0 ,1,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0 ,1,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0 ,1,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0 ,1,2,2,2,2,2,2,1,0,0,0,0,0,0,0,0 ,1,2,2,2,2,2,2,2,1,0,0,0,0,0,0,0 ,1,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0 ,1,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0 ,1,2,2,2,2,2,2,1,1,1,1,1,0,0,0,0 ,1,2,2,2,2,2,2,1,0,0,0,0,0,0,0,0 ,1,2,2,1,1,2,2,1,0,0,0,0,0,0,0,0 ,1,2,1,0,0,1,2,2,1,0,0,0,0,0,0,0 ,1,1,0,0,0,1,2,2,1,0,0,0,0,0,0,0 ,1,0,0,1,2,0,1,2,2,1,2,1,2,1,2,1 ,0,0,0,2,1,2,1,2,2,1,0,2,1,2,1,2 ,0,0,0,1,2,0,0,1,2,2,1,0,0,0,2,1 ,0,0,0,2,1,0,0,1,2,1,1,0,0,0,1,2 ,0,0,0,1,2,0,0,0,1,0,0,0,0,0,2,1 ,0,0,0,2,1,0,0,0,0,0,0,0,0,0,1,2 ,0,0,0,1,2,0,0,0,0,0,0,0,0,0,2,1 ,0,0,0,2,1,2,1,2,1,2,1,2,1,2,1,2 ,0,0,0,1,2,1,2,1,2,1,2,1,2,1,2,1 }; imgcursor = IupImage(16, 24, tree_img_drag_cur); IupSetAttribute(imgcursor, "0", "BGCOLOR"); IupSetAttribute(imgcursor, "1", "0 0 0"); IupSetAttribute(imgcursor, "2", "255 255 255"); IupSetAttribute(imgc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, 0, 0, 0, 0, 0, 0, 1, 3, 2, 3, 2, 3, 5, 6, 6, 6, 6, 6, 6, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 2, 3, 2, 5, 6, 5, 5, 5, 5, 5, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 5, 6, 6, 6, 6, 6, 6, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_paste", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "000 000 000", "2", "132 132 000", "3", "206 206 206", "4", "255 255 000", "5", "000 000 132", "6", "255 255 255", NULL ); }
static void icon_lib_help (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_help", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "074 074 074", "2", "255 255 255", "3", "165 165 165", "4", "255 255 074", "5", "074 074 165", "6", "214 214 214", NULL ); }
static void icon_lib_preview (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,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; decl( "icon_lib_preview", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "074 074 074", "2", "255 255 255", "3", "165 165 165", "4", "214 214 214", "5", "074 255 255", NULL ); }
static void icon_lib_open (void) { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 4, 0, 0, 0, 0, 0, 0, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 1, 3, 2, 3, 2, 3, 2, 3, 2, 3, 1, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 2, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 4, 4, 4, 4, 0, 0, 0, 0, 0, 1, 2, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 }; decl( "icon_lib_open", IupImage( 23, 23, map ), "ORIGIN", "EdPatt", "0", "BGCOLOR", "1", "000 000 000", "2", "255 255 000", "3", "255 255 255", "4", "128 128 128", "5", "132 132 000", NULL ); }
static void iTreeInitializeImages(void) { Ihandle *image_leaf, *image_blank, *image_paper; Ihandle *image_collapsed, *image_expanded; unsigned char img_leaf[ITREE_IMG_WIDTH*ITREE_IMG_HEIGHT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 2, 2, 2, 2, 2, 2, 2, 2, 0 }; unsigned char img_paper[ITREE_IMG_WIDTH*ITREE_IMG_HEIGHT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 0, 0, 0, 0, 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 0, 0, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 4, 0, 0, 0, 0, 3, 1, 4, 3, 4, 3, 4, 3, 4, 2, 2, 2, 2, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 0, 0, 0, 3, 1, 3, 4, 3, 4, 3, 4, 3, 4, 1, 5, 2, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 0, 0, 0, 3, 1, 4, 3, 4, 3, 4, 3, 4, 3, 1, 5, 2, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 0, 0, 0, 3, 1, 3, 4, 3, 4, 3, 4, 3, 4, 1, 5, 2, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 0, 0, 0, 3, 1, 4, 3, 4, 3, 4, 3, 4, 3, 1, 5, 2, 0, 0, 0, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 0, 0, 0, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0 }; image_leaf = IupImage(ITREE_IMG_WIDTH, ITREE_IMG_HEIGHT, img_leaf); image_collapsed = IupImage(ITREE_IMG_WIDTH, ITREE_IMG_HEIGHT, img_collapsed); image_expanded = IupImage(ITREE_IMG_WIDTH, ITREE_IMG_HEIGHT, img_expanded); image_blank = IupImage(ITREE_IMG_WIDTH, ITREE_IMG_HEIGHT, img_blank); image_paper = IupImage(ITREE_IMG_WIDTH, ITREE_IMG_HEIGHT, img_paper); IupSetAttribute(image_leaf, "0", "BGCOLOR"); IupSetAttribute(image_leaf, "1", "192 192 192"); IupSetAttribute(image_leaf, "2", "56 56 56"); IupSetAttribute(image_leaf, "3", "99 99 99"); IupSetAttribute(image_leaf, "4", "128 128 128"); IupSetAttribute(image_leaf, "5", "161 161 161"); IupSetAttribute(image_leaf, "6", "222 222 222"); IupSetAttribute(image_collapsed, "0", "BGCOLOR"); IupSetAttribute(image_collapsed, "1", "255 206 156"); IupSetAttribute(image_collapsed, "2", "156 156 0"); IupSetAttribute(image_collapsed, "3", "0 0 0"); IupSetAttribute(image_collapsed, "4", "206 206 99"); IupSetAttribute(image_collapsed, "5", "255 255 206"); IupSetAttribute(image_collapsed, "6", "247 247 247"); IupSetAttribute(image_collapsed, "7", "255 255 156"); IupSetAttribute(image_expanded, "0", "BGCOLOR"); IupSetAttribute(image_expanded, "1", "255 255 255"); IupSetAttribute(image_expanded, "2", "156 156 0"); IupSetAttribute(image_expanded, "3", "255 255 156"); IupSetAttribute(image_expanded, "4", "0 0 0"); IupSetAttribute(image_expanded, "5", "255 206 156"); IupSetAttribute(image_expanded, "6", "206 206 99"); IupSetAttribute(image_blank, "0", "BGCOLOR"); IupSetAttribute(image_blank, "1", "255 255 255"); IupSetAttribute(image_blank, "2", "000 000 000"); IupSetAttribute(image_blank, "3", "119 119 119"); IupSetAttribute(image_blank, "4", "136 136 136"); IupSetAttribute(image_blank, "5", "187 187 187"); IupSetAttribute(image_paper, "0", "BGCOLOR"); IupSetAttribute(image_paper, "1", "255 255 255"); IupSetAttribute(image_paper, "2", "000 000 000"); IupSetAttribute(image_paper, "3", "119 119 119"); IupSetAttribute(image_paper, "4", "136 136 136"); IupSetAttribute(image_paper, "5", "187 187 187"); IupSetHandle("IMGLEAF", image_leaf); IupSetHandle("IMGCOLLAPSED", image_collapsed); IupSetHandle("IMGEXPANDED", image_expanded); IupSetHandle("IMGBLANK", image_blank); IupSetHandle("IMGPAPER", image_paper); }
void LabelTest(void) { Ihandle *dlg, *label, *image1, *image2, *image3, *box1, *box2, *fill; box1 = IupVbox(NULL); IupSetAttribute(box1, "MARGIN", "5x5"); IupSetAttribute(box1, "GAP", "5"); IupSetAttribute(box1, "BGCOLOR", "75 150 170"); /* label must be transparent for BGCOLOR */ IupSetAttribute(box1, "PADDING", "5x5"); label = IupLabel(NULL); if (IupGetInt(NULL, "UTF8MODE")) IupSetAttribute(label, "TITLE", "Text Labels (çãõáóé)"); else IupSetAttribute(label, "TITLE", "Text Labels (ηγυασι)"); //IupSetAttribute(label, "BGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(label, "PADDING", "0x0"); IupSetAttribute(label, "TIP", "Text Label"); IupAppend(box1, label); label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "HORIZONTAL"); IupAppend(box1, label); label = IupLabel(NULL); IupSetAttribute(label, "TITLE", "Text &Label\nSecond Line"); IupSetAttribute(label, "FGCOLOR", "0 0 255"); IupSetAttribute(label, "RASTERSIZE", "150x70"); // IupSetAttribute(label, "RASTERSIZE", "30x70"); // IupSetAttribute(label, "WORDWRAP", "YES"); // IupSetAttribute(label, "ELLIPSIS", "YES"); IupSetAttribute(label, "ALIGNMENT", "ALEFT:ATOP"); IupAppend(box1, label); label = IupLabel(NULL); IupSetAttribute(label, "TITLE", "Text\nSecond Line"); IupSetAttribute(label, "RASTERSIZE", "150x70"); IupSetAttribute(label, "ALIGNMENT", "ACENTER:ACENTER"); IupSetAttribute(label, "FONT", "Helvetica, Underline 14"); // IupSetAttribute(label, "FONTSIZE", "14"); // IupSetAttribute(label, "FONTSTYLE", "Italic"); // IupSetAttribute(label, "FONTSTYLE", "Bold"); IupAppend(box1, label); label = IupLabel(NULL); IupSetAttribute(label, "TITLE", "Text\n<b>Second Line</b>"); IupSetAttribute(label, "RASTERSIZE", "150x70"); IupSetAttribute(label, "ALIGNMENT", "ARIGHT:ABOTTOM"); IupSetAttribute(label, "MARKUP", "YES"); IupAppend(box1, label); box2 = IupVbox(NULL); IupSetAttribute(box2, "MARGIN", "5x5"); IupSetAttribute(box2, "GAP", "5"); IupSetAttribute(box2, "BGCOLOR", "75 150 170"); IupSetAttribute(box2, "PADDING", "5x5"); image1 = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8); IupSetAttribute(image1, "0", "BGCOLOR"); IupSetAttribute(image1, "1", "255 0 0"); IupSetAttribute(image1, "2", "0 255 0"); IupSetAttribute(image1, "3", "0 0 255"); IupSetAttribute(image1, "4", "255 255 255"); IupSetAttribute(image1, "5", "0 0 0"); label = IupLabel(NULL); IupSetAttributeHandle(label, "IMAGE", image1); //IupSetAttribute(label, "IMAGE", "TECGRAF_BITMAP"); //IupSetAttribute(label, "IMAGE", "../test/tecgraf.bmp"); //IupSetAttribute(label, "IMAGE", "../test/file_large.xbm"); //IupSetAttribute(label, "IMAGE", "gtk-open"); //IupSetAttribute(label, "BGCOLOR", IupGetGlobal("DLGBGCOLOR")); IupSetAttribute(label, "PADDING", "0x0"); IupSetAttribute(label, "TIP", "Image Label"); IupAppend(box2, label); label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "HORIZONTAL"); IupAppend(box2, label); fill = IupFill(); IupSetAttribute(fill, "SIZE", "20"); IupAppend(box2, fill); label = IupLabel(NULL); IupSetAttributeHandle(label, "IMAGE", image1); IupSetAttribute(label, "RASTERSIZE", "150x50"); IupAppend(box2, label); image2 = IupImageRGB(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_24); label = IupLabel(NULL); IupSetAttributeHandle(label, "IMAGE", image2); IupSetAttribute(label, "RASTERSIZE", "150x50"); IupSetAttribute(label, "ALIGNMENT", "ACENTER"); IupAppend(box2, label); image3 = IupImageRGBA(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_32); label = IupLabel(NULL); IupSetAttributeHandle(label, "IMAGE", image3); IupSetAttribute(label, "RASTERSIZE", "150x50"); IupSetAttribute(label, "ALIGNMENT", "ARIGHT"); IupAppend(box2, label); label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "VERTICAL"); dlg = IupDialog(IupHbox(box1, label, box2, NULL)); IupSetAttribute(dlg, "TITLE", "IupLabel Test"); // IupSetAttribute(dlg, "BACKGROUND", "0 0 128"); // IupSetAttributeHandle(dlg, "BACKGROUND", image2); IupSetCallback(dlg, "ENTERWINDOW_CB", enter_cb); IupShow(dlg); // IupShowXY(dlg,IUP_LEFT,IUP_BOTTOM); }
void ScrollBoxTest(void) { Ihandle *mnu, *_hbox_1, *_cnv_1, *_vbox_1, *dlg, *img, *_vbox_2, *_frm_1, *_frm_2, *_frm_3, *_frm_4, *_frm_5, *pbar, *val, *tabs, *_list_1, *_list_2, *_list_3, *_text_1, *_ml_1, *tree; //img = IupImage(32,32, img_bits1); //IupSetHandle ("img1", img); //IupSetAttribute (img, "0", "0 0 0"); //IupSetAttribute (img, "1", "BGCOLOR"); //IupSetAttribute (img, "2", "255 0 0"); img = load_image_Tecgraf(); IupSetHandle ("img1", img); img = IupImage(32,32, img_bits2); IupSetHandle ("img2", img); IupSetAttribute (img, "0", "0 0 0"); IupSetAttribute (img, "1", "0 255 0"); IupSetAttribute (img, "2", "BGCOLOR"); IupSetAttribute (img, "3", "255 0 0"); mnu = IupMenu( IupSubmenu("IupSubmenu 1", IupMenu( IupSetAttributes(IupItem("IupItem 1 Checked", NULL), "VALUE=ON"), IupSeparator(), IupSetAttributes(IupItem("IupItem 2 Disabled", NULL), "ACTIVE=NO"), NULL)), IupItem("IupItem 3", NULL), IupItem("IupItem 4", NULL), NULL); IupSetHandle("mnu",mnu); _frm_1 = IupFrame( IupVbox( set_callbacks(IupSetAttributes(IupButton("Button Text", NULL), "PADDING=5x5, TIP=\"Button TIP\"")), IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("Text", NULL), "IMAGE=img1, PADDING=5x5")),"ACTION", action1_cb, NULL), IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=img1")),"ACTION", action2_cb, NULL), IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("", NULL), "IMAGE=img1,IMPRESS=img2")),"ACTION", action3_cb, NULL), IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "BGCOLOR=\"255 0 128\", SIZE=20x10")),"ACTION", action3_cb, NULL), NULL)); IupSetAttribute(_frm_1,"TITLE","IupButton"); _frm_2 = IupFrame( IupVbox( IupSetAttributes(IupLabel("Label Text"), "TIP=\"Label TIP\""), IupSetAttributes(IupLabel(NULL), "SEPARATOR=HORIZONTAL, NAME=SAMP_SEP"), IupSetAttributes(IupLabel(NULL), "IMAGE=img1"), NULL)); IupSetAttribute(_frm_2,"TITLE","IupLabel"); _frm_3 = IupFrame( IupVbox( set_callbacks(IupSetAttributes(IupToggle("Toggle Text", NULL), "VALUE=ON, TIP=\"Toggle TIP\"")), set_callbacks(IupSetAttributes(IupToggle(NULL, NULL), "VALUE=ON,IMAGE=img1,IMPRESS=img2")), set_callbacks(IupSetAttributes(IupToggle(NULL, NULL), "VALUE=ON,IMAGE=img1")), IupSetAttributes(IupFrame(IupRadio(IupVbox( set_callbacks(IupToggle("Toggle Text", NULL)), set_callbacks(IupToggle("Toggle Text", NULL)), NULL))), "TITLE=IupRadio"), NULL)); IupSetAttribute(_frm_3,"TITLE","IupToggle"); _text_1 = IupText( NULL); IupSetAttribute(_text_1,"VALUE","Single Line Text"); IupSetAttribute(_text_1,"SIZE","80x"); IupSetAttribute(_text_1,"TIP","Text TIP"); _ml_1 = IupMultiLine( NULL); IupSetAttribute(_ml_1,"VALUE","Multiline Text\nSecond Line\nThird Line"); IupSetAttribute(_ml_1,"EXPAND","YES"); IupSetAttribute(_ml_1,"SIZE","80x40"); IupSetAttribute(_ml_1,"TIP","Multiline TIP"); _frm_4 = IupFrame(IupVbox( set_callbacks(_text_1), set_callbacks(_ml_1), NULL)); IupSetAttribute(_frm_4,"TITLE","IupText"); _list_1 = IupList( NULL); // IupSetAttribute(_list_1,"EXPAND","YES"); IupSetAttribute(_list_1,"VALUE","1"); IupSetAttribute(_list_1,"1","Item 1 Text"); IupSetAttribute(_list_1,"2","Item 2 Text"); IupSetAttribute(_list_1,"3","Item 3 Text"); IupSetAttribute(_list_1,"TIP","List 1"); _list_2 = IupList( NULL); IupSetAttribute(_list_2,"DROPDOWN","YES"); // IupSetAttribute(_list_2,"EXPAND","YES"); IupSetAttribute(_list_2,"VALUE","2"); IupSetAttribute(_list_2,"1","Item 1 Text"); IupSetAttribute(_list_2,"2","Item 2 Text"); IupSetAttribute(_list_2,"3","Item 3 Text"); IupSetAttribute(_list_2,"TIP","List 2"); _list_3 = IupList( NULL); IupSetAttribute(_list_3,"EDITBOX","YES"); // IupSetAttribute(_list_3,"EXPAND","YES"); IupSetAttribute(_list_3,"VALUE","3"); IupSetAttribute(_list_3,"1","Item 1 Text"); IupSetAttribute(_list_3,"2","Item 2 Text"); IupSetAttribute(_list_3,"3","Item 3 Text"); IupSetAttribute(_list_3,"TIP","List 3"); _frm_5 = IupFrame(IupVbox( set_callbacks(_list_1), set_callbacks(_list_2), set_callbacks(_list_3), NULL)); IupSetAttribute(_frm_5,"TITLE","IupList"); _hbox_1 = IupHbox( _frm_1, _frm_2, _frm_3, _frm_4, _frm_5, NULL); val = IupVal(NULL); IupSetAttribute(val,"TIP","Valuator TIP"); set_callbacks(val); pbar = IupProgressBar(); IupSetAttribute(pbar, "VALUE", "0.5"); IupSetAttribute(pbar,"TIP","ProgressBar TIP"); set_callbacks(pbar); tabs = IupTabs(IupVbox(IupLabel("Tab0"), NULL), IupVbox(IupLabel("Tab1"), NULL), IupVbox(IupLabel("Tab2"), NULL), NULL); IupSetAttribute(tabs,"TABTITLE0","Tab Title 0"); IupSetAttribute(tabs,"TABTITLE1","Tab Title 1"); IupSetAttributeHandle(tabs,"TABIMAGE1", load_image_LogoTecgraf()); IupSetAttribute(tabs,"TABTITLE2","Tab Title 2"); IupSetAttribute(tabs,"RASTERSIZE","300x50"); IupSetAttribute(tabs,"TIP","Tabs TIP"); // IupSetAttribute(tabs,"PADDING","5x5"); set_callbacks(tabs); tree = IupTree(); IupSetAttribute(tree, "SHOWRENAME", "YES"); IupSetAttribute(tree,"RASTERSIZE","300x150"); IupSetAttribute(tree,"TIP","Tree TIP"); IupSetAttribute(tree,"EXPAND","NO"); set_callbacks(tree); _cnv_1 = IupCanvas(NULL); IupSetAttribute(_cnv_1,"BGCOLOR","128 255 0"); IupSetAttribute(_cnv_1,"SCROLLBAR","YES"); // IupSetAttribute(_cnv_1,"EXPAND","HORIZONTAL"); IupSetAttribute(_cnv_1,"EXPAND","NO"); IupSetAttribute(_cnv_1,"RASTERSIZE","200x100"); IupSetAttribute(_cnv_1,"TIP","Canvas TIP"); // IupSetAttribute(_cnv_1,"CANFOCUS","NO"); set_callbacks(_cnv_1); _vbox_1 = IupVbox( _hbox_1, IupHbox(IupSetAttributes(IupFrame(IupHbox(val, NULL)), "TITLE=IupVal"), IupSetAttributes(IupFrame(IupHbox(pbar, NULL)), "TITLE=IupProgressBar"), IupSetAttributes(IupFrame(IupHbox(tabs, NULL)), "TITLE=IupTabs"), NULL), IupHbox(IupSetAttributes(IupFrame(IupHbox(_cnv_1, NULL)), "TITLE=IupCanvas"), IupSetAttributes(IupFrame(IupHbox(tree, NULL)), "TITLE=IupTree"), NULL), IupHbox(IupSetAttributes(IupFrame(IupHbox(create_matrix(), NULL)), "TITLE=IupMatrix"), NULL), NULL); IupSetAttribute(_vbox_1,"MARGIN","5x5"); IupSetAttribute(_vbox_1,"GAP","5"); // _vbox_2 = IupVbox(IupSetAttributes(IupScrollBox(_vbox_1), "RASTERSIZE=400x300"), NULL); _vbox_2 = IupVbox(IupScrollBox(_vbox_1), NULL); IupSetAttribute(_vbox_2,"MARGIN","20x20"); dlg = IupDialog(_vbox_2); IupSetHandle("dlg",dlg); IupSetAttribute(dlg,"MENU","mnu"); IupSetAttribute(dlg,"TITLE","IupDialog Title"); // IupSetAttribute(dlg,"COMPOSITED","YES"); /* Windows Only */ // IupSetAttribute(dlg, "OPACITY", "192"); // IupSetAttribute(dlg, "RESIZE", "NO"); // IupSetAttribute(dlg, "BGCOLOR", "173 177 194"); // Motif BGCOLOR for documentation // IupSetAttribute(_vbox_1, "BGCOLOR", "92 92 255"); // IupSetAttribute(dlg, "BGCOLOR", "92 92 255"); // IupSetAttribute(dlg, "BACKGROUND", "200 10 80"); //IupSetGlobal("DLGBGCOLOR", "92 92 255"); //IupSetGlobal("TXTFGCOLOR", "255 92 92"); //IupSetGlobal("TXTBGCOLOR", "92 92 255"); // IupSetAttribute(dlg, "FONT", "Helvetica, 24"); // IupSetAttribute(dlg, "FONT", "-*-helvetica-*-r-*-*-18-*-*-*-*-*-*-*"); // IupSetAttribute(box, "FGCOLOR", "255 0 0"); //IupSetAttribute(dlg,"RASTERSIZE","1000x800"); IupSetAttribute(dlg,"RASTERSIZE","400x300"); IupSetCallback(dlg, "RESIZE_CB", (Icallback)resize_cb); IupMap(dlg); IupSetAttribute(tree, "TITLE0", "Figures"); IupSetAttribute(tree, "ADDLEAF0", "Other"); /* new id=1 */ IupSetAttribute(tree, "ADDBRANCH1", "triangle"); /* new id=2 */ IupSetAttribute(tree, "ADDLEAF2", "equilateral"); /* ... */ IupSetAttribute(tree, "ADDLEAF3", "isoceles"); IupSetAttribute(tree, "ADDLEAF4", "scalenus"); IupShow(dlg); IupSetAttribute(dlg,"RASTERSIZE", NULL); }
}), _create_submenu("&Help",(MenuItem[]){ {"&Wiki\tF1", (Icallback)_wiki, CONDITION_NONE}, {"&About", (Icallback)_about, CONDITION_NONE}, {NULL} }), NULL ); //List of images list = IupList(NULL); IupSetAttributes(list, "EXPAND=VERTICAL, SHOWIMAGE=YES, MINSIZE=155x, VISIBLELINES=1"); IupSetCallback(list, "ACTION", (Icallback)_render_image); //Image containers placeholder = IupImage(1,1,0); //This is needed for some reason preview = IupLabel(NULL); IupSetAttributeHandle(preview, "IMAGE", placeholder); imgmod = IupGridBox(NULL); IupSetAttributes(imgmod, "GAPLIN=5, GAPCOL=5"); //Horizontal box to contain all but the console Ihandle* hbox = IupHbox( list, IupSplit( IupVbox( IupSetAttributes(IupLabel("Scaled Image"),"ALIGNMENT=ACENTER, EXPAND=HORIZONTAL"), IupScrollBox(preview), NULL ), IupVbox(
void CanvasTest(void) { Ihandle *dlg, *canvas, *box, *image; //image = IupImage(32, 32, pixmap_cursor); //IupSetAttribute(image, "1", "255 0 0"); //IupSetAttribute(image, "2", "128 0 0"); //IupSetAttribute(image, "HOTSPOT", "21:10"); image = IupImage(15,15, matrx_img_cur_excel); IupSetAttribute (image, "0", "BGCOLOR"); IupSetAttribute (image, "1", "0 0 0"); IupSetAttribute (image, "2", "255 255 255"); IupSetAttribute (image, "HOTSPOT", "7:7"); box = IupVbox(NULL); IupSetAttribute(box, "MARGIN", "5x5"); canvas = IupCanvas(NULL); IupAppend(box, canvas); IupSetAttribute(canvas, "RASTERSIZE", "300x200"); IupSetAttribute(canvas, "TIP", "Canvas Tip"); IupSetAttribute(canvas, "SCROLLBAR", "HORIZONTAL"); //IupSetAttribute(canvas, "BGCOLOR", "0 255 0"); // IupSetAttribute(canvas, "SCROLLBAR", "NO"); // IupSetAttribute(canvas, "XAUTOHIDE", "NO"); IupSetAttribute(canvas, "XMAX", "600"); IupSetAttribute(canvas, "DX", "300"); /* use a 1x1 scale, this value is updated in RESIZE_CB, so when the canvas is larger than 600 it will hide the scrollbar */ //IupSetAttributeHandle(canvas, "CURSOR", image); IupSetAttribute(canvas, "DROPTARGET", "YES"); IupSetAttribute(canvas, "DROPTYPES", "TEXT"); IupSetCallback (canvas, "DROPDATA_CB", (Icallback)testDropData_cb); // IupSetAttribute(canvas, "BORDER", "NO"); // IupSetAttribute(canvas, "CURSOR", "CROSS"); IupSetCallback(canvas, "MAP_CB", (Icallback)map_cb); IupSetCallback(canvas, "KEYPRESS_CB", (Icallback)keypress_cb); IupSetCallback(canvas, "K_ANY", (Icallback)k_any); IupSetCallback(canvas, "HELP_CB", (Icallback)help_cb); IupSetCallback(canvas, "GETFOCUS_CB", (Icallback)getfocus_cb); IupSetCallback(canvas, "KILLFOCUS_CB", (Icallback)killfocus_cb); IupSetCallback(canvas, "FOCUS_CB", (Icallback)focus_cb); IupSetCallback(canvas, "ENTERWINDOW_CB", (Icallback)enterwindow_cb); IupSetCallback(canvas, "LEAVEWINDOW_CB", (Icallback)leavewindow_cb); IupSetCallback(canvas, "BUTTON_CB", (Icallback)button_cb); // IupSetCallback(canvas, "MOTION_CB", (Icallback)motion_cb); IupSetCallback(canvas, "SCROLL_CB", (Icallback)scroll_cb); // IupSetCallback(canvas, "WHEEL_CB", (Icallback)wheel_cb); IupSetCallback(canvas, "RESIZE_CB", (Icallback)resize_cb); // IupSetAttribute(canvas, "BGCOLOR", "255 128 128"); IupSetCallback(canvas, "ACTION", (Icallback)action); // Windows and GTK Only IupSetCallback(canvas, "DROPFILES_CB", (Icallback)dropfiles_cb); //{ // Ihandle* cnv = IupCanvas(NULL); // IupAppend(box, cnv); // IupSetAttribute(cnv, "RASTERSIZE", "300x200"); // IupSetAttribute(cnv, "CURSOR", "NONE"); //} dlg = IupDialog(box); IupSetAttribute(dlg, "TITLE", "IupCanvas Test"); printf("IupMap\n"); IupMap(dlg); printf("IupShow\n"); IupShow(dlg); IupSetAttribute(canvas, "RASTERSIZE", NULL); /* release the minimum limitation */ }
void init(int argc, char* argv[]) { UINT ix; Ihandle *topVbox, *bottomVbox, *dialogVBox, *controlHbox; Ihandle *noneIcon, *doingIcon, *errorIcon; char* arg_value = NULL; // fill in config loadConfig(); // iup inits IupOpen(&argc, &argv); // this is so easy to get wrong so it's pretty worth noting in the program statusLabel = IupLabel("NOTICE: When capturing localhost (loopback) packets, you CAN'T include inbound criteria.\n" "Filters like 'udp' need to be 'udp and outbound' to work. See readme for more info."); IupSetAttribute(statusLabel, "EXPAND", "HORIZONTAL"); IupSetAttribute(statusLabel, "PADDING", "8x8"); topFrame = IupFrame( topVbox = IupVbox( filterText = IupText(NULL), controlHbox = IupHbox( stateIcon = IupLabel(NULL), filterButton = IupButton("Start", NULL), IupFill(), IupLabel("Presets: "), filterSelectList = IupList(NULL), NULL ), NULL ) ); // parse arguments and set globals *before* setting up UI. // arguments can be read and set after callbacks are setup // FIXME as Release is built as WindowedApp, stdout/stderr won't show LOG("argc: %d", argc); if (argc > 1) { if (!parseArgs(argc, argv)) { fprintf(stderr, "invalid argument count. ensure you're using options as \"--drop on\""); exit(-1); // fail fast. } parameterized = 1; } IupSetAttribute(topFrame, "TITLE", "Filtering"); IupSetAttribute(topFrame, "EXPAND", "HORIZONTAL"); IupSetAttribute(filterText, "EXPAND", "HORIZONTAL"); IupSetCallback(filterText, "VALUECHANGED_CB", (Icallback)uiFilterTextCb); IupSetAttribute(filterButton, "PADDING", "8x"); IupSetCallback(filterButton, "ACTION", uiStartCb); IupSetAttribute(topVbox, "NCMARGIN", "4x4"); IupSetAttribute(topVbox, "NCGAP", "4x2"); IupSetAttribute(controlHbox, "ALIGNMENT", "ACENTER"); // setup state icon IupSetAttribute(stateIcon, "IMAGE", "none_icon"); IupSetAttribute(stateIcon, "PADDING", "4x"); // fill in options and setup callback IupSetAttribute(filterSelectList, "VISIBLECOLUMNS", "24"); IupSetAttribute(filterSelectList, "DROPDOWN", "YES"); for (ix = 0; ix < filtersSize; ++ix) { char ixBuf[4]; sprintf(ixBuf, "%d", ix+1); // ! staring from 1, following lua indexing IupStoreAttribute(filterSelectList, ixBuf, filters[ix].filterName); } IupSetAttribute(filterSelectList, "VALUE", "1"); IupSetCallback(filterSelectList, "ACTION", (Icallback)uiListSelectCb); // set filter text value since the callback won't take effect before main loop starts IupSetAttribute(filterText, "VALUE", filters[0].filterValue); // functionalities frame bottomFrame = IupFrame( bottomVbox = IupVbox( NULL ) ); IupSetAttribute(bottomFrame, "TITLE", "Functions"); IupSetAttribute(bottomVbox, "NCMARGIN", "4x4"); IupSetAttribute(bottomVbox, "NCGAP", "4x2"); // create icons noneIcon = IupImage(8, 8, icon8x8); doingIcon = IupImage(8, 8, icon8x8); errorIcon = IupImage(8, 8, icon8x8); IupSetAttribute(noneIcon, "0", "BGCOLOR"); IupSetAttribute(noneIcon, "1", "224 224 224"); IupSetAttribute(doingIcon, "0", "BGCOLOR"); IupSetAttribute(doingIcon, "1", "109 170 44"); IupSetAttribute(errorIcon, "0", "BGCOLOR"); IupSetAttribute(errorIcon, "1", "208 70 72"); IupSetHandle("none_icon", noneIcon); IupSetHandle("doing_icon", doingIcon); IupSetHandle("error_icon", errorIcon); // setup module uis for (ix = 0; ix < MODULE_CNT; ++ix) { uiSetupModule(*(modules+ix), bottomVbox); } // dialog dialog = IupDialog( dialogVBox = IupVbox( topFrame, bottomFrame, statusLabel, NULL ) ); IupSetAttribute(dialog, "TITLE", "clumsy " CLUMSY_VERSION); IupSetAttribute(dialog, "SIZE", "400x"); // add padding manually to width IupSetAttribute(dialog, "RESIZE", "NO"); IupSetCallback(dialog, "SHOW_CB", (Icallback)uiOnDialogShow); // global layout settings to affect childrens IupSetAttribute(dialogVBox, "ALIGNMENT", "ACENTER"); IupSetAttribute(dialogVBox, "NCMARGIN", "4x4"); IupSetAttribute(dialogVBox, "NCGAP", "4x2"); // setup timer timer = IupTimer(); IupSetAttribute(timer, "TIME", STR(ICON_UPDATE_MS)); IupSetCallback(timer, "ACTION_CB", uiTimerCb); // setup timeout of program arg_value = IupGetGlobal("timeout"); if(arg_value != NULL) { char valueBuf[16]; sprintf(valueBuf, "%s000", arg_value); // convert from seconds to milliseconds timeout = IupTimer(); IupStoreAttribute(timeout, "TIME", valueBuf); IupSetCallback(timeout, "ACTION_CB", uiTimeoutCb); IupSetAttribute(timeout, "RUN", "YES"); } }