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

C++ IupGetAttribute函数代码示例

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

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



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

示例1: edition_cb

static int edition_cb(Ihandle *self, int lin, int col, int mode, int update)
{
  if (mode == 0)
  {
    char* value = IupGetAttribute(self, "VALUE");
#ifndef BIG_MATRIX
    if (value && strcmp(value, data[lin-1][col-1])!=0)
#else
    char* cell = IupGetAttributeId2(self, "", lin, col);
    if (value && cell && strcmp(value, cell)!=0)
#endif
      return IUP_IGNORE;
  }
  return IUP_DEFAULT;
}
开发者ID:defdef,项目名称:iup,代码行数:15,代码来源:matrix_cbmode.c


示例2: get_nc

static char* get_nc(Ihandle *n)
{
   if (type(n) == TEXT_ || (type(n) == LIST_ && iupCheck(n, "EDITBOX")==YES))
   {
      char *nc = getBuffer();
      int max;
      Widget w = (Widget)handle(n);
      if (type(n) == LIST_)
        w = (Widget)IupGetAttribute(n, "_IUPMOT_EDITBOX");
      XtVaGetValues(w, XmNmaxLength, &max, NULL);
      sprintf(nc, "%d", max);
      return nc;
   }
   return NULL;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:15,代码来源:motget.c


示例3: GetAttribute

static void GetAttribute(void)
{
  char *name = luaL_check_string(2);
  Ihandle* ih = iuplua_checkihandle(1);
  char *value = IupGetAttribute(ih, name);
  if (!value || iupATTRIB_ISINTERNAL(name))
    lua_pushnil();
  else
  {
    if (iupAttribIsPointer(ih, name))
      lua_pushuserdata((void*)value);
    else
      lua_pushstring(value);
  }
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:15,代码来源:iuplua_api.c


示例4: iupdrvDialogGetDecoration

void iupdrvDialogGetDecoration(Ihandle* ih, int *border, int *caption, int *menu)
{
    if (ih->data->menu)
        *menu = iupdrvMenuGetMenuBarSize(ih->data->menu);
    else
        *menu = 0;

    if (ih->handle)
    {
        winDialogGetWindowDecor(ih, border, caption);

        if (*menu)
            *caption -= *menu;
    }
    else
    {
        int has_titlebar = iupAttribGetBoolean(ih, "MAXBOX")  ||
                           iupAttribGetBoolean(ih, "MINBOX")  ||
                           iupAttribGetBoolean(ih, "MENUBOX") ||
                           IupGetAttribute(ih, "TITLE");  /* must use IupGetAttribute to check from the native implementation */

        *caption = 0;
        if (has_titlebar)
        {
            if (iupAttribGetBoolean(ih, "TOOLBOX") && iupAttribGet(ih, "PARENTDIALOG"))
                *caption = GetSystemMetrics(SM_CYSMCAPTION); /* tool window */
            else
                *caption = GetSystemMetrics(SM_CYCAPTION);   /* normal window */
        }

        *border = 0;
        if (iupAttribGetBoolean(ih, "RESIZE"))
        {
            /* has_border */
            *border = GetSystemMetrics(SM_CXFRAME);     /* Thickness of the sizing border around the perimeter of a window  */
        }                                             /* that can be resized, in pixels.                                  */
        else if (has_titlebar)
        {
            /* has_border */
            *border = GetSystemMetrics(SM_CXFIXEDFRAME);  /* Thickness of the frame around the perimeter of a window        */
        }                                               /* that has a caption but is not sizable, in pixels.              */
        else if (iupAttribGetBoolean(ih, "BORDER"))
        {
            /* has_border */
            *border = GetSystemMetrics(SM_CXBORDER);
        }
    }
}
开发者ID:xubingyue,项目名称:iup,代码行数:48,代码来源:iupwin_dialog.c


示例5: IupGetFile

int IupGetFile(char* file)
{
  Ihandle *dlg = 0;
  int i,ret,n;
  char filter[4096] = "*.*";
  char dir[4096];

  if (!file) return -1;

  dlg = IupFileDlg();

  n = strlen(file);

  /* Look for last folder separator and split filter from directory */
  for (i=n-1;i>=0; i--)
  {
    if (file[i] == '\\' || file[i] == '/') 
    {
      strncpy(dir, file, i+1);
      dir[i+1] = 0;   

      strcpy(filter, file+i+1);
      filter[n-i] = 0;

      break;
    }
  }

  IupSetAttribute(dlg, "FILTER", filter);
  IupSetAttribute(dlg, "DIRECTORY", dir);
  IupSetAttribute(dlg, "ALLOWNEW", "YES");
  IupSetAttribute(dlg, "NOCHANGEDIR", "YES");
  IupSetAttribute(dlg, "PARENTDIALOG", IupGetGlobal("PARENTDIALOG"));
  IupSetAttribute(dlg, "ICON", IupGetGlobal("ICON"));

  IupPopup(dlg, IUP_CENTER, IUP_CENTER);

  ret = IupGetInt(dlg, "STATUS");
  if (ret != -1)
  {
    char* value = IupGetAttribute(dlg, "VALUE");
    if (value) strcpy(file, value);
  }

  IupDestroy(dlg);

  return ret;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:48,代码来源:iup_predial.c


示例6: iTreeGetSB

/* Verifies which scrolling bars have been defined
   sbv: =0 doesn't have vertical scrolling bar
        =1         has  vertical scrolling bar
   sbh: =0 doesn't have horizontal scrolling bar
        =1         has horizontal scrolling bar    */
static void iTreeGetSB(Ihandle* ih, int* sbh, int* sbv)
{
  char* sb = IupGetAttribute(ih, "SCROLLBAR");

  if(sb == NULL)
    sb = "YES";

  *sbh = *sbv = 0;

  if(iupStrEqualNoCase(sb, "YES") || iupStrEqualNoCase(sb, "ON"))
    *sbh = *sbv = 1;
  else if(iupStrEqualNoCase (sb, "VERTICAL"))
    *sbv = 1;
  else if(iupStrEqualNoCase (sb, "HORIZONTAL"))
    *sbh = 1;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:21,代码来源:iuptree.c


示例7: iDialRedraw_CB

static int iDialRedraw_CB(Ihandle* ih)
{
  if (!ih->data->cd_canvas)
    return IUP_DEFAULT;

  /* update display */
  cdCanvasFlush(ih->data->cd_canvas);

  if (ih->data->has_focus)
  {
    cdCanvas* cd_canvas_front = (cdCanvas*)IupGetAttribute(ih, "_CD_CANVAS");  /* front buffer canvas */
    IupCdDrawFocusRect(ih, cd_canvas_front, 0, 0, ih->data->w - 1, ih->data->h - 1);
  }

  return IUP_DEFAULT;
}
开发者ID:Vulcanior,项目名称:IUP,代码行数:16,代码来源:iup_dial.c


示例8: k_any

static int k_any(Ihandle *ih, int c)
{
  if (iup_isprint(c))
    printf("K_ANY(%d = %s \'%c\')\n", c, iupKeyCodeToName(c), (char)c);
  else
    printf("K_ANY(%d = %s)\n", c, iupKeyCodeToName(c));
  printf("  CARET(%s)\n", IupGetAttribute(ih, "CARET"));
  if (c == K_cA)
    return IUP_IGNORE;   // Sound a beep in Windows
  if (c == K_cP)
  {
    file_open();
    return IUP_IGNORE;   // Sound a beep in Windows
  }
  return IUP_CONTINUE;
}
开发者ID:sanikoyes,项目名称:iup,代码行数:16,代码来源:text.c


示例9: wGLCanvasUnMapMethod

static void wGLCanvasUnMapMethod(Ihandle* ih)
{
  if (ih->data->context)
  {
    if (ih->data->context == wglGetCurrentContext())
      wglMakeCurrent(NULL, NULL);

    wglDeleteContext(ih->data->context);
  }

  if (ih->data->palette)
    DeleteObject((HGDIOBJ)ih->data->palette);

  if (ih->data->device)
    ReleaseDC((HWND)IupGetAttribute(ih, "HWND"), ih->data->device);  /* can not use ih->handle, because it should work with GTK also */
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:16,代码来源:iup_glcanvas_win.c


示例10: cbAddTab

static int cbAddTab(Ihandle* ih)
{
  Ihandle* tabs = (Ihandle*)IupGetAttribute(ih, "APP_TABS");
  Ihandle *vbox;

  vbox = IupFrame(IupVbox(IupLabel("Label XXX"), IupButton("Button XXX", "cbChildButton"), NULL));
  IupSetAttribute(vbox, "TABTITLE", "XXX");
  IupSetAttribute(vbox, "TITLE", "TABS XXX");

  IupAppend(tabs, vbox);
  IupMap(vbox);

  IupRefresh(tabs); /* update children layout */

  return IUP_DEFAULT;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:16,代码来源:tabs.c


示例11: IupGLPalette

void IupGLPalette (Ihandle* self, int index, float r, float g, float b)
{
  GLData* d = (GLData*)IupGetAttribute(self,"_IUPGL_DATA");
  if (d && d->palette)
  {
    PALETTEENTRY entry;
    entry.peRed    = (BYTE)(r*255);
    entry.peGreen  = (BYTE)(g*255);
    entry.peBlue   = (BYTE)(b*255);
    entry.peFlags  = PC_NOCOLLAPSE;
    SetPaletteEntries(d->palette,index,1,&entry);
    UnrealizeObject(d->device);
    SelectPalette(d->device,d->palette,FALSE);
    RealizePalette(d->device);
  }
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:16,代码来源:iupglw.c


示例12: ShowImage

static void ShowImage(char* file_name, Ihandle* iup_dialog)
{
  int error;
  imImage* image = (imImage*)IupGetAttribute(iup_dialog, "imImage");
  if (image) imImageDestroy(image);
  IupSetAttribute(iup_dialog, "imImage", NULL);

  image = imFileImageLoadBitmap(file_name, 0, &error);
  if (error) PrintError(error);
  if (!image) return;

  IupSetAttribute(iup_dialog, "imImage", (char*)image);
  IupStoreAttribute(iup_dialog, "TITLE", file_name);

  cbCanvasRepaint(iup_dialog); /* we can do this because canvas inherit attributes from the dialog */
}
开发者ID:friends-of-iup,项目名称:im,代码行数:16,代码来源:im_view.c


示例13: app_open_cb

int app_open_cb(Ihandle* self)
{
  imFile* ifile;             /* file input */
  int ret, error;
  unsigned char* gl_data = (unsigned char*)IupGetAttribute(self, "APP_GL_DATA");
  char filename[1024] = ".\\*.*";

  /* get a file name */
  ret = IupGetFile(filename);
  if (ret == -1)
    return IUP_DEFAULT;

  ifile = imFileOpen(filename, &error);
  if (!ifile)
  {
    IupMessage("Error", "Error reading image file.");
    return IUP_DEFAULT;
  }

  {
    int width = 0, height = 0, file_color_mode, color_space;
    Ihandle* dialog = IupGetDialog(self);
    imFileReadImageInfo(ifile, 0, &width, &height, &file_color_mode, NULL);

    /* alocates the buffers */
    if (gl_data) free(gl_data);
    gl_data = malloc(width*height*3);
    IupSetAttribute(dialog, "APP_GL_DATA", gl_data);
    IupSetfAttribute(dialog, "APP_GL_WIDTH", "%d", width);
    IupSetfAttribute(dialog, "APP_GL_HEIGHT", "%d", height);

    imFileReadImageData(ifile, gl_data, 1, IM_PACKED);

    color_space = imColorModeSpace(file_color_mode);
    if (color_space == IM_MAP || color_space == IM_GRAY || color_space == IM_BINARY)
    {
      long palette[256];
      int palette_count;
      imFileGetPalette(ifile, palette, &palette_count);
      ConvertMapToGLData(gl_data, width*height, 3, palette, palette_count);
    }
  }

  imFileClose(ifile);

  return IUP_DEFAULT;
}
开发者ID:LuaDist,项目名称:im,代码行数:47,代码来源:iupglview.c


示例14: motDialogSetWindowManagerStyle

static void motDialogSetWindowManagerStyle(Ihandle* ih)
{
  MwmHints hints;
  static Atom xwmhint = 0;
  if (!xwmhint)
    xwmhint = XmInternAtom(iupmot_display, "_MOTIF_WM_HINTS", False);

  hints.flags = (MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS);
  hints.functions = 0;
  hints.decorations = 0;
  hints.input_mode = 0;
  hints.status = 0;

  if (IupGetAttribute(ih, "TITLE")) {  /* must use IupGetAttribute to check from the native implementation */
    hints.functions   |= MWM_FUNC_MOVE;
    hints.decorations |= MWM_DECOR_TITLE;
  }

  if (iupAttribGetInt(ih, "MENUBOX")) {
    hints.functions   |= MWM_FUNC_CLOSE;
    hints.decorations |= MWM_DECOR_MENU;
  }

  if (iupAttribGetInt(ih, "MINBOX")) {
    hints.functions   |= MWM_FUNC_MINIMIZE;
    hints.decorations |= MWM_DECOR_MINIMIZE;
  }

  if (iupAttribGetInt(ih, "MAXBOX")) {
    hints.functions   |= MWM_FUNC_MAXIMIZE;
    hints.decorations |= MWM_DECOR_MAXIMIZE;
  }

  if (iupAttribGetInt(ih, "RESIZE")) {
    hints.functions   |= MWM_FUNC_RESIZE;
    hints.decorations |= MWM_DECOR_RESIZEH;
  }

  if (iupAttribGetInt(ih, "BORDER"))
    hints.decorations |= MWM_DECOR_BORDER;

  XChangeProperty(iupmot_display, XtWindow(ih->handle),
      xwmhint, xwmhint,
      32, PropModeReplace,
      (const unsigned char *) &hints,
      PROP_MOTIF_WM_HINTS_ELEMENTS);
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:47,代码来源:iupmot_dialog.c


示例15: IupGetFile

int IupGetFile( char* file )
{
  Ihandle *gf = 0;
  int i,ret,n;
  char *value;
  char filter[4096] = "*.*";
  char dir[4096];

  if (!file) return -3;

  gf = IupFileDlg();
  if (!gf) return -2;

  n = strlen(file);

  /* Look for last folder separator and split filter from directory */
  for(i=n-1;i>=0; i--)
  {
    if (file[i] == '\\' || file[i] == '/') 
    {
      strncpy(dir, file, i+1);
      dir[i+1] = 0;   

      strcpy(filter, file+i+1);
      filter[n-i] = 0;

      break;
    }
  }

  IupSetAttribute(gf, IUP_FILTER, filter);
  IupSetAttribute(gf, IUP_DIRECTORY, dir);
  IupSetAttribute(gf, IUP_ALLOWNEW, IUP_YES );
  IupSetAttribute(gf, IUP_NOCHANGEDIR, IUP_YES);
  IupSetAttribute(gf, IUP_PARENTDIALOG, IupGetGlobal(IUP_PARENTDIALOG));
  IupSetAttribute(gf, IUP_ICON, IupGetGlobal(IUP_ICON));

  IupPopup( gf, IUP_CENTER, IUP_CENTER );

  value = IupGetAttribute( gf, IUP_VALUE );
  if (value) strcpy( file, value );
  ret = IupGetInt( gf, IUP_STATUS );

  IupDestroy(gf);

  return ret;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:47,代码来源:ipredial.c


示例16: iupdrvBaseSetTipVisibleAttrib

int iupdrvBaseSetTipVisibleAttrib(Ihandle* ih, const char* value)
{
  GtkWidget* widget = (GtkWidget*)iupAttribGet(ih, "_IUP_EXTRAPARENT");
  if (!widget)
    widget = ih->handle;
  (void)value;

  /* must use IupGetAttribute to use inheritance */
  if (!IupGetAttribute(ih, "TIP"))
    return 0;

#if GTK_CHECK_VERSION(2, 12, 0)
  gtk_widget_trigger_tooltip_query(widget);
#endif

  return 0;
}
开发者ID:Airr,项目名称:iup_mac,代码行数:17,代码来源:iupgtk_tips.c


示例17: iupdrvDrawCreateCanvas

IdrawCanvas* iupdrvDrawCreateCanvas(Ihandle* ih)
{
  IdrawCanvas* dc = calloc(1, sizeof(IdrawCanvas));

  dc->ih = ih;
  dc->wnd = (GdkWindow*)IupGetAttribute(ih, "DRAWABLE");
  dc->gc = gdk_gc_new(dc->wnd);

  gdk_drawable_get_size(dc->wnd, &dc->w, &dc->h);

  dc->pixmap = gdk_pixmap_new(dc->wnd, dc->w, dc->h, gdk_drawable_get_depth(dc->wnd));
  dc->pixmap_gc = gdk_gc_new(dc->pixmap);

  iupAttribSet(ih, "DRAWDRIVER", "GDK");

  return dc;
}
开发者ID:svn2github,项目名称:iup-github,代码行数:17,代码来源:iupgtk_draw_gdk.c


示例18: print_value

static void print_value(Ihandle *ih, double a)
{
  char *type = IupGetAttribute(ih, "TYPE");

  switch(type[0])
  {
    case 'V':
      IupSetfAttribute(lbl_v, "TITLE", "VALUE=%.2f", a);
      break;
    case 'H':
      IupSetfAttribute(lbl_h, "TITLE", "VALUE=%.2f", a);
      break;
  }

  IupSetfAttribute(ih, "TIP", "%.2f", a);
  IupSetfAttribute(ih, "TIPVISIBLE", "Yes");
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:17,代码来源:val.c


示例19: cbTabRightButton

static int cbTabRightButton(Ihandle* ih, int pos)
{
  Ihandle* menu = IupMenu(IupItem("Add Tab", "cbAddTab"),
                          IupItem("Insert Tab", "cbInsertTab"),
                          IupItem("Remove Current Tab", "cbRemoveTab"),
                          IupItem("Remove This", "cbRemoveThisTab"), 
                          IupItem("Hide This", "cbHideThisTab"),
                          NULL);
  
  IupSetAttribute(menu, "APP_TABS", IupGetAttribute(ih, "APP_TABS"));
  IupSetInt(menu, "APP_THISTAB", pos);

  IupPopup(menu, IUP_MOUSEPOS, IUP_MOUSEPOS);
  IupDestroy(menu);

  return IUP_DEFAULT;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:17,代码来源:tabs.c


示例20: iFlatButtonDrawText

void iFlatButtonDrawText(Ihandle* ih, IdrawCanvas* dc, int x, int y, const char* str, const char* color, const char* bgcolor, int active)
{
  unsigned char r = 0, g = 0, b = 0;

  if (!color || !str || str[0] == 0)
    return;

  iupStrToRGB(color, &r, &g, &b);
  if (!active)
  {
    unsigned char bg_r = 0, bg_g = 0, bg_b = 0;
    iupStrToRGB(bgcolor, &bg_r, &bg_g, &bg_b);
    iupImageColorMakeInactive(&r, &g, &b, bg_r, bg_g, bg_b);
  }

  iupDrawText(dc, str, (int)strlen(str), x, y, r, g, b, IupGetAttribute(ih, "FONT"));
}
开发者ID:ivanceras,项目名称:iup-mirror,代码行数:17,代码来源:iup_flatbutton.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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