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

C++ IupGetDialog函数代码示例

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

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



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


示例16: CB_list

static int CB_list (Ihandle *ih, char *text, int item, int state)
{
  (void)text;
  if (state)
    iupAttribSetInt(IupGetDialog(ih), "_IUP_LIST_NUMBER", item-1);
  return IUP_DEFAULT;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:7,代码来源:iup_predialogs.c


示例17: action2_cb

static int action2_cb(Ihandle* ih)
{
  IupSetAttribute(IupGetDialog(ih), "BGCOLOR", "0 128 0");
//  IupSetAttribute(IupGetDialog(ih), "RASTERSIZE", "600x300");
//  IupRefresh(IupGetDialog(ih));
//  IupFlush();
  return IUP_DEFAULT;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:8,代码来源:sample.c


示例18: ShowFormulaError

static void ShowFormulaError(Ihandle* ih, lua_State *L)
{
  const char* str_message = IupGetLanguageString("IUP_ERRORINVALIDFORMULA");
  const char* error = lua_tostring(L, -1);
  char msg[1024];
  sprintf(msg, "%s\n  Lua error: %s", str_message, error);
  IupMessageError(IupGetDialog(ih), msg);
}
开发者ID:mwoz,项目名称:Hildim.Source,代码行数:8,代码来源:iuplua_plot.c


示例19: iupDialogGetChildId

int iupDialogGetChildId(Ihandle* ih)
{
  int id;
  ih = IupGetDialog(ih);
  if (!ih) return -1;
  id = ih->data->child_id;
  ih->data->child_id = id+1;
  return id;
}
开发者ID:friends-of-iup,项目名称:iup,代码行数:9,代码来源:iup_dialog.c


示例20: set_new_image

void set_new_image(Ihandle* canvas, imImage* image, const char* filename, int dirty)
{
  imImage* old_image = (imImage*)IupGetAttribute(canvas, "IMAGE");
  Ihandle* size_lbl = IupGetDialogChild(canvas, "SIZELABEL");
  Ihandle* zoom_val = IupGetDialogChild(canvas, "ZOOMVAL");

  if (filename)
  {
    IupSetStrAttribute(canvas, "FILENAME", filename);
    IupSetfAttribute(IupGetDialog(canvas), "TITLE", "%s - Simple Paint", str_filetitle(filename));
  }
  else
  {
    IupSetAttribute(canvas, "FILENAME", NULL);
    IupSetAttribute(IupGetDialog(canvas), "TITLE", "Untitled - Simple Paint");
  }

  /* we are going to support only RGB images with no alpha */
  imImageRemoveAlpha(image);
  if (image->color_space != IM_RGB)
  {
    imImage* new_image = imImageCreateBased(image, -1, -1, IM_RGB, -1);
    imConvertColorSpace(image, new_image);
    imImageDestroy(image);

    image = new_image;
  }

  /* default file format */
  const char* format = imImageGetAttribString(image, "FileFormat");
  if (!format)
    imImageSetAttribString(image, "FileFormat", "JPEG");
    
  IupSetAttribute(canvas, "DIRTY", dirty? "Yes": "No");
  IupSetAttribute(canvas, "IMAGE", (char*)image);

  IupSetfAttribute(size_lbl, "TITLE", "%d x %d px", image->width, image->height);

  if (old_image)
    imImageDestroy(old_image);

  IupSetDouble(zoom_val, "VALUE", 0);
  zoom_update(canvas, 0);
}
开发者ID:sanikoyes,项目名称:iup,代码行数:44,代码来源:example4_4.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IupGetDialogChild函数代码示例发布时间:2022-05-30
下一篇:
C++ IupGetCallback函数代码示例发布时间: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