本文整理汇总了C++中IupGetDialog函数的典型用法代码示例。如果您正苦于以下问题:C++ IupGetDialog函数的具体用法?C++ IupGetDialog怎么用?C++ IupGetDialog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IupGetDialog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iupKeyProcessMnemonic
int iupKeyProcessMnemonic(Ihandle* ih, int code)
{
Ihandle *ih_mnemonic, *dialog = IupGetDialog(ih);
char attrib[16] = "_IUP_MNEMONIC_ ";
attrib[14] = (char)code;
iupStrUpper(attrib, attrib);
ih_mnemonic = (Ihandle*)IupGetAttribute(dialog, attrib);
if (iupObjectCheck(ih_mnemonic))
{
if (IupClassMatch(ih_mnemonic, "label"))
{
Ihandle* ih_next = iupFocusNextInteractive(ih_mnemonic);
if (ih_next)
{
if (IupClassMatch(ih_next, "button") || IupClassMatch(ih_next, "toggle"))
iupdrvActivate(ih_next);
else
IupSetFocus(ih_next);
}
}
else if (IupClassMatch(ih_mnemonic, "tabs"))
IupSetAttribute(ih_mnemonic, "VALUEPOS", IupGetAttribute(ih_mnemonic, attrib));
else if (ih_mnemonic->handle) /* button or toggle */
iupdrvActivate(ih_mnemonic);
return 1;
}
return 0;
}
示例2: winFrameMapMethod
static int winFrameMapMethod(Ihandle* ih)
{
char *title;
DWORD dwStyle = WS_CHILD|WS_CLIPSIBLINGS|
BS_OWNERDRAW, /* owner draw necessary because BS_GROUPBOX does not work ok */
dwExStyle = 0;
if (!ih->parent)
return IUP_ERROR;
title = iupAttribGet(ih, "TITLE");
if (title)
iupAttribSetStr(ih, "_IUPFRAME_HAS_TITLE", "1");
if (iupAttribGetBoolean(IupGetDialog(ih), "COMPOSITED"))
dwExStyle |= WS_EX_COMPOSITED;
else
dwStyle |= WS_CLIPCHILDREN;
if (!iupwinCreateWindowEx(ih, "BUTTON", dwExStyle, dwStyle))
return IUP_ERROR;
/* replace the WinProc to handle other messages */
IupSetCallback(ih, "_IUPWIN_CTRLPROC_CB", (Icallback)winFrameProc);
/* Process WM_DRAWITEM */
IupSetCallback(ih, "_IUPWIN_DRAWITEM_CB", (Icallback)winFrameDrawItem);
return IUP_NOERROR;
}
示例3: 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;
}
示例4: iupmatSetColAlign
/*
%F Muda o alihamento dos textos em uma determinada coluna. Redesenha a
coluna se estiver visivel.
%i h : handle da matriz,
col : coluna ater seu alinhamento mudado. col = 1 representa aprimeira
coluna da matriz.
*/
void iupmatSetColAlign (Ihandle *h, int col)
{
Tmat *mat=(Tmat*)matrix_data(h);
Ihandle *d = IupGetDialog(h);
int visible = (iupCheck(h,IUP_VISIBLE)==YES) && (iupCheck(d,IUP_VISIBLE)==YES);
int err;
IsCanvasSet(mat,err);
if(col > mat_nc(mat) || col < 0)
return;
if(!visible || err!=CD_OK)
return;
if(col == 0) /* Alinhamento da coluna de titulos */
{
iupmatDrawLineTitle(h, mat_fl(mat), mat_ll(mat));
}
else
{
col--; /* a celula super. esq. e 1:1 para o usuario, internamente e 0:0 */
/* Se a coluna esta na parte visivel, redesenha a matriz */
if((col >= mat_fc(mat))&&(col <= mat_lc(mat)))
{
iupmatDrawCells(h,mat_fl(mat),col,mat_ll(mat),col);
iupmatShowFocus(h);
}
}
}
示例5: 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;
}
示例6: iupdrvSetFocus
void iupdrvSetFocus(Ihandle *ih)
{
Ihandle* dialog = IupGetDialog(ih);
if (!gtk_window_is_active((GtkWindow*)dialog->handle))
gdk_window_focus(iupgtkGetWindow(dialog->handle), gtk_get_current_event_time());
gtk_widget_grab_focus(ih->handle);
}
示例7: getvalue_cb
static int getvalue_cb(Ihandle *ih)
{
Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetAttribute(text, "VALUE", IupGetAttribute(list, "VALUE"));
return IUP_DEFAULT;
}
示例8: iupwinGetNativeParentStyle
void iupwinGetNativeParentStyle(Ihandle* ih, DWORD *dwExStyle, DWORD *dwStyle)
{
*dwStyle |= WS_CLIPCHILDREN;
if (iupAttribGetBoolean(IupGetDialog(ih), "COMPOSITED"))
*dwExStyle |= WS_EX_COMPOSITED;
}
示例9: setactivelist
void setactivelist(Ihandle* ih)
{
Ihandle* dialog = IupGetDialog(ih);
Ihandle* label = (Ihandle*)IupGetAttribute(dialog, "_LABEL");
IupSetAttribute(dialog, "_ACTIVE_LIST", (char*)ih);
IupSetAttribute(label, "TITLE", IupGetAttribute(IupGetParent(IupGetParent(ih)), "TITLE"));
}
示例10: selectedtext_cb
static int selectedtext_cb(Ihandle *ih)
{
Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST");
Ihandle *text = IupGetDialogChild(ih, "text");
IupSetAttribute(text, "VALUE", IupGetAttribute(list, "SELECTEDTEXT"));
return IUP_DEFAULT;
}
示例11: 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;
}
示例12: 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;
}
示例13: item_open_action_cb
int item_open_action_cb(Ihandle* item_open)
{
if (!save_check(item_open))
return IUP_DEFAULT;
return select_file(IupGetDialog(item_open), 1);
}
示例14: iupDialogGetChildIdStr
char* iupDialogGetChildIdStr(Ihandle* ih)
{
char *str = iupStrGetMemory(50);
Ihandle* dialog = IupGetDialog(ih);
sprintf(str, "iup-%s-%d", ih->iclass->name, dialog->data->child_id);
return str;
}
示例15: IupGetDialogChild
Ihandle* IupGetDialogChild(Ihandle* ih, const char* name)
{
Ihandle *child, *dialog;
char attrib[1024] = "_IUP_DIALOG_CHILD_";
iupASSERT(iupObjectCheck(ih));
if (!iupObjectCheck(ih))
return NULL;
if (!name)
return NULL;
dialog = IupGetDialog(ih);
if (dialog) ih = dialog;
strcat(attrib, name);
child = (Ihandle*)iupAttribGetStr(ih, attrib);
if (child) return child;
if (ih->firstchild)
{
child = iBaseFindChild(ih, name);
if (child) return child;
}
return NULL;
}