• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IupHbox函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IupHbox函数的典型用法代码示例。如果您正苦于以下问题:C++ IupHbox函数的具体用法?C++ IupHbox怎么用?C++ IupHbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IupHbox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: capSetupUI

static Ihandle* capSetupUI() {
    Ihandle *capControlsBox = IupHbox(
        inboundCheckbox = IupToggle("Inbound", NULL),
        outboundCheckbox = IupToggle("Outbound", NULL),
        IupLabel("Bandwidth Cap(kb/s):"),
        kpsInput = IupText(NULL),
        NULL
        );

    IupSetCallback(inboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(inboundCheckbox, SYNCED_VALUE, (char*)&capInbound);
    IupSetCallback(outboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(outboundCheckbox, SYNCED_VALUE, (char*)&capOutbound);

    IupSetAttribute(kpsInput, "VISIBLECOLUMNS", "4");
    IupSetAttribute(kpsInput, "VALUE", "32.0");
    IupSetCallback(kpsInput, "VALUECHANGED_CB", (Icallback)uiSyncFixed);
    IupSetAttribute(kpsInput, SYNCED_VALUE, (char*)&kps);
    IupSetAttribute(kpsInput, FIXED_MAX, CAP_MAX);
    IupSetAttribute(kpsInput, FIXED_MIN, CAP_MIN);

    // enable by default to avoid confusing
    IupSetAttribute(inboundCheckbox, "VALUE", "ON");
    IupSetAttribute(outboundCheckbox, "VALUE", "ON");

    if (parameterized) {
        setFromParameter(inboundCheckbox, "VALUE", NAME"-inbound");
        setFromParameter(outboundCheckbox, "VALUE", NAME"-outbound");
        setFromParameter(kpsInput, "VALUE", NAME"-kps");
    }

    return capControlsBox;
}
开发者ID:286897655,项目名称:clumsy,代码行数:33,代码来源:cap.c


示例2: main

int main(int argc, char **argv)
{
  Ihandle *canvas, *finale, *dg;

  IupOpen(&argc, &argv);
  IupGLCanvasOpen();

  canvas = IupGLCanvas(NULL);
  IupSetCallback(canvas, "ACTION", (Icallback) redraw);
  IupSetAttribute(canvas, IUP_BUFFER, IUP_DOUBLE);
  IupSetAttribute(canvas, "RASTERSIZE", "123x200");

  finale = IupHbox(IupFill(), 
                   canvas, 
                   IupFill(), 
                   NULL);

  dg = IupDialog(finale);
  IupSetAttribute(dg, "TITLE", "IupGLCanvas");

  IupShow(dg);
  IupMainLoop();
  IupClose();

  return EXIT_SUCCESS;
}
开发者ID:EduardoPataki,项目名称:iup-examples,代码行数:26,代码来源:glcanvas.c


示例3: main

int main(int argc, char **argv)
{
  Ihandle *dg, *tree, *sbox, *ml, *cv, *sbox2, *vbox, *lb, *sbox3;

  IupOpen(&argc, &argv);
  IupControlsOpen();

  tree = createtree();
  IupSetAttribute(tree, "EXPAND", "YES");

  sbox = IupSbox(tree);
  IupSetAttribute(sbox, "DIRECTION", "EAST");

  cv = IupCanvas(NULL);
  IupSetAttribute(cv, "EXPAND", "YES");

  ml = IupMultiLine("");
  IupSetAttribute(ml, "EXPAND", "YES");
  sbox2 = IupSbox(ml);
  IupSetAttribute(sbox2, "DIRECTION", "WEST");

  vbox = IupHbox(sbox, cv, sbox2, NULL);

  lb = IupLabel("This is a label");
  IupSetAttribute(lb, "EXPAND", "NO");
  sbox3 = IupSbox(lb);
  IupSetAttribute(sbox3, "DIRECTION", "NORTH");
  dg = IupDialog(IupVbox(vbox, sbox3, NULL));
  IupSetAttribute(dg, "TITLE", "IupSbox Example");

  IupShow(dg);
  IupMainLoop();
  IupClose();
  return EXIT_SUCCESS;
}
开发者ID:svn2github,项目名称:iup-github,代码行数:35,代码来源:sbox2.c


示例4: tamperSetupUI

static Ihandle* tamperSetupUI() {
    Ihandle *dupControlsBox = IupHbox(
        checksumCheckbox = IupToggle("Redo Checksum", NULL),
        inboundCheckbox = IupToggle("Inbound", NULL),
        outboundCheckbox = IupToggle("Outbound", NULL),
        IupLabel("Chance(%):"),
        chanceInput = IupText(NULL),
        NULL
        );

    IupSetAttribute(chanceInput, "VISIBLECOLUMNS", "4");
    IupSetAttribute(chanceInput, "VALUE", "10.0");
    IupSetCallback(chanceInput, "VALUECHANGED_CB", uiSyncChance);
    IupSetAttribute(chanceInput, SYNCED_VALUE, (char*)&chance);
    IupSetCallback(inboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(inboundCheckbox, SYNCED_VALUE, (char*)&tamperInbound);
    IupSetCallback(outboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(outboundCheckbox, SYNCED_VALUE, (char*)&tamperOutbound);
    // sync doChecksum
    IupSetCallback(checksumCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(checksumCheckbox, SYNCED_VALUE, (char*)&doChecksum);

    // enable by default to avoid confusing
    IupSetAttribute(inboundCheckbox, "VALUE", "ON");
    IupSetAttribute(outboundCheckbox, "VALUE", "ON");
    IupSetAttribute(checksumCheckbox, "VALUE", "ON");

    return dupControlsBox;
}
开发者ID:AndrewKL,项目名称:clumsy,代码行数:29,代码来源:tamper.c


示例5: uiSetupModule

static void uiSetupModule(Module *module, Ihandle *parent) {
    Ihandle *groupBox, *toggle, *controls, *icon;
    groupBox = IupHbox(
        icon = IupLabel(NULL),
        toggle = IupToggle(module->displayName, NULL),
        IupFill(),
        controls = module->setupUIFunc(),
        NULL
    );
    IupSetAttribute(groupBox, "EXPAND", "HORIZONTAL");
    IupSetAttribute(groupBox, "ALIGNMENT", "ACENTER");
    IupSetAttribute(controls, "ALIGNMENT", "ACENTER");
    IupAppend(parent, groupBox);

    // set controls as attribute to toggle and enable toggle callback
    IupSetCallback(toggle, "ACTION", (Icallback)uiToggleControls);
    IupSetAttribute(toggle, CONTROLS_HANDLE, (char*)controls);
    IupSetAttribute(toggle, SYNCED_VALUE, (char*)module->enabledFlag);
    IupSetAttribute(controls, "ACTIVE", "NO"); // startup as inactive
    IupSetAttribute(controls, "NCGAP", "4"); // startup as inactive

    // set default icon
    IupSetAttribute(icon, "IMAGE", "none_icon");
    IupSetAttribute(icon, "PADDING", "4x");
    module->iconHandle = icon;

    // parameterize toggle
    if (parameterized) {
        setFromParameter(toggle, "VALUE", module->shortName);
    }
}
开发者ID:pkarneliuk,项目名称:clumsy,代码行数:31,代码来源:main.c


示例6: Hbox

static int Hbox(lua_State *L)
{
  Ihandle *ih = IupHbox(NULL);
  iuplua_plugstate(L, ih);
  iuplua_pushihandle_raw(L, ih);
  return 1;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:7,代码来源:il_hbox.c


示例7: dropSetupUI

static Ihandle* dropSetupUI() {
    Ihandle *dropControlsBox = IupHbox(
        inboundCheckbox = IupToggle("Inbound", NULL),
        outboundCheckbox = IupToggle("Outbound", NULL),
        IupLabel("Chance(%):"),
        chanceInput = IupText(NULL),
        NULL
    );

    IupSetAttribute(chanceInput, "VISIBLECOLUMNS", "4");
    IupSetAttribute(chanceInput, "VALUE", "10.0");
    IupSetCallback(chanceInput, "VALUECHANGED_CB", uiSyncChance);
    IupSetAttribute(chanceInput, SYNCED_VALUE, (char*)&chance);
    IupSetCallback(inboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(inboundCheckbox, SYNCED_VALUE, (char*)&dropInbound);
    IupSetCallback(outboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(outboundCheckbox, SYNCED_VALUE, (char*)&dropOutbound);

    // enable by default to avoid confusing
    IupSetAttribute(inboundCheckbox, "VALUE", "ON");
    IupSetAttribute(outboundCheckbox, "VALUE", "ON");

    if (parameterized) {
        setFromParameter(inboundCheckbox, "VALUE", NAME"-inbound");
        setFromParameter(outboundCheckbox, "VALUE", NAME"-outbound");
        setFromParameter(chanceInput, "VALUE", NAME"-chance");
    }

    return dropControlsBox;
}
开发者ID:AbooJan,项目名称:clumsy,代码行数:30,代码来源:drop.c


示例8: IupVal

Ihandle *IupQuakeScale(char *title, float min, float max, float step, char *key, float def)
{
    Ihandle *scale,*label_value,*label_min,*label_max;

    char buf[128];

    scale = IupVal("HORIZONTAL");
    snprintf(buf, 128, "EXPAND=HORIZONTAL, MIN=%.1f, MAX=%.1f, VALUE=%.1f, STEP=0.01", min, max, def);
    IupSetAttributes(scale, buf);
    IupSetCallback(scale, "VALUECHANGED_CB", (Icallback)IupQuakeScaleUpdate);

    snprintf(buf, 16, "%.1f", def);
    label_value = IupLabel(buf);
    IupStoreAttribute(label_value, "EXPAND", "HORIZONTAL");
    IupStoreAttribute(label_value, "ALIGNMENT", "ACENTER:ACENTER");

    snprintf(buf, 16, "%.1f", min);
    label_min = IupLabel(buf);
    IupStoreAttribute(label_min, "ALIGNMENT", "ACENTER:ACENTER");
    snprintf(buf, 16, "%.1f", max);
    label_max = IupLabel(buf);
    IupStoreAttribute(label_max, "ALIGNMENT", "ACENTER:ACENTER");

    return IupVbox(
            IupLabel(title),
            IupHbox(
                label_min,
                label_value,
                label_max,
                NULL
            ),
            scale,
            NULL
    );
}
开发者ID:hifi-unmaintained,项目名称:aq2cfg,代码行数:35,代码来源:mouse.c


示例9: main

int main(int argc, char **argv)
{
  Ihandle *dlg, *bt, *box, *lbl, *ml, *vbox;
  IupOpen(&argc, &argv);

  bt = IupButton("Button", NULL);
  //IupSetAttribute(bt, "EXPAND", "VERTICAL");  /* This is the only necessary EXPAND */
  IupSetAttribute(bt, "EXPAND", "YES");

  box = IupSbox(bt);
  IupSetAttribute(box, "DIRECTION", "SOUTH");  /* place at the bottom of the button */
//  IupSetAttribute(box, "COLOR", "0 255 0");

  ml = IupMultiLine(NULL);
  IupSetAttribute(ml, "EXPAND", "YES");
  IupSetAttribute(ml, "VISIBLELINES", "5");
  vbox = IupVbox(box, ml, NULL);

  lbl = IupLabel("Label");
  IupSetAttribute(lbl, "EXPAND", "VERTICAL");

  dlg = IupDialog(IupHbox(vbox, lbl, NULL));
  IupSetAttribute(dlg, "TITLE", "IupSbox Example");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "10");

  IupShow(dlg);

  IupMainLoop();
  IupDestroy(dlg);
  IupClose();
  return 1;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:33,代码来源:sbox1.c


示例10: main

int main(int argc, char **argv)
{
  IupOpen(&argc, &argv);
  IupControlsOpen();

  bt = IupButton("Test", "");
  IupSetAttribute(bt, "EXPAND", "YES");

  box = IupSbox(bt);
  IupSetAttribute(box, "DIRECTION", "SOUTH");

  ml = IupMultiLine(NULL);
  IupSetAttribute(ml, IUP_EXPAND, "YES");
  vbox = IupVbox(box, ml, NULL);

  lb = IupLabel("Label");
  IupSetAttribute(lb, IUP_EXPAND, "YES");

  dg = IupDialog(IupHbox(vbox, IupFrame(lb), NULL));
  IupSetAttribute(dg, IUP_MARGIN, "10x20");

  //IupSetAttribute(dg,"COMPOSITED", "YES");
  //IupSetAttribute(dg,"LAYERED", "YES");
  //IupSetAttribute(dg,"LAYERALPHA", "192");

  IupShow(dg);

  IupMainLoop();
  IupDestroy(dg);
  IupControlsClose();
  IupClose();
  return 1;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:33,代码来源:test1.c


示例11: resetSetupUI

static Ihandle* resetSetupUI() {
    Ihandle *dupControlsBox = IupHbox(
        rstButton = IupButton("RST next packet", NULL),
        inboundCheckbox = IupToggle("Inbound", NULL),
        outboundCheckbox = IupToggle("Outbound", NULL),
        IupLabel("Chance(%):"),
        chanceInput = IupText(NULL),
        NULL
        );

    IupSetAttribute(chanceInput, "VISIBLECOLUMNS", "4");
    IupSetAttribute(chanceInput, "VALUE", "0");
    IupSetCallback(chanceInput, "VALUECHANGED_CB", uiSyncChance);
    IupSetAttribute(chanceInput, SYNCED_VALUE, (char*)&chance);
    IupSetCallback(inboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(inboundCheckbox, SYNCED_VALUE, (char*)&resetInbound);
    IupSetCallback(outboundCheckbox, "ACTION", (Icallback)uiSyncToggle);
    IupSetAttribute(outboundCheckbox, SYNCED_VALUE, (char*)&resetOutbound);
    IupSetCallback(rstButton, "ACTION", resetSetRSTNextButtonCb);
    IupSetAttribute(rstButton, "PADDING", "4x");

    // enable by default to avoid confusing
    IupSetAttribute(inboundCheckbox, "VALUE", "ON");
    IupSetAttribute(outboundCheckbox, "VALUE", "ON");

    if (parameterized) {
        setFromParameter(inboundCheckbox, "VALUE", NAME"-inbound");
        setFromParameter(outboundCheckbox, "VALUE", NAME"-outbound");
        setFromParameter(chanceInput, "VALUE", NAME"-chance");
    }

    return dupControlsBox;
}
开发者ID:286897655,项目名称:clumsy,代码行数:33,代码来源:reset.c


示例12: IupGetText

int IupGetText(const char* title, char* text)
{
  Ihandle *ok, *cancel, *multi_text, *button_box, *dlg_box, *dialog;
  int bt;

  multi_text = IupMultiLine("do_nothing");
  IupSetAttribute(multi_text,IUP_EXPAND, IUP_YES);
  IupSetAttribute(multi_text, IUP_SIZE, "200x80");
  IupSetAttribute(multi_text,IUP_VALUE, text);
  IupSetAttribute(multi_text,IUP_FONT, IUP_COURIER_NORMAL_12);

  ok   = IupButton(strok, NULL);
  IupSetAttribute (ok   ,IUP_SIZE ,"50x");
  IupSetCallback(ok, "ACTION", (Icallback)CB_button_OK);
  IupSetHandle( "IupGetTextOkButton", ok );

  cancel  = IupButton(strcancel, NULL);
  IupSetAttribute (cancel,IUP_SIZE ,"50x");
  IupSetCallback(cancel, "ACTION", (Icallback)CB_button_CANCEL);
  IupSetHandle( "IupGetTextCancelButton", cancel );

  button_box = IupHbox(
    IupSetAttributes(IupFill(), "EXPAND=HORIZONTAL"),
    ok,
    IupSetAttributes(IupFill(), "SIZE=1x"),
    cancel,
    NULL);
  IupSetAttribute(button_box,IUP_MARGIN,"0x0");

  dlg_box = IupVbox(
    multi_text,
    IupSetAttributes(IupFill(), "SIZE=1x"),
    button_box,
    NULL);

  IupSetAttribute(dlg_box,IUP_MARGIN,"10x10");
  IupSetAttribute(dlg_box,IUP_GAP,"5");

  dialog = IupDialog (dlg_box);

  IupSetAttribute (dialog,IUP_TITLE,title);
  IupSetAttribute (dialog,IUP_MINBOX,IUP_NO);
  IupSetAttribute (dialog,IUP_MAXBOX,IUP_NO);
  IupSetAttribute (dialog,IUP_DEFAULTENTER,"IupGetTextOkButton");
  IupSetAttribute (dialog,IUP_DEFAULTESC,"IupGetTextCancelButton");
  IupSetAttribute (dialog,IUP_PARENTDIALOG, IupGetGlobal(IUP_PARENTDIALOG));
  IupSetAttribute (dialog, IUP_ICON, IupGetGlobal(IUP_ICON));

  IupPopup(dialog, IUP_CENTER, IUP_CENTER);

  bt = IupGetInt(dialog, IUP_STATUS);
  if (bt==1)
    strcpy(text, IupGetAttribute(multi_text, IUP_VALUE));
  else
    bt = 0;  /* return 0 instead of -1 */

  IupDestroy(dialog);
  return bt;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:59,代码来源:ipredial.c


示例13: iuplua_show_error_message

void iuplua_show_error_message(const char *pname, const char* msg)
{
  Ihandle *multi_text, *lbl, *copy, *button, *box, *dlg, *abort, *buttonbox;
  char* value = IupGetGlobal("LUA_ERROR_LABEL");

  if (!pname) pname = "[email protected]_ERROR";

  lbl = IupLabel("[email protected]_LUAERROR");
  IupSetAttribute(lbl, "EXPAND", "HORIZONTAL");
  if (value) IupSetStrAttribute(lbl, "TITLE", value);

  copy = IupButton("[email protected]_COPY", NULL);
  IupSetStrAttribute(copy, "TIP", "[email protected]_COPYTOCLIPBOARD");
  IupSetStrAttribute(copy, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(copy, "ACTION", show_error_copy_action);

  button = IupButton("[email protected]_CONTINUE", NULL);
  IupSetStrAttribute(button, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(button, "ACTION", show_error_continue_action);

  abort = IupButton("[email protected]_EXIT", NULL);
  IupSetStrAttribute(abort, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(abort, "ACTION", show_error_exit_action);

  multi_text = IupMultiLine(NULL);
  IupSetAttribute(multi_text, "EXPAND", "YES");
  IupSetAttribute(multi_text, "READONLY", "YES");
  IupSetAttribute(multi_text, "FONT", "Courier, 12");
  IupSetAttribute(multi_text, "VISIBLELINES", "10");
  IupSetAttribute(multi_text, "VISIBLECOLUMNS", "50");
  IupSetAttribute(multi_text, "NAME", "TEXT");
  IupSetStrAttribute(multi_text, "VALUE", msg);

  buttonbox = IupHbox(copy, button, abort, NULL);
  IupSetAttribute(buttonbox, "GAP", "50");
  IupSetAttribute(IupNormalizer(button, abort, NULL), "NORMALIZE", "HORIZONTAL");

  box = IupVbox(lbl, multi_text, buttonbox, NULL);
  IupSetAttribute(box, "ALIGNMENT", "ACENTER");
  IupSetAttribute(box, "NMARGIN", "10x10");
  IupSetAttribute(box, "GAP", "10");

  dlg = IupDialog(box);

  IupSetStrAttribute(dlg, "TITLE", pname);
  IupSetAttribute(dlg, "MINBOX", "NO");
  IupSetAttribute(dlg, "MAXBOX", "NO");
  IupSetAttribute(dlg, "PARENTDIALOG", IupGetGlobal("PARENTDIALOG"));
  IupSetAttribute(dlg, "ICON", IupGetGlobal("ICON"));
  IupSetAttributeHandle(dlg, "DEFAULTESC", button);
  IupSetAttributeHandle(dlg, "DEFAULTENTER", button);
  IupSetAttributeHandle(dlg, "STARTFOCUS", button);

  IupPopup(dlg, IUP_CENTERPARENT, IUP_CENTERPARENT);

  IupDestroy(dlg);
}
开发者ID:mwoz,项目名称:Hildim.Source,代码行数:57,代码来源:iuplua.c


示例14: main

/* 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;

}
开发者ID:sanikoyes,项目名称:iup,代码行数:58,代码来源:label.c


示例15: main

int main(int argc, char **argv)
{
    Ihandle *win,*tabs,*buttons;

    IupOpen(&argc, &argv);      

    tabs = IupTabs(
        IupQuakeBindingLayout(),
        IupQuakeMouseLayout(),
        IupFill(),
        IupFill(),
        IupFill(),
        NULL
    );
    IupStoreAttribute(tabs, "TABTITLE0", "Keyboard");
    IupStoreAttribute(tabs, "TABTITLE1", "Mouse");
    IupStoreAttribute(tabs, "TABTITLE2", "Audio");
    IupStoreAttribute(tabs, "TABTITLE3", "Video");
    IupStoreAttribute(tabs, "TABTITLE4", "Multiplayer");

    IupStoreAttribute(tabs, "MARGIN", "2x2");

    buttons = IupHbox(
        IupSetCallbacks(IupButton("&Quit", "ACTION"), "ACTION", (Icallback)IupExitLoop, NULL),
        IupFill(),
        IupButton("&Save", NULL),
        IupFill(),
        IupButton("&Launch game", NULL),
        NULL
    );

    win = IupDialog(
            IupSetAttributes(
                IupVbox(
                    IupSetAttributes(
                        IupLabel("Action Quake 2 Configuration"),
                        "EXPAND=YES, ALIGNMENT=ACENTER:ACENTER, FONT=\"sans-serif, Bold 18\""
                    ),
                    tabs,
                    //buttons,
                    NULL
                ),
                "GAP=5, MARGIN=3x3"
            )
    );

    IupStoreAttribute(win, "TITLE", "Action Quake 2 Configuration");
    IupStoreAttribute(win, "RESIZE", "NO");

    IupShow(win);

    /* bug? */
    IupStoreAttribute(win, "SIZE", NULL);
    IupRefresh(win);

    IupMainLoop();
}
开发者ID:hifi-unmaintained,项目名称:aq2cfg,代码行数:57,代码来源:main.c


示例16: TabsTest

void TabsTest(void)
{
  Ihandle *box, *frm1, *frm2, *dlg, *tabs;

  tabs = CreateTabs(1);
  
  box = IupHbox(tabs, 
                frm1 = IupFrame(IupRadio(IupVbox(IupToggle("TOP", "cbType"), 
                                                 IupToggle("LEFT", "cbType"), 
                                                 IupToggle("BOTTOM", "cbType"), 
                                                 IupToggle("RIGHT", "cbType"), 
                                                 NULL))), 
                frm2 = IupFrame(IupRadio(IupVbox(IupToggle("HORIZONTAL", "cbOrientation"), 
                                                 IupToggle("VERTICAL", "cbOrientation"), 
                                                 NULL))), 
                IupVbox(IupSetAttributes(IupButton("Add Tab", "cbAddTab"), "TIP=\"Button Tip\""),
                        IupButton("Insert Tab", "cbInsertTab"),
                        IupButton("Remove Tab", "cbRemoveTab"),
                        IupToggle("Inactive", "cbInactive"),
                        IupButton("VALUEPOS=0", "cbValuePos"),
                        NULL), 
                NULL);

  IupSetAttribute(frm1, "MARGIN", "5x5");
  IupSetAttribute(frm2, "MARGIN", "5x5");
  IupSetAttribute(frm1, "GAP", "0");
  IupSetAttribute(frm2, "GAP", "0");
  IupSetAttribute(frm1, "TITLE", "Type");
  IupSetAttribute(frm2, "TITLE", "Orientation");

  IupSetAttribute(box, "MARGIN", "10x10");
  IupSetAttribute(box, "GAP", "10");
  dlg = IupDialog(box);

  IupSetAttribute(dlg, "TITLE", "IupTabs Test");
  IupSetAttribute(dlg, "APP_TABS", (char*)tabs);
//  IupSetAttribute(box, "BGCOLOR", "92 92 255");
//  IupSetAttribute(dlg, "BGCOLOR", "92 92 255");
//  IupSetAttribute(dlg, "BACKGROUND", "200 10 80");
//  IupSetAttributeHandle(dlg, "BACKGROUND", load_image_LogoTecgraf());
//  IupSetAttribute(dlg, "FGCOLOR", "10 200 80");
//  IupSetAttribute(dlg, "BGCOLOR", "173 177 194");  // Motif BGCOLOR for documentation
//  IupSetAttribute(dlg,"COMPOSITED","NO");

  IupMap(dlg);
  IupSetAttribute(dlg, "SIZE", NULL);
  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);

  IupSetFunction("cbOrientation", (Icallback)cbOrientation);
  IupSetFunction("cbType", (Icallback)cbType);
  IupSetFunction("cbAddTab", (Icallback)cbAddTab);
  IupSetFunction("cbInsertTab", (Icallback)cbInsertTab);
  IupSetFunction("cbRemoveTab", (Icallback)cbRemoveTab);
  IupSetFunction("cbInactive", (Icallback)cbInactive);
  IupSetFunction("cbChildButton", (Icallback)cbChildButton);
  IupSetFunction("cbValuePos", (Icallback)cbValuePos);
}
开发者ID:Airr,项目名称:iup_mac,代码行数:57,代码来源:tabs.c


示例17: WebBrowserTest

void WebBrowserTest(void)
{
  Ihandle *txt, *dlg, *web;
  Ihandle *btLoad, *btReload, *btBack, *btForward, *btStop;
#ifndef WIN32
  Ihandle *history;
#endif

  IupWebBrowserOpen();              

  // Creates an instance of the WebBrowser control
  web = IupWebBrowser();

  // Creates a dialog containing the control
  dlg = IupDialog(IupVbox(IupHbox(btBack = IupButton("Back", NULL),
                                  btForward = IupButton("Forward", NULL),
                                  txt = IupText(""),
                                  btLoad = IupButton("Load", NULL),
                                  btReload = IupButton("Reload", NULL),
                                  btStop = IupButton("Stop", NULL),
#ifndef WIN32
                                  history = IupButton("History", NULL),
#endif
                                  NULL), 
                                  web, NULL));
  IupSetAttribute(dlg, "TITLE", "IupWebBrowser");
  IupSetAttribute(dlg, "MY_TEXT", (char*)txt);
  IupSetAttribute(dlg, "MY_WEB", (char*)web);
  IupSetAttribute(dlg, "RASTERSIZE", "800x600");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "10");

   //IupSetAttribute(web, "HTML", "<html><body><b>Hello</b>World!</body></html>");
//   IupSetAttribute(txt, "VALUE", "My HTML");
  IupSetAttribute(txt, "VALUE", "http://www.tecgraf.puc-rio.br/iup");
//  IupSetAttribute(txt, "VALUE", "file:///D:/tecgraf/iup/html/index.html");
  IupSetAttribute(web, "VALUE", IupGetAttribute(txt, "VALUE"));
  IupSetAttributeHandle(dlg, "DEFAULTENTER", btLoad);

  IupSetAttribute(txt, "EXPAND", "HORIZONTAL");
  IupSetCallback(btLoad, "ACTION", (Icallback)load_cb);
  IupSetCallback(btReload, "ACTION", (Icallback)reload_cb);
  IupSetCallback(btBack, "ACTION", (Icallback)back_cb);
  IupSetCallback(btForward, "ACTION", (Icallback)forward_cb);
  IupSetCallback(btStop, "ACTION", (Icallback)stop_cb);
#ifndef WIN32
  IupSetCallback(history, "ACTION", (Icallback)history_cb);
#endif

  IupSetCallback(web, "NEWWINDOW_CB", (Icallback)newwindow_cb);
  IupSetCallback(web, "NAVIGATE_CB", (Icallback)navigate_cb);
  IupSetCallback(web, "ERROR_CB", (Icallback)error_cb);
  IupSetCallback(web, "COMPLETED_CB", (Icallback)completed_cb);

  // Shows dialog
  IupShow(dlg);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:57,代码来源:webbrowser.c


示例18: 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);
}
开发者ID:LuaDist,项目名称:iup,代码行数:44,代码来源:class_conf.c


示例19: 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);
}
开发者ID:defdef,项目名称:iup,代码行数:11,代码来源:treednd.c


示例20: main

int main(int argc, char **argv) 
{
  Ihandle *dlg;
  Ihandle *list, *list_multiple, *list_dropdown;
  Ihandle *frm_medal, *frm_sport, *frm_prize;

  IupOpen(&argc, &argv);

  list = IupList ("list_act");
  IupSetAttributes (list, "1=Gold, 2=Silver, 3=Bronze, 4=Tecgraf, 5=None,"
                          "SHOWIMAGE=YES, SHOWDRAGDROP=YES, XXX_SPACING=4, VALUE=4");
  load_medal_images();
  IupSetAttribute(list, "IMAGE1", "IMGGOLD");
  IupSetAttribute(list, "IMAGE2", "IMGSILVER");
  IupSetAttribute(list, "IMAGE3", "IMGBRONZE");
  IupSetAttributeHandle(list, "IMAGE4", load_image_Tecgraf());
  IupSetCallback(list, "DRAGDROP_CB", (Icallback)dragdrop_cb);
//  IupSetAttribute(list, "FONT", "Helvetica, Bold 40");
//  IupSetAttribute(list, "AUTOHIDE", "NO");

  frm_medal = IupFrame (list);
  IupSetAttribute (frm_medal, "TITLE", "Best medal");
  list_multiple = IupList(NULL);
  
  IupSetAttributes (list_multiple, "1=\"100m dash\", 2=\"Long jump\", 3=\"Javelin throw\", 4=\"110m hurdlers\", 5=\"Hammer throw\",6=\"High jump\","
                                   "MULTIPLE=YES, VALUE=\"+--+--\", SIZE=EIGHTHxEIGHTH");

  IupSetCallback(list_multiple, "ACTION", (Icallback)list_multiple_cb);
  
  frm_sport = IupFrame (list_multiple);
  
  IupSetAttribute (frm_sport, "TITLE", "Competed in");

  list_dropdown = IupList (NULL);
  IupSetAttributes (list_dropdown, "1=\"Less than US$ 1000\", 2=\"US$ 2000\", 3=\"US$ 5000\", 4=\"US$ 10000\", 5=\"US$ 20000\", 6=\"US$ 50000\", 7=\"More than US$ 100000\","
                                   "SHOWIMAGE=YES, DROPDOWN=YES, VISIBLE_ITEMS=3");
  IupSetAttributeHandle(list_dropdown, "IMAGE1", IupImageRGB(20, 20, image_data_24));
  IupSetAttributeHandle(list_dropdown, "IMAGE2", IupImageRGB(20, 20, image_data_24));
  IupSetAttributeHandle(list_dropdown, "IMAGE3", load_image_Tecgraf());

  frm_prize = IupFrame (list_dropdown);
  IupSetAttribute (frm_prize, "TITLE", "Prizes won");

  dlg = IupDialog (IupHbox (frm_medal, frm_sport, frm_prize, NULL));
  IupSetAttribute (dlg, "TITLE", "IupList Example");
  IupShowXY (dlg, IUP_CENTER, IUP_CENTER);
//  IupSetAttribute(IupGetChild(dlg, 0), "BGCOLOR", "92 92 255");
//  IupSetAttribute(dlg, "BACKGROUND", "200 10 80");
//  IupSetAttribute(dlg, "BGCOLOR", "92 92 255");

  IupMainLoop ();
  IupClose ();
  return EXIT_SUCCESS;

}
开发者ID:kmx,项目名称:mirror-iup,代码行数:55,代码来源:list1.c



注:本文中的IupHbox函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IupLabel函数代码示例发布时间:2022-05-30
下一篇:
C++ IupGetInt函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap