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


C++ IupGetDialogChild函数代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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