本文整理汇总了C++中IupVbox函数的典型用法代码示例。如果您正苦于以下问题:C++ IupVbox函数的具体用法?C++ IupVbox怎么用?C++ IupVbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IupVbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClassInfo
void ClassInfo(void)
{
Ihandle *dialog, *box, *lists, *listClasses, *listAttributes, *listCallbacks, *labelInfo;
listClasses = IupList(NULL); /* list of registered classes */
listAttributes = IupList(NULL); /* list of attributes of the selected class */
listCallbacks = IupList(NULL); /* list of callbacks of the selected class */
IupSetAttributes(listClasses, "NAME=listClasses, SIZE= 70x85, EXPAND=VERTICAL");
IupSetAttributes(listAttributes, "NAME=listAttributes, SIZE=120x85, EXPAND=VERTICAL");
IupSetAttributes(listCallbacks, "NAME=listCallbacks, SIZE=120x85, EXPAND=VERTICAL");
IupSetCallback(listClasses, "ACTION", (Icallback) classesList_ActionCB);
IupSetCallback(listAttributes, "ACTION", (Icallback) attributesList_ActionCB);
IupSetCallback(listCallbacks, "ACTION", (Icallback) callbacksList_ActionCB);
labelInfo = IupLabel(NULL);
IupSetAttribute(labelInfo, "SIZE", "x50");
IupSetAttribute(labelInfo, "EXPAND", "HORIZONTAL");
IupSetAttribute(labelInfo, "NAME", "labelInfo");
lists = IupVbox(
IupHbox(
IupSetAttributes(IupFrame(IupVbox(listClasses, NULL)), "TITLE=Classes"),
IupSetAttributes(IupFrame(IupVbox(listAttributes, NULL)), "TITLE=Attributes"),
IupSetAttributes(IupFrame(IupVbox(listCallbacks, NULL)), "TITLE=Callbacks"),
NULL),
IupHbox(
IupSetAttributes(IupFrame(IupHbox(labelInfo, NULL)), "TITLE=Info, MARGIN=3x3"),
NULL),
NULL);
box = IupHbox(lists, NULL);
IupSetAttributes(lists,"MARGIN=10x10, GAP=10");
dialog = IupDialog(box);
IupSetAttribute(dialog, "TITLE", "Iup Classes Information");
IupShowXY(dialog, IUP_CENTER, IUP_CENTER);
PopulateListOfClasses(dialog);
}
示例2: main
/* Main program */
int main(int argc, char **argv)
{
Ihandle *dlg;
IupOpen(&argc, &argv);
IupControlsOpen();
IupSetFunction("removeline", (Icallback)removeline);
IupSetFunction("addline", (Icallback)addline);
IupSetFunction("removecol", (Icallback)removecol);
IupSetFunction("addcol", (Icallback)addcol);
IupSetFunction("redraw", (Icallback)redraw);
createmenu();
dlg = IupDialog(
IupTabs(
IupSetAttributes(
IupVbox((create_mat()), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"),
NULL), "MARGIN=10x10, GAP=10, TABTITLE=Test1"),
IupSetAttributes(
IupVbox(IupFrame(create_mat()), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"),
// NULL), "BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2,FONT=HELVETICA_ITALIC_14"),
NULL), "FONT=HELVETICA_NORMAL_12, BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2"),
NULL));
IupSetAttribute(dlg,IUP_TITLE, "IupMatrix");
IupSetAttribute(dlg,IUP_MENU, "mymenu");
// IupSetAttribute(dlg,"BGCOLOR", "255 0 255");
//IupSetAttribute(dlg,"COMPOSITED", "YES");
//IupSetAttribute(dlg,"LAYERED", "YES");
//IupSetAttribute(dlg,"LAYERALPHA", "192");
IupShowXY(dlg,IUP_CENTER,IUP_CENTER) ;
IupMainLoop();
iupmaskMatRemove(IupGetHandle("mat1"), 2, 1) ;
iupmaskMatRemove(IupGetHandle("mat2"), 2, 1) ;
IupDestroy(dlg);
IupControlsClose();
IupClose();
return 0;
}
示例3: init_dlg
/* Initializes the dialog */
void init_dlg(void)
{
Ihandle* tree1 = IupGetHandle("tree1");
Ihandle* tree2 = IupGetHandle("tree2");
Ihandle* box = IupVbox(IupHbox(tree1, tree2, NULL), NULL);
Ihandle* dlg = IupDialog(box);
IupSetAttribute(dlg, "TITLE", "IupTree Example");
IupSetAttribute(box, "MARGIN", "20x20");
IupSetHandle("dlg", dlg);
}
示例4: item_goto_action_cb
int item_goto_action_cb(Ihandle* item_goto)
{
Ihandle* multitext = IupGetDialogChild(item_goto, "MULTITEXT");
Ihandle *dlg, *box, *bt_ok, *bt_cancel, *txt, *lbl;
int line_count = IupGetInt(multitext, "LINECOUNT");
lbl = IupLabel(NULL);
IupSetfAttribute(lbl, "TITLE", "Line Number [1-%d]:", line_count);
txt = IupText(NULL);
IupSetAttribute(txt, "MASK", IUP_MASK_UINT); /* unsigned integer numbers only */
IupSetAttribute(txt, "NAME", "LINE_TEXT");
IupSetAttribute(txt, "VISIBLECOLUMNS", "20");
bt_ok = IupButton("OK", NULL);
IupSetInt(bt_ok, "TEXT_LINECOUNT", line_count);
IupSetAttribute(bt_ok, "PADDING", "10x2");
IupSetCallback(bt_ok, "ACTION", (Icallback)goto_ok_action_cb);
bt_cancel = IupButton("Cancel", NULL);
IupSetCallback(bt_cancel, "ACTION", (Icallback)goto_cancel_action_cb);
IupSetAttribute(bt_cancel, "PADDING", "10x2");
box = IupVbox(
lbl,
txt,
IupSetAttributes(IupHbox(
IupFill(),
bt_ok,
bt_cancel,
NULL), "NORMALIZESIZE=HORIZONTAL"),
NULL);
IupSetAttribute(box, "MARGIN", "10x10");
IupSetAttribute(box, "GAP", "5");
dlg = IupDialog(box);
IupSetAttribute(dlg, "TITLE", "Go To Line");
IupSetAttribute(dlg, "DIALOGFRAME", "Yes");
IupSetAttributeHandle(dlg, "DEFAULTENTER", bt_ok);
IupSetAttributeHandle(dlg, "DEFAULTESC", bt_cancel);
IupSetAttributeHandle(dlg, "PARENTDIALOG", IupGetDialog(item_goto));
IupPopup(dlg, IUP_CENTERPARENT, IUP_CENTERPARENT);
if (IupGetInt(dlg, "STATUS") == 1)
{
int line = IupGetInt(txt, "VALUE");
int pos;
IupTextConvertLinColToPos(multitext, line, 0, &pos);
IupSetInt(multitext, "CARETPOS", pos);
IupSetInt(multitext, "SCROLLTOPOS", pos);
}
IupDestroy(dlg);
return IUP_DEFAULT;
}
示例5: MatrixCbModeTest
void MatrixCbModeTest(void)
{
Ihandle* dlg, *box;
box = IupVbox(create_matrix(), NULL);
IupSetAttribute(box, "MARGIN", "10x10");
dlg = IupDialog(box);
IupSetAttribute(dlg, "TITLE", "IupMatrix Simple Test");
IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
}
示例6: iupVersionDlg
void iupVersionDlg(void)
{
Ihandle* dlg;
dlg = IupDialog(IupVbox(IupFrame(IupVbox(
IupLabel(IupVersion()),
IupLabel(IUP_VERSION_DATE),
IupLabel(IUP_COPYRIGHT),
NULL)),
IupButton("OK", NULL),
NULL));
IupSetAttribute(dlg,"TITLE","IUP Version");
IupSetAttribute(dlg,"DIALOGFRAME","YES");
IupSetAttribute(dlg,"DIALOGHINT","YES");
IupSetAttribute(dlg,"GAP","10");
IupSetAttribute(dlg,"MARGIN","10x10");
IupPopup(dlg, IUP_CENTER, IUP_CENTER);
IupDestroy(dlg);
}
示例7: item_find_action_cb
int item_find_action_cb(Ihandle* item_find)
{
Ihandle* dlg = (Ihandle*)IupGetAttribute(item_find, "FIND_DIALOG");
if (!dlg)
{
Ihandle* multitext = IupGetDialogChild(item_find, "MULTITEXT");
Ihandle *box, *bt_next, *bt_close, *txt, *find_case;
txt = IupText(NULL);
IupSetAttribute(txt, "NAME", "FIND_TEXT");
IupSetAttribute(txt, "VISIBLECOLUMNS", "20");
find_case = IupToggle("Case Sensitive", NULL);
IupSetAttribute(find_case, "NAME", "FIND_CASE");
bt_next = IupButton("Find Next", NULL);
IupSetAttribute(bt_next, "PADDING", "10x2");
IupSetCallback(bt_next, "ACTION", (Icallback)find_next_action_cb);
bt_close = IupButton("Close", NULL);
IupSetCallback(bt_close, "ACTION", (Icallback)find_close_action_cb);
IupSetAttribute(bt_close, "PADDING", "10x2");
box = IupVbox(
IupLabel("Find What:"),
txt,
find_case,
IupSetAttributes(IupHbox(
IupFill(),
bt_next,
bt_close,
NULL), "NORMALIZESIZE=HORIZONTAL"),
NULL);
IupSetAttribute(box, "MARGIN", "10x10");
IupSetAttribute(box, "GAP", "5");
dlg = IupDialog(box);
IupSetAttribute(dlg, "TITLE", "Find");
IupSetAttribute(dlg, "DIALOGFRAME", "Yes");
IupSetAttributeHandle(dlg, "DEFAULTENTER", bt_next);
IupSetAttributeHandle(dlg, "DEFAULTESC", bt_close);
IupSetAttributeHandle(dlg, "PARENTDIALOG", IupGetDialog(item_find));
/* Save the multiline to acess it from the callbacks */
IupSetAttribute(dlg, "MULTITEXT", (char*)multitext);
/* Save the dialog to reuse it */
IupSetAttribute(item_find, "FIND_DIALOG", (char*)dlg);
}
/* centerparent first time, next time reuse the last position */
IupShowXY(dlg, IUP_CURRENT, IUP_CURRENT);
return IUP_DEFAULT;
}
示例8: MatrixCbsTest
void MatrixCbsTest(void)
{
Ihandle *dlg, *bt;
IupMatrixExOpen();
IupSetFunction("removeline", (Icallback)removeline);
IupSetFunction("addline", (Icallback)addline);
IupSetFunction("removecol", (Icallback)removecol);
IupSetFunction("addcol", (Icallback)addcol);
IupSetFunction("redraw", (Icallback)redraw);
createmenu();
bt = IupButton("Button", NULL);
IupSetCallback(bt, "ACTION", bt_cb);
IupSetAttribute(bt, "CANFOCUS", "NO");
dlg = IupDialog(
// IupZbox(
IupTabs(
IupSetAttributes(
IupVbox((create_mat(1)), bt, IupText(""), IupLabel("Label Text"), IupFrame(IupVal("HORIZONTAL")),
NULL), "MARGIN=10x10, GAP=10, TABTITLE=Test1"),
IupSetAttributes(
IupVbox(IupFrame(create_mat(2)), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"),
// NULL), "BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2,FONT=HELVETICA_ITALIC_14"),
// NULL), "FONT=HELVETICA_NORMAL_12, BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2"),
NULL), "BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2"),
NULL));
IupSetAttribute(dlg,"TITLE", "IupMatrix");
IupSetAttribute(dlg,"MENU", "mymenu");
IupSetAttributeHandle(dlg,"DEFAULTENTER", bt);
// IupSetAttribute(dlg,"BGCOLOR", "255 0 255");
//IupSetAttribute(dlg,"COMPOSITED", "YES");
//IupSetAttribute(dlg,"OPACITY", "192");
IupShowXY(dlg,IUP_CENTER,IUP_CENTER);
}
示例9: createMainWindow
Ihandle * createMainWindow(void) {
Ihandle *bottomHbox, *mainVbox;
Ihandle *lblTitle, *glCanvas;
Ihandle *btnRandomLine, *btnClearLines, *btnClose;
Ihandle *dialog;
lblTitle = IupLabel(labTitle);
IupSetAttribute(lblTitle, "EXPAND", "HORIZONTAL");
IupSetAttribute(lblTitle, "ALIGNMENT", "ALEFT:ACENTER");
IupSetAttribute(lblTitle, "FONTSIZE", "10");
glCanvas = IupGLCanvas(0);
IupSetAttribute(glCanvas, "EXPAND", "YES");
IupSetAttribute(glCanvas, "BORDER", "NO");
IupSetAttribute(glCanvas, "CANFOCUS", "NO");
IupSetCallback(glCanvas, "ACTION", (Icallback) repaint_cb);
btnRandomLine = IupButton("Generate Random Lines", 0);
IupSetAttribute(btnRandomLine, "RASTERSIZE", "150x33");
IupSetCallback(btnRandomLine, "ACTION", (Icallback) btnRandLine_cb);
btnClearLines = IupButton("Clear All Lines", 0);
IupSetAttribute(btnClearLines, "RASTERSIZE", "100x33");
IupSetCallback(btnClearLines, "ACTION", (Icallback) btnClearLines_cb);
btnClose = IupButton("Close", 0);
IupSetAttribute(btnClose, "RASTERSIZE", "80x33");
IupSetCallback(btnClose, "ACTION", (Icallback) exit_cb);
bottomHbox = IupHbox(btnRandomLine, btnClearLines, IupFill(), btnClose, 0);
IupSetAttribute(bottomHbox, "EXPAND", "HORIZONTAL");
IupSetAttribute(bottomHbox, "NGAP", "5");
IupSetAttribute(bottomHbox, "NMARGIN", "0x5");
mainVbox = IupVbox(lblTitle, glCanvas, bottomHbox, 0);
IupSetAttribute(mainVbox, "NMARGIN", "10x10");
IupSetAttribute(mainVbox, "NGAP", "10");
IupSetHandle(BTN_CLOSE, btnClose);
IupSetHandle(GL_CANVAS, glCanvas);
dialog = IupDialog(mainVbox);
IupSetAttribute(dialog, "TITLE", "GL Labwork");
IupSetAttribute(dialog, "RASTERSIZE", "425x550");
IupSetAttribute(dialog, "SHRINK", "YES");
IupSetAttribute(dialog, "DEFAULTESC", BTN_CLOSE);
IupSetHandle(MAIN_WINDOW, dialog);
return dialog;
}
开发者ID:AKD92,项目名称:OpenGL-Graphics-Programmatic-LineClip-Analyzer,代码行数:52,代码来源:driver_lineclip_analyzer.c
示例10: main
int main(int argc, char **argv)
{
Ihandle *dlg;
Ihandle *text;
Ihandle *menu, *menu_file;
Ihandle *submenu_file;
Ihandle *item_save, *item_autosave, *item_exit;
IupOpen(&argc, &argv);
text = IupText(NULL);
IupSetAttribute(text, "VALUE", "This is an empty text");
item_save = IupItem("Save\tCtrl+S", NULL); /* this is NOT related with the Ctrl+S key callback, it will just align the text at right */
item_autosave = IupItem("&Auto Save", NULL);
item_exit = IupItem("Exit", "item_exit_act");
IupSetAttribute(item_exit, "KEY", "x"); /* this is NOT related with the K_X key callback, it will just underline the letter */
IupSetCallback(item_exit, "ACTION", (Icallback) item_exit_cb);
IupSetCallback(item_autosave, "ACTION", (Icallback) item_autosave_cb);
IupSetAttribute(item_autosave, "VALUE", "ON");
IupSetHandle("item_autosave", item_autosave); /* giving a name to a iup handle */
menu_file = IupMenu(item_save, item_autosave, item_exit, NULL);
submenu_file = IupSubmenu("File", menu_file);
menu = IupMenu(submenu_file, NULL);
IupSetHandle("menu", menu);
dlg = IupDialog(IupVbox(text, IupButton("Test", NULL), NULL));
IupSetAttribute(dlg, "MARGIN", "10x10");
IupSetAttribute(dlg, "GAP", "10");
IupSetAttribute(dlg, "TITLE", "IupItem");
IupSetAttribute(dlg, "MENU", "menu");
IupSetCallback(dlg, "K_cX", (Icallback) item_exit_cb); /* this will also affect the IupText if at focus, since it is used for clipboard cut */
IupSetCallback(dlg, "K_cA", (Icallback) item_autosave_cb); /* this will also affect the IupText if at focus, since it is used for select all */
IupSetCallback(dlg, "K_cS", (Icallback) item_save_cb);
IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
IupMainLoop();
IupClose();
return EXIT_SUCCESS;
}
示例11: button_cb
int button_cb()
{
Ihandle *dlg, *cv = IupCanvas("");
IupSetAttribute(cv, IUP_SIZE, "100x100");
IupSetAttribute(cv, IUP_MOTION_CB, "mm");
IupSetAttribute(cv, IUP_TIP, "SEGUNDO ELEMENT");
dlg = IupDialog(IupVbox(IupText(""), cv, NULL));
IupSetAttribute(dlg, IUP_SHOW_CB, "showcb");
IupSetAttribute(dlg, IUP_GETFOCUS_CB, "getfocus_cb");
IupPopup(dlg, IUP_CENTER, IUP_CENTER);
IupSetAttribute(dlg, IUP_SHOW_CB, NULL);
printf("saiu do popup\n");
return IUP_DEFAULT;
}
示例12: SpinTest
void SpinTest(void)
{
Ihandle *dlg, *spinbox, *text;
spinbox = IupSpinbox(IupSetAttributes(text = IupText(NULL), "SIZE=50x, EXPAND=HORIZONTAL, FONT=\"Times, 24\""));
// IupSetAttribute(text, "MASK", "/d+|AUTO");
IupSetCallback(spinbox, "SPIN_CB", (Icallback)spin_cb);
dlg = IupDialog(IupVbox(spinbox, NULL));
IupSetAttribute(dlg, "MARGIN", "10x10");
IupSetAttribute(dlg, "TITLE", "IupSpin Test");
IupShow(dlg);
}
示例13: main
int main(int argc, char **argv)
{
Ihandle *dlg, *bt, *dbox, *lbl, *ml, *hbox, *bt2, *txt;
IupOpen(&argc, &argv);
bt = IupButton("Detache Me!", NULL);
IupSetCallback(bt, "ACTION", (Icallback)btn_detach_cb);
IupSetHandle("detach", bt);
ml = IupMultiLine(NULL);
IupSetAttribute(ml, "EXPAND", "YES");
IupSetAttribute(ml, "VISIBLELINES", "5");
hbox = IupHbox(bt, ml, NULL);
IupSetAttribute(hbox, "MARGIN", "10x0");
dbox = IupDetachBox(hbox);
IupSetAttribute(dbox, "ORIENTATION", "VERTICAL");
//IupSetAttribute(dbox, "SHOWGRIP", "NO");
//IupSetAttribute(dbox, "BARSIZE", "0");
//IupSetAttribute(dbox, "COLOR", "255 0 0");
IupSetCallback(dbox, "DETACHED_CB", (Icallback)detached_cb);
IupSetHandle("dbox", dbox);
lbl = IupLabel("Label");
IupSetAttribute(lbl, "EXPAND", "VERTICAL");
bt2 = IupButton("Restore me!", NULL);
IupSetAttribute(bt2, "EXPAND", "YES");
IupSetAttribute(bt2, "ACTIVE", "NO");
IupSetCallback(bt2, "ACTION", (Icallback)btn_restore_cb);
IupSetHandle("restore", bt2);
txt = IupText(NULL);
IupSetAttribute(txt, "EXPAND", "HORIZONTAL");
dlg = IupDialog(IupVbox(dbox, lbl, bt2, txt, NULL));
IupSetAttribute(dlg, "TITLE", "IupDetachBox Example");
IupSetAttribute(dlg, "MARGIN", "10x10");
IupSetAttribute(dlg, "GAP", "10");
IupSetAttribute(dlg, "RASTERSIZE", "300x300");
IupShow(dlg);
IupMainLoop();
IupClose();
return EXIT_SUCCESS;
}
示例14: InitDialog
Ihandle* InitDialog(void)
{
Ihandle* dialog; /* dialog containing the canvas */
Ihandle* content; /* dialog content */
Ihandle* toolbar=InitToolbar(); /* buttons tool bar */
gc.canvas = IupSGLCanvas(640,480,(Icallback) repaint_cb, (Icallback) resize_cb); /* canvas to paint with OpenGL */
gc.msgbar = IupSMessageBar("Message...",20); /* a msg bar */
content = IupVbox(toolbar,gc.canvas,gc.msgbar,NULL);
/* create the dialog and set its attributes */
dialog = IupSDialog("Trabalho 1 - Nino",content, (Icallback) exit_cb, "NO");
return dialog;
}
示例15: MatrixTest
void MatrixTest(void)
{
Ihandle* dlg, *box, *mat;
box = IupVbox(mat = create_matrix(), NULL);
IupSetAttribute(box, "MARGIN", "10x10");
// IupSetAttribute(box, "FONT", "Arial, 7");
dlg = IupDialog(box);
IupSetAttribute(dlg, "TITLE", "IupMatrix Simple Test");
IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
// IupSetAttribute(mat, "ADDLIN", "1");
// IupSetAttribute(mat,"4:0","Teste");
// IupSetAttribute(mat, "REDRAW", "ALL");
}