本文整理汇总了C++中IupGetDialogChild函数的典型用法代码示例。如果您正苦于以下问题:C++ IupGetDialogChild函数的具体用法?C++ IupGetDialogChild怎么用?C++ IupGetDialogChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IupGetDialogChild函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: motFontDlgShow_CB
static int motFontDlgShow_CB(Ihandle* ih, int state)
{
if (state == IUP_SHOW)
{
Ihandle* sample = IupGetDialogChild(ih, "SAMPLE");
char* value = iupAttribGet(ih, "PREVIEWTEXT");
if (value)
IupStoreAttribute(sample, "TITLE", value);
value = iupAttribGet(ih, "VALUE");
if (value)
{
IupStoreAttribute(sample, "FONT", value);
value = IupGetAttribute(sample, "FONTFACE");
motFontDlgSelectFontFace(ih, value, 1);
}
if (!IupGetCallback(ih, "HELP_CB"))
{
Ihandle* help_bt = IupGetDialogChild(ih, "HELPBUT");
IupSetAttribute(help_bt, "VISIBLE", "NO");
}
}
return IUP_DEFAULT;
}
示例2: edit_menu_open_cb
int edit_menu_open_cb(Ihandle* ih)
{
Ihandle *clipboard = IupClipboard();
Ihandle *item_paste = IupGetDialogChild(ih, "ITEM_PASTE");
Ihandle *item_cut = IupGetDialogChild(ih, "ITEM_CUT");
Ihandle *item_delete = IupGetDialogChild(ih, "ITEM_DELETE");
Ihandle *item_copy = IupGetDialogChild(ih, "ITEM_COPY");
Ihandle* multitext = IupGetDialogChild(ih, "MULTITEXT");
if (!IupGetInt(clipboard, "TEXTAVAILABLE"))
IupSetAttribute(item_paste, "ACTIVE", "NO");
else
IupSetAttribute(item_paste, "ACTIVE", "YES");
if (!IupGetAttribute(multitext, "SELECTEDTEXT"))
{
IupSetAttribute(item_cut, "ACTIVE", "NO");
IupSetAttribute(item_delete, "ACTIVE", "NO");
IupSetAttribute(item_copy, "ACTIVE", "NO");
}
else
{
IupSetAttribute(item_cut, "ACTIVE", "YES");
IupSetAttribute(item_delete, "ACTIVE", "YES");
IupSetAttribute(item_copy, "ACTIVE", "YES");
}
IupDestroy(clipboard);
return IUP_DEFAULT;
}
示例3: btn_key_cb
static int btn_key_cb (Ihandle* ih)
{
Ihandle *mltline = IupGetDialogChild(ih, "mltline");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetFocus(mltline);
IupFlush();
return IUP_DEFAULT;
}
示例4: btn_key_cb
static int btn_key_cb (Ihandle* ih)
{
Ihandle *mltline = IupGetDialogChild(ih, "mltline");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetFocus(mltline);
IupFlush();
IupSetfAttribute(NULL, "KEY", "%d", IupGetInt(text, "VALUE"));
return IUP_DEFAULT;
}
示例5: classesList_ActionCB
static int classesList_ActionCB (Ihandle *ih, char *className, int pos, int state)
{
if (state == 1)
{
Iclass* ic;
int i, attr_n, cb_n;
Ihandle* listAttributes = IupGetDialogChild(ih, "listAttributes");
Ihandle* listCallbacks = IupGetDialogChild(ih, "listCallbacks");
Ihandle* labelInfo = IupGetDialogChild(ih, "labelInfo");
char **attr_names = (char **) malloc(MAX_ITEMS * sizeof(char *));
char **cb_names;
attr_n = IupGetClassAttributes(className, attr_names, MAX_ITEMS);
qsort(attr_names, attr_n, sizeof(char*), compare);
cb_names = attr_names + attr_n;
cb_n = IupGetClassCallbacks(className, cb_names, MAX_ITEMS);
qsort(cb_names, cb_n, sizeof(char*), compare);
/* Clear lists */
IupSetAttribute(listAttributes, "REMOVEITEM", NULL);
IupSetAttribute(listCallbacks, "REMOVEITEM", NULL);
/* Populate lists */
for (i = 0; i < attr_n; i++)
IupSetAttribute(listAttributes, "APPENDITEM", attr_names[i]);
for (i = 0; i < cb_n; i++)
IupSetAttribute(listCallbacks, "APPENDITEM", cb_names[i]);
ic = iupRegisterFindClass(className);
/* Update labels (values) */
IupSetfAttribute(labelInfo, "TITLE", "Class Name: %s\n"
"Creation Parameters: (%s)\n"
"Native Type: %s\n"
"Container Type: %s\n"
"%s\n"
"%s\n",
ic->name,
getParameters(ic->format),
getNativeType(ic->nativetype),
getChildType(ic->childtype),
ic->is_interactive? "Is Interactive": "NOT Interactive",
ic->has_attrib_id? "Has Id Attributes": "");
free(attr_names);
}
(void)pos;
return IUP_DEFAULT;
}
示例6: insertitem_cb
static int insertitem_cb(Ihandle *ih)
{
Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetAttribute(list, "INSERTITEM3", IupGetAttribute(text, "VALUE"));
return IUP_DEFAULT;
}
示例7: motFontDlgInitFamilyList
static void motFontDlgInitFamilyList(Ihandle* ih)
{
int i, j = 1, count = 0;
char prev[1024]="", family[1024];
Ihandle* list1 = IupGetDialogChild(ih, "LIST1"); /* this will reduce the initial number */
char**font_list_str = XListFonts(iupmot_display, "-*-*-medium-r-*-*-0-0-*-*-*-*-*-*", 32767, &count);
char*backup_list[32767];
if (!font_list_str)
return;
memcpy(backup_list, font_list_str, count*sizeof(char*));
qsort(font_list_str, count, sizeof(char*), motFontDlgCompareStr);
for (i=0; i<count; i++)
{
motFontGetFamily(font_list_str[i], family);
if (!iupStrEqual(family, prev)) /* avoid duplicates */
{
IupStoreAttributeId(list1, "", j, family);
strcpy(prev, family);
j++;
}
}
IupSetAttributeId(list1, "", j, NULL);
memcpy(font_list_str, backup_list, count*sizeof(char*));
XFreeFontNames(font_list_str);
}
示例8: item_saveas_action_cb
int item_saveas_action_cb(Ihandle* item_saveas)
{
Ihandle* multitext = IupGetDialogChild(item_saveas, "MULTITEXT");
Ihandle *filedlg = IupFileDlg();
IupSetAttribute(filedlg, "DIALOGTYPE", "SAVE");
IupSetAttribute(filedlg, "FILTER", "*.txt");
IupSetAttribute(filedlg, "FILTERINFO", "Text Files");
IupSetAttributeHandle(filedlg, "PARENTDIALOG", IupGetDialog(item_saveas));
IupPopup(filedlg, IUP_CENTERPARENT, IUP_CENTERPARENT);
if (IupGetInt(filedlg, "STATUS") != -1)
{
Ihandle* config = (Ihandle*)IupGetAttribute(multitext, "CONFIG");
char* filename = IupGetAttribute(filedlg, "VALUE");
char* str = IupGetAttribute(multitext, "VALUE");
int count = IupGetInt(multitext, "COUNT");
write_file(filename, str, count);
IupConfigRecentUpdate(config, filename);
}
IupDestroy(filedlg);
return IUP_DEFAULT;
}
示例9: removeitem_cb
static int removeitem_cb(Ihandle *ih)
{
Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetAttribute(list, "REMOVEITEM", IupGetAttribute(text, "VALUE"));
return IUP_DEFAULT;
}
示例10: show_error_copy_action
static int show_error_copy_action(Ihandle* ih)
{
Ihandle* multi_text = IupGetDialogChild(ih, "TEXT");
IupSetAttribute(multi_text, "SELECTION", "ALL");
IupSetAttribute(multi_text, "CLIPBOARD", "COPY");
return IUP_DEFAULT;
}
示例11: actualsize_action_cb
int actualsize_action_cb(Ihandle* ih)
{
Ihandle* zoom_val = IupGetDialogChild(ih, "ZOOMVAL");
IupSetDouble(zoom_val, "VALUE", 0);
zoom_update(ih, 0);
return IUP_DEFAULT;
}
示例12: item_revert_action_cb
int item_revert_action_cb(Ihandle* item_revert)
{
Ihandle* canvas = IupGetDialogChild(item_revert, "CANVAS");
char* filename = IupGetAttribute(canvas, "FILENAME");
open_file(item_revert, filename);
return IUP_DEFAULT;
}
示例13: TestFocusInChild
static void TestFocusInChild(Ihandle* ih, int pos)
{
/* Works only in Windows, GTK will set the focus to the first child always */
if(pos==0)
{
Ihandle* text = IupGetDialogChild(ih, "ATEXT");
if (text)
IupSetFocus(text);
}
else if(pos==4)
{
Ihandle* button = IupGetDialogChild(ih, "EEEEEBUTTON");
if (button)
IupSetFocus(button);
}
}
示例14: item_select_all_action_cb
int item_select_all_action_cb(Ihandle* item_select_all)
{
Ihandle* multitext = IupGetDialogChild(item_select_all, "MULTITEXT");
IupSetFocus(multitext);
IupSetAttribute(multitext, "SELECTION", "ALL");
return IUP_DEFAULT;
}
示例15: item_open_action_cb
int item_open_action_cb(Ihandle* item_open)
{
Ihandle* multitext = IupGetDialogChild(item_open, "MULTITEXT");
Ihandle *filedlg = IupFileDlg();
IupSetAttribute(filedlg, "DIALOGTYPE", "OPEN");
IupSetAttribute(filedlg, "FILTER", "*.txt");
IupSetAttribute(filedlg, "FILTERINFO", "Text Files");
IupSetAttributeHandle(filedlg, "PARENTDIALOG", IupGetDialog(item_open));
IupPopup(filedlg, IUP_CENTERPARENT, IUP_CENTERPARENT);
if (IupGetInt(filedlg, "STATUS") != -1)
{
char* filename = IupGetAttribute(filedlg, "VALUE");
char* str = read_file(filename);
if (str)
{
IupSetStrAttribute(multitext, "VALUE", str);
free(str);
}
}
IupDestroy(filedlg);
return IUP_DEFAULT;
}