void GLCanvasCubeTest(void) { Ihandle *dlg, *canvas, *box, *gtoggle, *gtoggle1, *gtoggle2, *hbox, *vbox, *glabel, *gsep1, *gsep2, *gbutton1, *gbutton2, *pbar1, *pbar2, *glink, *gval1, *gval2, *gframe1, *gframe2, *gexp1, *gexp2, *image_open, *image_close, *image_high, *gframe3, *vbox2, *gtoggle3, *gtoggle4, *gtoggle5, *gsbox, *text, *vbox3, *matrix, *image_val; IupGLCanvasOpen(); IupGLControlsOpen(); IupControlsOpen(); glabel = IupGLLabel("Label"); // IupSetAttribute(glabel, "FGCOLOR", "255 255 255"); IupSetAttribute(glabel, "FONT", "Helvetica, 24"); IupSetAttributeHandle(glabel, "IMAGE", load_image_Tecgraf()); gbutton1 = IupGLButton("Button"); IupSetAttribute(gbutton1, "PADDING", "5x5"); //IupSetAttribute(gbutton1, "BGCOLOR", "245 0 245 92"); IupSetCallback(gbutton1, "ACTION", button_action_cb); IupSetAttribute(gbutton1, "NAME", "button1"); IupSetAttribute(gbutton1, "TIP", "Button Tip"); // IupSetAttribute(gbutton1, "RASTERSIZE", "x100"); if (0) { Ihandle* pressed_back = IupLoadImage("../test/pressed_back.png"); Ihandle* enabled_back = IupLoadImage("../test/enabled_back.png"); Ihandle* highlighted_back = IupLoadImage("../test/highlighted_back.png"); IupSetAttributeHandle(gbutton1, "BACKIMAGE", enabled_back); IupSetAttributeHandle(gbutton1, "BACKIMAGEPRESS", pressed_back); IupSetAttributeHandle(gbutton1, "BACKIMAGEHIGHLIGHT", highlighted_back); IupSetAttribute(gbutton1, "BORDERCOLOR", "0 0 0 0"); } gbutton2 = IupGLButton(NULL); IupSetAttribute(gbutton2, "PADDING", "5x5"); IupSetAttributeHandle(gbutton2, "IMAGE", load_image_FileSave()); IupSetCallback(gbutton2, "ACTION", button_action_cb); IupSetAttribute(gbutton2, "NAME", "button2"); gtoggle = IupGLToggle("Toggle"); IupSetAttribute(gtoggle, "PADDING", "5x5"); IupSetCallback(gtoggle, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle, "NAME", "toggle"); gtoggle1 = IupGLToggle(NULL); IupSetAttribute(gtoggle1, "PADDING", "5x5"); IupSetAttributeHandle(gtoggle1, "IMAGE", load_image_Test()); IupSetCallback(gtoggle1, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle1, "NAME", "toggle1"); gtoggle2 = IupGLToggle(NULL); IupSetAttribute(gtoggle2, "PADDING", "5x5"); IupSetAttributeHandle(gtoggle2, "IMAGE", load_image_Test()); IupSetCallback(gtoggle2, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle2, "NAME", "toggle2"); gsep1 = IupGLSeparator(); glink = IupGLLink("http://www.tecgraf.puc-rio.br/iup", "IUP Toolkit"); IupSetCallback(glink, "ACTION", (Icallback)link_action_cb); pbar1 = IupGLProgressBar(); IupSetAttribute(pbar1, "VALUE", "0.3"); IupSetAttribute(pbar1, "SHOWTEXT", "Yes"); //image_val = IupLoadImage("../test/slider_handler.png"); gval1 = IupGLVal(); IupSetAttribute(gval1, "VALUE", "0.3"); IupSetCallback(gval1, "VALUECHANGED_CB", val_action_cb); IupSetAttribute(gval1, "PROGRESSBAR", (char*)pbar1); IupSetAttribute(gval1, "NAME", "val1"); IupSetAttribute(gval1, "TIP", "Val Tip"); //IupSetAttributeHandle(gval1, "IMAGE", image_val); hbox = IupHbox(glabel, gsep1, gbutton1, gtoggle, glink, pbar1, gval1, NULL); IupSetAttribute(hbox, "ALIGNMENT", "ACENTER"); IupSetAttribute(hbox, "MARGIN", "5x5"); IupSetAttribute(hbox, "GAP", "5"); pbar2 = IupGLProgressBar(); IupSetAttribute(pbar2, "VALUE", "0.3"); IupSetAttribute(pbar2, "ORIENTATION", "VERTICAL"); gval2 = IupGLVal(); IupSetAttribute(gval2, "VALUE", "0.3"); IupSetAttribute(gval2, "ORIENTATION", "VERTICAL"); IupSetCallback(gval2, "VALUECHANGED_CB", val_action_cb); IupSetAttribute(gval2, "PROGRESSBAR", (char*)pbar2); IupSetAttribute(gval2, "NAME", "val2"); gsep2 = IupGLSeparator(); IupSetAttribute(gsep2, "ORIENTATION", "HORIZONTAL"); vbox = IupVbox(gbutton2, gsep2, IupRadio(IupSetAttributes(IupVbox(gtoggle1, gtoggle2, NULL), "MARGIN=0x0")), pbar2, gval2, NULL); IupSetAttribute(vbox, "ALIGNMENT", "ACENTER"); IupSetAttribute(vbox, "MARGIN", "5x5"); IupSetAttribute(vbox, "GAP", "5"); gtoggle5 = IupGLToggle("Toggle"); IupSetAttribute(gtoggle5, "PADDING", "5x5"); IupSetCallback(gtoggle5, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle5, "NAME", "toggle5"); IupSetAttribute(gtoggle5, "CHECKMARK", "Yes"); // IupSetAttribute(gtoggle5, "RIGHTBUTTON", "Yes"); gtoggle3 = IupGLToggle("Radio Toggle"); IupSetAttribute(gtoggle3, "PADDING", "5x5"); IupSetCallback(gtoggle3, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle3, "NAME", "toggle3"); IupSetAttribute(gtoggle3, "CHECKMARK", "Yes"); gtoggle4 = IupGLToggle("Radio Toggle"); IupSetAttribute(gtoggle4, "PADDING", "5x5"); IupSetAttributeHandle(gtoggle4, "IMAGE", load_image_Test()); IupSetCallback(gtoggle4, "ACTION", (Icallback)toggle_action_cb); IupSetAttribute(gtoggle4, "NAME", "toggle4"); IupSetAttribute(gtoggle4, "CHECKMARK", "Yes"); // IupSetAttribute(gtoggle4, "RIGHTBUTTON", "Yes"); vbox2 = IupVbox( IupRadio(IupSetAttributes(IupVbox(gtoggle3, gtoggle4, NULL), "MARGIN=0x0")), gtoggle5, NULL); gsbox = IupSetAttributes(IupGLScrollBox(vbox2), "RASTERSIZE=90x90"); gsbox = IupGLSizeBox(gsbox); gframe1 = IupSetAttributes(IupGLFrame(hbox), "TITLE=Frame1"); gframe2 = IupSetAttributes(IupGLFrame(vbox), "BACKCOLOR=\"250 250 160 128\", FRAMECOLOR=\"250 250 160\""); gframe3 = IupSetAttributes(IupGLFrame(gsbox), "TITLE=Frame3, TITLEBOX=Yes"); // IupSetAttributeHandle(gframe3, "TITLEBACKIMAGE", load_image_Tecgraf()); gexp1 = IupSetAttributes(IupGLExpander(gframe1), "TITLE=Expander"); gexp2 = IupSetAttributes(IupGLExpander(gframe2), "BARPOSITION=LEFT"); text = IupText(NULL); IupSetAttribute(text, "VALUE", "Text"); matrix = IupMatrix(NULL); IupSetAttribute(matrix, "NUMLIN", "3"); IupSetAttribute(matrix, "NUMCOL", "2"); IupSetAttribute(matrix, "NUMLIN_VISIBLE", "3"); IupSetAttribute(matrix, "NUMCOL_VISIBLE", "2"); IupSetAttribute(matrix, "0:0", "Inflation"); IupSetAttribute(matrix, "1:0", "Medicine"); IupSetAttribute(matrix, "2:0", "Food"); IupSetAttribute(matrix, "3:0", "Energy"); IupSetAttribute(matrix, "0:1", "January 2000"); IupSetAttribute(matrix, "0:2", "February 2000"); IupSetAttribute(matrix, "1:1", "5.6"); IupSetAttribute(matrix, "2:1", "2.2"); IupSetAttribute(matrix, "3:1", "4.1"); IupSetAttribute(matrix, "1:2", "10"); IupSetAttribute(matrix, "2:2", "1"); IupSetAttribute(matrix, "3:2", "0.5"); // IupSetAttribute(matrix, "EXPAND", "No"); IupSetAttribute(matrix, "SCROLLBAR", "No"); vbox3 = IupVbox( text, matrix, NULL); vbox3 = IupSetAttributes(IupGLFrame(vbox3), "TITLE=Frame4"); canvas = IupGLCanvasBox( IupSetAttributes(gexp1, "HORIZONTALALIGN=ACENTER, VERTICALALIGN=ATOP, MOVEABLE=Yes, MOVETOTOP=Yes"), IupSetAttributes(gexp2, "HORIZONTALALIGN=ALEFT, VERTICALALIGN=ACENTER"), IupSetAttributes(gframe3, "MOVEABLE=Yes, POSITION=\"550,200\", MOVETOTOP=Yes"), IupSetAttributes(vbox3, "MOVEABLE=Yes, POSITION=\"250,350\""), NULL); IupSetAttribute(canvas, "DEPTH_SIZE", "16"); image_open = IupImage(16, 16, img_open); image_close = IupImage(16, 16, img_close); image_high = IupImage(16, 16, img_close); IupSetAttribute(image_open, "0", "BGCOLOR"); IupSetAttribute(image_open, "1", "192 192 192"); IupSetAttribute(image_close, "0", "BGCOLOR"); IupSetAttribute(image_close, "1", "192 192 192"); IupSetAttribute(image_high, "1", "192 192 192"); // IupSetAttribute(gexp1, "BARSIZE", "50"); // IupSetAttributeHandle(gexp1, "IMAGE", image_close); // IupSetAttributeHandle(gexp1, "IMOPEN", image_open); // IupSetAttribute(gexp1, "IMAGE", "img1"); IupSetCallback(gexp1, "ACTION", (Icallback)expand_cb); IupSetAttribute(gexp1, "EXTRABUTTONS", "3"); IupSetCallback(gexp1, "EXTRABUTTON_CB", (Icallback)extrabutton_cb); IupSetAttributeHandle(gexp1, "IMAGEEXTRA1", image_close); IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS1", image_open); IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT1", image_high); IupSetAttributeHandle(gexp1, "IMAGEEXTRA2", image_close); IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS2", image_open); IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT2", image_high); IupSetAttributeHandle(gexp1, "IMAGEEXTRA3", image_close); IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS3", image_open); IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT3", image_high); //IupSetAttribute(gexp1, "REDRAWALL", "No"); IupSetCallback(canvas, "ACTION", action); IupSetCallback(canvas, "BUTTON_CB", (Icallback)button_cb); IupSetCallback(canvas, "MOTION_CB", (Icallback)motion_cb); IupSetAttribute(canvas, "BUFFER", "DOUBLE"); IupSetAttribute(canvas, "MARGIN", "10x10"); box = IupVbox(canvas, NULL); IupSetAttribute(box, "MARGIN", "25x25"); dlg = IupDialog(box); IupSetAttribute(dlg, "TITLE", "IupGLCanvas Test"); IupSetAttribute(dlg, "RASTERSIZE", "800x600"); IupMap(dlg); IupGLMakeCurrent(canvas); printf("Vendor: %s\n", glGetString(GL_VENDOR)); printf("Renderer: %s\n", glGetString(GL_RENDERER)); printf("Version: %s\n", glGetString(GL_VERSION)); IupShowXY(dlg, IUP_CENTER, IUP_CENTER); IupSetAttribute(dlg, "RASTERSIZE", NULL); }
void ButtonTest(void) { Ihandle *dlg, *button, *label, *image1, *image1i, *image1p, *image2, *image3, *box1, *box2; box1 = IupVbox(NULL); IupSetAttribute(box1, "MARGIN", "5x5"); IupSetAttribute(box1, "GAP", "5"); // IupSetAttribute(box1, "BGCOLOR", "75 150 170"); // IupSetAttribute(box1, "PADDING", "15x15"); button = IupButton(NULL, NULL); IupSetStrAttribute(button, "TITLE", "_@IUP_OK"); IupSetCallback(button, "ACTION", active_cb); IupAppend(box1, button); button = IupButton(NULL, NULL); if (IupGetInt(NULL, "UTF8MODE")) IupSetAttribute(button, "TITLE", "&Text && Test(çãõáóé)"); else IupSetAttribute(button, "TITLE", "&Text && Test(ηγυασι)"); IupSetAttribute(button, "TIP", "Button & Tip"); //IupSetAttribute(button, "PADDING", "15x15"); //IupSetAttribute(button, "BGCOLOR", "128 128 255"); // IupSetAttribute(button, "SIZE", "40"); // IupSetAttribute(button, "EXPAND", "Yes"); // IupSetAttribute(button, "FGCOLOR", "0 0 255"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ACENTER:ACENTER"); // IupSetAttribute(button, "ALIGNMENT", "ALEFT:ATOP"); IupSetAttribute(button, "NAME", "button1"); //IupSetAttribute(button, "CANFOCUS", "NO"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Text1\nSecond Line"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ACENTER:ACENTER"); IupSetAttribute(button, "FONT", "Helvetica, Underline 14"); IupSetAttribute(button, "FLAT", "YES"); IupSetAttribute(button, "NAME", "button2"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Text2\n<b>Second Line</b>"); IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ARIGHT:ABOTTOM"); IupSetAttribute(button, "MARKUP", "YES"); IupSetAttribute(button, "NAME", "button3"); IupSetAttribute(button, "CANFOCUS", "NO"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "RASTERSIZE", "30x30"); IupSetAttribute(button, "BGCOLOR", "255 128 92"); IupSetAttribute(button, "NAME", "color"); // IupSetAttribute(button, "EXPAND", "HORIZONTAL"); // IupSetAttribute(button, "FLAT", "Yes"); set_callbacks(button); IupAppend(box1, button); box2 = IupVbox(NULL); IupSetAttribute(box2, "MARGIN", "5x5"); IupSetAttribute(box2, "GAP", "5"); // IupSetAttribute(box2, "BGCOLOR", "75 150 170"); // IupSetAttribute(box2, "PADDING", "15x15"); 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"); image1i = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8_inactive); IupSetAttribute(image1i, "0", "BGCOLOR"); IupSetAttribute(image1i, "1", "255 0 0"); IupSetAttribute(image1i, "2", "0 255 0"); IupSetAttribute(image1i, "3", "0 0 255"); IupSetAttribute(image1i, "4", "255 255 255"); IupSetAttribute(image1i, "5", "0 0 0"); IupSetHandle("image1i", image1i); /* so it will be destroyed even when not used */ #if 0 image1p = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8_pressed); IupSetAttribute(image1p, "0", "BGCOLOR"); IupSetAttribute(image1p, "1", "255 0 0"); IupSetAttribute(image1p, "2", "0 255 0"); IupSetAttribute(image1p, "3", "0 0 255"); IupSetAttribute(image1p, "4", "255 255 255"); IupSetAttribute(image1p, "5", "0 0 0"); #endif image2 = IupImageRGB(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_24); image3 = IupImageRGBA(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_32); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Images"); IupSetAttributeHandle(button, "IMAGE", load_image_FileSave()); //IupSetAttribute(button, "IMAGE", "TECGRAF_BITMAP"); IupAppend(box2, button); button = IupButton(NULL, NULL); // IupSetAttribute(button, "ALIGNMENT", "ALEFT:ATOP"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "IMAGEPOSITION", "BOTTOM"); // IupSetAttribute(button, "PADDING", "5x5"); // IupSetAttribute(button, "TITLE", "Text1"); // IupSetAttribute(button, "FONT", "Helvetica, 14"); // IupSetAttribute(button, "IMAGE", "IUP_Tecgraf"); IupSetAttributeHandle(button, "IMAGE", image1); IupSetAttributeHandle(button, "IMINACTIVE", image1i); // IupSetAttributeHandle(button, "IMPRESS", image1p); IupSetAttribute(button, "TIP", "Image Label"); IupSetAttribute(button, "NAME", "button4"); IupSetAttribute(button, "PADDING", "5x5"); // IupSetAttribute(button, "FLAT", "Yes"); set_callbacks(button); IupAppend(box2, button); button = IupButton(NULL, NULL); IupSetAttributeHandle(button, "IMAGE", image2); // IupSetAttribute(button, "TITLE", "Text2"); // IupSetAttribute(button, "IMAGEPOSITION", "TOP"); // IupSetAttribute(button, "SPACING", "30"); // IupSetAttribute(button, "ALIGNMENT", "ALEFT"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "FLAT", "YES"); // IupSetAttributeHandle(button, "IMPRESS", image2); IupSetAttribute(button, "CANFOCUS", "NO"); IupSetAttribute(button, "PADDING", "10x10"); // IupSetAttribute(button, "RASTERSIZE", "15x15"); IupSetAttribute(button, "NAME", "button5"); set_callbacks(button); IupAppend(box2, button); button = IupButton(NULL, NULL); IupSetAttributeHandle(button, "IMAGE", image3); IupSetAttribute(button, "TITLE", "Text3"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "ALIGNMENT", "ARIGHT"); IupSetAttribute(button, "NAME", "button6"); set_callbacks(button); IupAppend(box2, button); label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "VERTICAL"); IupSetHandle("seplabel", label); dlg = IupDialog(IupHbox(box1, label, box2, NULL)); IupSetAttribute(dlg, "TITLE", "IupButton Test"); // IupSetAttribute(box1, "BGCOLOR", "128 0 0"); // IupSetAttribute(dlg, "BGCOLOR", "0 128 0"); // IupSetAttribute(dlg, "BACKGROUND", "255 128 128"); // IupSetAttributeHandle(dlg, "BACKGROUND", image2); // IupSetAttribute(dlg, "BGCOLOR", "173 177 194"); // Motif BGCOLOR for documentation // IupSetAttribute(dlg, "SAVEUNDER", "NO"); IupSetAttributeHandle(dlg, "STARTFOCUS", button); // IupSetGlobal("CLIENTAREAANIMATION", "No"); // IupSetGlobal("HOTTRACKING", "No"); IupShow(dlg); // IupSetAttribute(dlg, "PARENTDIALOG", "BIGTEST"); // IupShowXY(dlg, IUP_CENTERPARENT, IUP_CENTERPARENT); // IupShowXY(dlg,IUP_LEFT,IUP_TOP); // IupShowXY(dlg, IUP_RIGHT, IUP_BOTTOM); // IupShowXY(dlg, IUP_RIGHT, IUP_CENTER); // IupShowXY(dlg,0,0); }
void ButtonTest(void) { Ihandle *dlg, *button, *label, *image1, *image1i, *image1p, *image2, *image3, *box1, *box2; /* IupImageLibOpen(); */ box1 = IupVbox(NULL); IupSetAttribute(box1, "MARGIN", "5x5"); IupSetAttribute(box1, "GAP", "5"); // IupSetAttribute(box1, "BGCOLOR", "75 150 170"); // IupSetAttribute(box1, "PADDING", "15x15"); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Button Text"); IupSetCallback(button, "ACTION", active_cb); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "&Text (згн)"); IupSetAttribute(button, "TIP", "Button Tip"); //IupSetAttribute(button, "PADDING", "15x15"); //IupSetAttribute(button, "BGCOLOR", "128 128 255"); IupSetAttribute(button, "SIZE", "40"); // IupSetAttribute(button, "FGCOLOR", "0 0 255"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ACENTER:ACENTER"); // IupSetAttribute(button, "ALIGNMENT", "ALEFT:ATOP"); IupSetAttribute(button, "NAME", "button1"); IupSetAttribute(button, "CANFOCUS", "NO"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Text Button\nSecond Line"); IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ACENTER:ACENTER"); IupSetAttribute(button, "FONT", "Helvetica, 14"); IupSetAttribute(button, "FLAT", "YES"); IupSetAttribute(button, "NAME", "button2"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Text Button\n<b>Second Line</b>"); IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "ALIGNMENT", "ARIGHT:ABOTTOM"); IupSetAttribute(button, "MARKUP", "YES"); IupSetAttribute(button, "NAME", "button3"); IupSetAttribute(button, "CANFOCUS", "NO"); set_callbacks(button); IupAppend(box1, button); button = IupButton(NULL, NULL); IupSetAttribute(button, "RASTERSIZE", "30x30"); IupSetAttribute(button, "BGCOLOR", "255 128 92"); IupSetAttribute(button, "NAME", "color"); set_callbacks(button); IupAppend(box1, button); box2 = IupVbox(NULL); IupSetAttribute(box2, "MARGIN", "5x5"); IupSetAttribute(box2, "GAP", "5"); // IupSetAttribute(box2, "BGCOLOR", "75 150 170"); // IupSetAttribute(box2, "PADDING", "15x15"); 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"); image1i = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8_inactive); IupSetAttribute(image1i, "0", "BGCOLOR"); IupSetAttribute(image1i, "1", "255 0 0"); IupSetAttribute(image1i, "2", "0 255 0"); IupSetAttribute(image1i, "3", "0 0 255"); IupSetAttribute(image1i, "4", "255 255 255"); IupSetAttribute(image1i, "5", "0 0 0"); IupSetHandle("image1i", image1i); /* so it will be destroyed even when not used */ image1p = IupImage(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_8_pressed); IupSetAttribute(image1p, "0", "BGCOLOR"); IupSetAttribute(image1p, "1", "255 0 0"); IupSetAttribute(image1p, "2", "0 255 0"); IupSetAttribute(image1p, "3", "0 0 255"); IupSetAttribute(image1p, "4", "255 255 255"); IupSetAttribute(image1p, "5", "0 0 0"); image2 = IupImageRGB(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_24); image3 = IupImageRGBA(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_32); button = IupButton(NULL, NULL); IupSetAttribute(button, "TITLE", "Images"); IupSetAttributeHandle(button, "IMAGE", load_image_FileSave()); IupAppend(box2, button); button = IupButton(NULL, NULL); // IupSetAttribute(button, "ALIGNMENT", "ALEFT:ATOP"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "IMAGEPOSITION", "BOTTOM"); // IupSetAttribute(button, "PADDING", "5x5"); // IupSetAttribute(button, "TITLE", "Text1"); // IupSetAttribute(button, "FONT", "Helvetica, 14"); // IupSetAttribute(button, "IMAGE", "IUP_Tecgraf"); IupSetAttributeHandle(button, "IMAGE", image1); // IupSetAttributeHandle(button, "IMINACTIVE", image1i); IupSetAttributeHandle(button, "IMPRESS", image1p); IupSetAttribute(button, "TIP", "Image Label"); IupSetAttribute(button, "NAME", "button4"); set_callbacks(button); IupAppend(box2, button); button = IupButton(NULL, NULL); IupSetAttributeHandle(button, "IMAGE", image2); // IupSetAttribute(button, "TITLE", "Text2"); // IupSetAttribute(button, "IMAGEPOSITION", "TOP"); // IupSetAttribute(button, "SPACING", "30"); // IupSetAttribute(button, "ALIGNMENT", "ALEFT"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "FLAT", "YES"); // IupSetAttributeHandle(button, "IMPRESS", image2); IupSetAttribute(button, "CANFOCUS", "NO"); // IupSetAttribute(button, "RASTERSIZE", "15x15"); IupSetAttribute(button, "NAME", "button5"); set_callbacks(button); IupAppend(box2, button); button = IupButton(NULL, NULL); IupSetAttributeHandle(button, "IMAGE", image3); IupSetAttribute(button, "TITLE", "Text3"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "ALIGNMENT", "ARIGHT"); IupSetAttribute(button, "NAME", "button6"); set_callbacks(button); IupAppend(box2, button); label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "VERTICAL"); IupSetHandle("seplabel", label); dlg = IupDialog(IupHbox(box1, label, box2, NULL)); IupSetAttribute(dlg, "TITLE", "IupButton Test"); // IupSetAttribute(box1, "BGCOLOR", "128 0 0"); // IupSetAttribute(dlg, "BGCOLOR", "0 128 0"); // IupSetAttribute(dlg, "BACKGROUND", "255 128 128"); // IupSetAttributeHandle(dlg, "BACKGROUND", image2); // IupSetAttribute(dlg, "BGCOLOR", "173 177 194"); // Motif BGCOLOR for documentation IupSetAttributeHandle(dlg, "STARTFOCUS", button); IupShow(dlg); }