本文整理汇总了C++中IupGetHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ IupGetHandle函数的具体用法?C++ IupGetHandle怎么用?C++ IupGetHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IupGetHandle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iupSpinNewClass
Iclass* iupSpinNewClass(void)
{
Iclass* ic = iupClassNew(iupRegisterFindClass("vbox"));
ic->name = "spin";
ic->format = NULL; /* no parameters */
ic->nativetype = IUP_TYPEVOID;
ic->childtype = IUP_CHILDNONE;
ic->is_interactive = 0;
/* Class functions */
ic->New = iupSpinNewClass;
ic->Create = iSpinCreateMethod;
iupClassRegisterCallback(ic, "SPIN_CB", "i");
if (!IupGetHandle("IupSpinUpImage") || !IupGetHandle("IupSpinDownImage"))
{
Ihandle* spin_timer = IupTimer();
IupSetCallback(spin_timer, "ACTION_CB", (Icallback) iSpinTimerCB);
IupSetHandle("IupSpinTimer", spin_timer);
iSpinLoadImages();
}
return ic;
}
示例2: downloaderGui_download
//Downloads und installs the latest supported nw.js version for the specified application.
int downloaderGui_download(){
downloaderGui = IupGetHandle("downloaderDlg");
pb = IupGetHandle("pb");
status = IupGetHandle("status");
IupSetCallback(IupGetHandle("cancel"), "ACTION", (Icallback)cancelCb);
IupSetCallback(downloaderGui, "CLOSE_CB", (Icallback)cancelCb);
IupSetFunction("IDLE_ACTION", downloadCb);
IupPopup(downloaderGui, IUP_CENTERPARENT, IUP_CENTERPARENT);
return globalResult;
}
示例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: btn_detach_cb
static int btn_detach_cb(Ihandle *bt)
{
Ihandle *dbox = IupGetHandle("dbox");
IupSetAttribute(dbox, "DETACH", NULL);
IupSetAttribute(bt, "ACTIVE", "NO");
IupSetAttribute(IupGetHandle("restore"), "ACTIVE", "Yes");
return IUP_DEFAULT;
}
示例5: cb_btnClearMorse
static int cb_btnClearMorse(Ihandle *btn) {
Ihandle *txtMorse, *lblMorse;
txtMorse = IupGetHandle (TXTMORSE_4);
lblMorse = IupGetHandle (LBLMORSELEN_4);
IupSetAttribute(txtMorse, "VALUE", 0);
IupSetfAttribute(lblMorse, "TITLE", FRMT_MORSELEN_4, 0);
return IUP_DEFAULT;
}
示例6: cb_btnClearAscii
static int cb_btnClearAscii(Ihandle *btn) {
Ihandle *txtAscii, *lblAscii;
txtAscii = IupGetHandle (TXTASCII_2);
lblAscii = IupGetHandle (LBLASCIILEN_2);
IupSetAttribute(txtAscii, "VALUE", 0);
IupSetfAttribute(lblAscii, "TITLE", FRMT_ASCIILEN_2, 0);
return IUP_DEFAULT;
}
示例7: main
int main(int argc, char **argv){
IupOpen(&argc, &argv);
led_load(); //Loads the GUI compiled from LED files.
mainDlg = IupGetHandle("mainDlg"); //Get the window named "mainDlg"
IupShowXY(mainDlg, IUP_CENTER, IUP_CENTER); //Shows the main window
aboutDlg = about_init(); //Get the window named "aboutDlg"
IupSetCallback(IupGetHandle("about"), "ACTION", (Icallback)main_about); //Callback: Associates the click action of the button "about" with the "about" function.
IupMainLoop();
IupClose();
return EXIT_SUCCESS;
}
示例8: detached_cb
static int detached_cb(Ihandle *ih, Ihandle* new_parent, int x, int y)
{
IupSetAttribute(new_parent, "TITLE", "New Dialog");
IupSetAttribute(IupGetHandle("restore"), "ACTIVE", "YES");
IupSetAttribute(IupGetHandle("detach"), "ACTIVE", "NO");
printf("Detached!\n");
(void)ih;
(void)x;
(void)y;
return IUP_DEFAULT;
}
示例9: enter
static int enter(Ihandle *self, int lin, int col)
{
printf("enteritem_cb(%d, %d)\n", lin, col);
if(lin == 2 && col == 2)
{
IupSetAttribute(IupGetHandle("mat1"), "REDRAW", "ALL");
IupSetAttribute(IupGetHandle("mat2"), "REDRAW", "ALL");
//IupSetAttribute(IupGetHandle("mat3"), "REDRAW", "ALL");
//IupSetAttribute(IupGetHandle("mat4"), "REDRAW", "ALL");
//IupSetAttribute(IupGetHandle("mat5"), "REDRAW", "ALL");
//IupSetAttribute(IupGetHandle("mat6"), "REDRAW", "ALL");
}
return IUP_DEFAULT;
}
示例10: main
int main(int argc, char **argv)
{
IupOpen(&argc, &argv);
IupControlsOpen();
func_1();
IupShowXY(IupGetHandle("dlg"),IUP_CENTER,IUP_CENTER);
IupMainLoop();
IupDestroy(IupGetHandle("img1"));
IupDestroy(IupGetHandle("img2"));
IupDestroy(IupGetHandle("dlg"));
IupControlsClose();
IupClose();
return 0;
}
示例11: iDialogSetMenuAttrib
static int iDialogSetMenuAttrib(Ihandle* ih, const char* value)
{
if (!ih->handle)
{
Ihandle* menu = IupGetHandle(value);
ih->data->menu = menu;
return 1;
}
if (!value)
{
if (ih->data->menu && ih->data->menu->handle)
{
ih->data->ignore_resize = 1;
IupUnmap(ih->data->menu); /* this will remove the menu from the dialog */
ih->data->ignore_resize = 0;
ih->data->menu = NULL;
}
}
else
{
Ihandle* menu = IupGetHandle(value);
if (!menu || menu->iclass->nativetype != IUP_TYPEMENU || menu->parent)
return 0;
/* already the current menu and it is mapped */
if (ih->data->menu && ih->data->menu==menu && menu->handle)
return 1;
/* the current menu is mapped, so unmap it */
if (ih->data->menu && ih->data->menu->handle && ih->data->menu!=menu)
{
ih->data->ignore_resize = 1;
IupUnmap(ih->data->menu); /* this will remove the menu from the dialog */
ih->data->ignore_resize = 0;
}
ih->data->menu = menu;
menu->parent = ih; /* use this to create a menu bar instead of a popup menu */
ih->data->ignore_resize = 1;
IupMap(menu); /* this will automatically add the menu to the dialog */
ih->data->ignore_resize = 0;
}
return 1;
}
示例12: nodeinfo
static int nodeinfo(Ihandle* ih)
{
char attr[50], *kind;
Ihandle* tree = IupGetHandle("tree");
int branch = 0, id = IupGetInt(tree, "VALUE");
printf("\nTree Info:\n");
printf(" TOTALCOUNT=%s\n", IupGetAttribute(tree, "COUNT"));
printf("Node Info:\n");
printf(" ID=%d\n", id);
printf(" TITLE=%s\n", IupGetAttribute(tree, "TITLE"));
printf(" DEPTH=%s\n", IupGetAttribute(tree, "DEPTH"));
sprintf(attr, "KIND%d", id);
kind = IupGetAttribute(tree, "KIND");
printf(" KIND=%s\n", kind);
if (strcmp(kind, "BRANCH")==0) branch = 1;
if (branch)
printf(" STATE=%s\n", IupGetAttribute(tree, "STATE"));
printf(" IMAGE=%s\n", IupGetAttribute(tree, "IMAGE"));
if (branch)
printf(" IMAGEBRANCHEXPANDED=%s\n", IupGetAttribute(tree, "IMAGEBRANCHEXPANDED"));
printf(" MARKED=%s\n", IupGetAttribute(tree, "MARKED"));
printf(" COLOR=%s\n", IupGetAttribute(tree, "COLOR"));
printf(" PARENT=%s\n", IupGetAttribute(tree, "PARENT"));
printf(" COUNT=%s\n", IupGetAttribute(tree, "CHILDCOUNT"));
printf(" USERDATA=%p\n", IupGetAttribute(tree, "USERDATA"));
return IUP_DEFAULT;
}
示例13: btn_image_button_cb
/******************************************************************************
* Function: *
* Button with image button callback *
* *
* Description: *
* Callback called when the exit button is pressed or released. Shows a *
* message saying if the button was pressed or released *
* *
* Parameters received: *
* self - identifies the canvas that activated the function’s execution. *
* b - identifies the activated mouse button: *
* *
* IUP_BUTTON1 left mouse button (button 1) *
* IUP_BUTTON2 middle mouse button (button 2) *
* IUP_BUTTON3 right mouse button (button 3) *
* *
* e - indicates the state of the button: *
* *
* 0 mouse button was released *
* 1 mouse button was pressed *
* *
* Value returned: *
* IUP_DEFAULT *
******************************************************************************/
int btn_image_button_cb( Ihandle *self,int b, int e )
{
/* If the left button changed its state... */
if( b == IUP_BUTTON1 )
{
/* IUP handles */
Ihandle* text;
/* Recovers "text" handle */
text = IupGetHandle( "text" );
/* If the button was pressed... */
if(e == 1)
{
/* Sets text's value */
IupSetAttribute( text, "VALUE", "Red button pressed" );
}
/* else the button was released */
else
{
/* Sets text's value */
IupSetAttribute( text, "VALUE", "Red button released" );
}
}
/* Executed function successfully */
return IUP_DEFAULT;
}
示例14: addleaf
static int addleaf(void)
{
Ihandle* tree = IupGetHandle("tree");
int id = IupGetInt(tree, "VALUE");
IupTreeSetAttribute(tree, "ADDLEAF", id, "");
return IUP_DEFAULT;
}
示例15: iDetachBoxSetRestoreAttrib
static int iDetachBoxSetRestoreAttrib(Ihandle* ih, const char* value)
{
Ihandle *dlg = IupGetDialog(ih);
Ihandle* new_parent = IupGetHandle(value);
Ihandle* new_brother = NULL;
if (!new_parent)
{
new_parent = ih->data->old_parent;
new_brother = ih->data->old_brother;
if (IupGetChildPos(new_parent, new_brother) == -1) /* not a child of new_parent */
new_brother = NULL;
}
/* Sets the new parent */
IupReparent(ih, new_parent, new_brother);
/* Show handler */
if (ih->data->barsize)
IupSetAttribute(ih->firstchild, "VISIBLE", "Yes");
/* Updates/redraws the layout of the dialog */
IupRefresh(new_parent);
/* Reset previous parent and brother */
ih->data->old_parent = NULL;
ih->data->old_brother = NULL;
IupDestroy(dlg);
return 0;
}