当前位置: 首页>>代码示例>>C++>>正文


C++ IupGetDialog函数代码示例

本文整理汇总了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;
}
开发者ID:defdef,项目名称:iup,代码行数:30,代码来源:iup_key.c

示例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;
}
开发者ID:gcfavorites,项目名称:tastools,代码行数:30,代码来源:iupwin_frame.c

示例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;
}
开发者ID:sanikoyes,项目名称:iup,代码行数:32,代码来源:iup_detachbox.c

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

示例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;
}
开发者ID:carblue,项目名称:iup,代码行数:25,代码来源:example3_6.c

示例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);
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:7,代码来源:iupgtk_focus.c

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

示例8: iupwinGetNativeParentStyle

void iupwinGetNativeParentStyle(Ihandle* ih, DWORD *dwExStyle, DWORD *dwStyle)
{
  *dwStyle |= WS_CLIPCHILDREN;

  if (iupAttribGetBoolean(IupGetDialog(ih), "COMPOSITED"))
    *dwExStyle |= WS_EX_COMPOSITED;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:7,代码来源:iupwin_common.c

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

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

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

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

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

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

示例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;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:26,代码来源:iup_classbase.c


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