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


C++ IupGetGlobal函数代码示例

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


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

示例1: IupGetColor

int IupGetColor(int x, int y, unsigned char *r, unsigned char *g, unsigned char *b)
{
  int ret;
  Ihandle* dlg = IupColorDlg();

  IupSetAttribute(dlg, "TITLE",  iupStrMessageGet("IUP_GETCOLOR"));
  IupSetfAttribute(dlg, "VALUE", "%d %d %d", *r, *g, *b);
  IupSetAttribute(dlg, "PARENTDIALOG", IupGetGlobal("PARENTDIALOG"));
  IupSetAttribute(dlg, "ICON", IupGetGlobal("ICON"));

  IupPopup(dlg, x, y);

  ret = IupGetInt(dlg, "STATUS");
  if (ret)
    iupStrToRGB(IupGetAttribute(dlg, "VALUE"), r, g, b);

  IupDestroy(dlg);

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

示例2: winTabsDrawPageBackground

static void winTabsDrawPageBackground(Ihandle* ih, HDC hDC, RECT* rect)
{
  unsigned char r=0, g=0, b=0;
  char* color = iupAttribGetInheritNativeParent(ih, "BGCOLOR");
  if (!color) color = iupAttribGetInheritNativeParent(ih, "BACKGROUND");
  if (!color) color = iupAttribGet(ih, "BACKGROUND");
  if (!color) color = IupGetGlobal("DLGBGCOLOR");
  iupStrToRGB(color, &r, &g, &b);
  SetDCBrushColor(hDC, RGB(r,g,b));
  FillRect(hDC, rect, (HBRUSH)GetStockObject(DC_BRUSH));
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:11,代码来源:iupwin_tabs.c

示例3: IupMessage

void IupMessage(const char* title, const char* message)
{
  Ihandle* dlg = IupCreate("messagedlg");

  IupSetAttribute(dlg, "TITLE", (char*)title);
  IupSetAttribute(dlg, "VALUE", (char*)message);
  IupSetAttribute(dlg, "PARENTDIALOG", IupGetGlobal("PARENTDIALOG"));

  IupPopup(dlg, IUP_CENTER, IUP_CENTER);
  IupDestroy(dlg);
}
开发者ID:pottootje1982,项目名称:singalong,代码行数:11,代码来源:iup_messagedlg.c

示例4: iDialogListCheckLastVisible

static void iDialogListCheckLastVisible()
{
  if (iupDlgListVisibleCount() <= 0)
  {
    /* if this is the last window visible,
    exit message loop except when LOCKLOOP==YES */
    if (!iupStrBoolean(IupGetGlobal("LOCKLOOP")))
    {
      IupExitLoop();
    }
  }
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:12,代码来源:iup_dialog.c

示例5: k_any

static int k_any(Ihandle *ih, int c)
{
  if (c == K_a)
    IupSetAttribute(ih, "POSX", "100");

  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("  MODKEYSTATE(%s)\n", IupGetGlobal("MODKEYSTATE"));
  return IUP_DEFAULT;
}
开发者ID:Airr,项目名称:iup_mac,代码行数:12,代码来源:canvas.c

示例6: iuplua_plugstate

void iuplua_plugstate(lua_State *L, Ihandle *ih)
{
  IupSetAttribute(ih, "_IUPLUA_STATE_CONTEXT",(char *) L);

  if (IupGetGlobal("IUPLUA_THREADED"))
  {
    int ref;
    lua_pushthread(L);
    ref = luaL_ref(L, LUA_REGISTRYINDEX);   /* keep ref for L, L maybe a thread */
    IupSetInt(ih, "_IUPLUA_STATE_THREAD", ref);
  }
}
开发者ID:mwoz,项目名称:Hildim.Source,代码行数:12,代码来源:iuplua.c

示例7: iupMatrixGetFgColor

char* iupMatrixGetFgColor(Ihandle* ih, int lin, int col)
{
  unsigned char r = 0, g = 0, b = 0;
  /* called from Edit only */
  if (!ih->data->fgcolor_cb || (iMatrixCallColorCB(ih, ih->data->fgcolor_cb, lin, col, &r, &g, &b) == IUP_IGNORE))
  {
    char* fgcolor = iMatrixGetCellAttrib(ih, IMAT_HAS_FGCOLOR, lin, col, 0);
    if (!fgcolor) 
    {
      if (lin ==0 || col == 0)
        fgcolor = IupGetGlobal("DLGFGCOLOR");
      else
        fgcolor = IupGetGlobal("TXTFGCOLOR");
    }
    return fgcolor;
  }
  else
  {
    char* buffer = iupStrGetMemory(30);
    sprintf(buffer, "%d %d %d", r, g, b);
    return buffer;
  }
}
开发者ID:pottootje1982,项目名称:singalong,代码行数:23,代码来源:iupmat_getset.c

示例8: IupOleControlOpen

int IupOleControlOpen(void)
{
    if (IupGetGlobal("_IUP_OLECONTROL_OPEN"))
        return IUP_OPENED;

    HRESULT retval = OleInitialize(NULL);
    if (retval != S_OK && retval != S_FALSE)
        return IUP_ERROR;

    iupRegisterClass(iOleControlNewClass());

    IupSetGlobal("_IUP_OLECONTROL_OPEN", "1");
    return IUP_NOERROR;
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:14,代码来源:iup_olecontrol.cpp

示例9: IupGetFile

int IupGetFile(char* filename)
{
  Ihandle *dlg = 0;
  int ret;
  char filter[4096] = "*.*";
  static char dir[4096] = "";  /* static will make the dir persist from one call to another if not defined */

  if (!filename) return -1;

  dlg = IupFileDlg();

  iupStrSplitFileName(filename, dir, filter);

  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_CENTERPARENT, IUP_CENTERPARENT);

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

  IupDestroy(dlg);

  return ret;
}
开发者ID:Airr,项目名称:iup_mac,代码行数:37,代码来源:iup_predial.c

示例10: iuplua_show_error_message

void iuplua_show_error_message(const char *pname, const char* msg)
{
  Ihandle *multi_text, *lbl, *copy, *button, *box, *dlg, *abort, *buttonbox;
  char* value = IupGetGlobal("LUA_ERROR_LABEL");

  if (!pname) pname = "[email protected]_ERROR";

  lbl = IupLabel("[email protected]_LUAERROR");
  IupSetAttribute(lbl, "EXPAND", "HORIZONTAL");
  if (value) IupSetStrAttribute(lbl, "TITLE", value);

  copy = IupButton("[email protected]_COPY", NULL);
  IupSetStrAttribute(copy, "TIP", "[email protected]_COPYTOCLIPBOARD");
  IupSetStrAttribute(copy, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(copy, "ACTION", show_error_copy_action);

  button = IupButton("[email protected]_CONTINUE", NULL);
  IupSetStrAttribute(button, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(button, "ACTION", show_error_continue_action);

  abort = IupButton("[email protected]_EXIT", NULL);
  IupSetStrAttribute(abort, "PADDING", IupGetGlobal("DEFAULTBUTTONPADDING"));
  IupSetCallback(abort, "ACTION", show_error_exit_action);

  multi_text = IupMultiLine(NULL);
  IupSetAttribute(multi_text, "EXPAND", "YES");
  IupSetAttribute(multi_text, "READONLY", "YES");
  IupSetAttribute(multi_text, "FONT", "Courier, 12");
  IupSetAttribute(multi_text, "VISIBLELINES", "10");
  IupSetAttribute(multi_text, "VISIBLECOLUMNS", "50");
  IupSetAttribute(multi_text, "NAME", "TEXT");
  IupSetStrAttribute(multi_text, "VALUE", msg);

  buttonbox = IupHbox(copy, button, abort, NULL);
  IupSetAttribute(buttonbox, "GAP", "50");
  IupSetAttribute(IupNormalizer(button, abort, NULL), "NORMALIZE", "HORIZONTAL");

  box = IupVbox(lbl, multi_text, buttonbox, NULL);
  IupSetAttribute(box, "ALIGNMENT", "ACENTER");
  IupSetAttribute(box, "NMARGIN", "10x10");
  IupSetAttribute(box, "GAP", "10");

  dlg = IupDialog(box);

  IupSetStrAttribute(dlg, "TITLE", pname);
  IupSetAttribute(dlg, "MINBOX", "NO");
  IupSetAttribute(dlg, "MAXBOX", "NO");
  IupSetAttribute(dlg, "PARENTDIALOG", IupGetGlobal("PARENTDIALOG"));
  IupSetAttribute(dlg, "ICON", IupGetGlobal("ICON"));
  IupSetAttributeHandle(dlg, "DEFAULTESC", button);
  IupSetAttributeHandle(dlg, "DEFAULTENTER", button);
  IupSetAttributeHandle(dlg, "STARTFOCUS", button);

  IupPopup(dlg, IUP_CENTERPARENT, IUP_CENTERPARENT);

  IupDestroy(dlg);
}
开发者ID:mwoz,项目名称:Hildim.Source,代码行数:57,代码来源:iuplua.c

示例11: IupGLMakeCurrent

void IupGLMakeCurrent(Ihandle* ih)
{
  IGlControlData* gldata;

  iupASSERT(iupObjectCheck(ih));
  if (!iupObjectCheck(ih))
    return;

  /* must be an IupGLCanvas */
  if (ih->iclass->nativetype != IUP_TYPECANVAS || 
      !IupClassMatch(ih, "glcanvas"))
    return;

  /* must be mapped */
  gldata = (IGlControlData*)iupAttribGet(ih, "_IUP_GLCONTROLDATA");
  if (!gldata->window)
    return;

  if (wglMakeCurrent(gldata->device, gldata->context)==FALSE)
  {
    iupAttribSet(ih, "ERROR", "Failed to set new current context.");
    iupAttribSetStr(ih, "LASTERROR", IupGetGlobal("LASTERROR"));
  }
  else
  {
    iupAttribSet(ih, "ERROR", NULL);
    iupAttribSet(ih, "LASTERROR", NULL);

    if (!IupGetGlobal("GL_VERSION"))
    {
      IupSetStrGlobal("GL_VENDOR", (char*)glGetString(GL_VENDOR));
      IupSetStrGlobal("GL_RENDERER", (char*)glGetString(GL_RENDERER));
      IupSetStrGlobal("GL_VERSION", (char*)glGetString(GL_VERSION));
    }
  }
}
开发者ID:ivanceras,项目名称:iup-mirror,代码行数:36,代码来源:iup_glcanvas_win.c

示例12: iMatrixGetBgColorAttrib

static char* iMatrixGetBgColorAttrib(Ihandle* ih, int lin, int col)
{
  if (lin==-1 && col==-1) /* empty id */
  {
    /* check the hash table */
    char *color = iupAttribGet(ih, "BGCOLOR");

    /* If not defined return the default for normal cells */
    if (!color)
      color = IupGetGlobal("TXTBGCOLOR");

    return color;
  }
  return NULL;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:15,代码来源:iupmatrix.c

示例13: iMatrixGetBgColorAttrib

static char* iMatrixGetBgColorAttrib(Ihandle* ih, const char* name_id)
{
  if (name_id[0]==0)
  {
    /* check the hash table */
    char *color = iupAttribGet(ih, "BGCOLOR");

    /* If not defined return the default for normal cells */
    if (!color)
      color = IupGetGlobal("TXTBGCOLOR");

    return color;
  }
  return NULL;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:15,代码来源:iupmatrix.c

示例14: iSplitMotion_CB

static int iSplitMotion_CB(Ihandle* bar, int x, int y, char *status)
{
  Ihandle* ih = bar->parent;

  if (ih->data->is_holding)
  {
    if (iup_isbutton1(status))
    {
      int cur_x, cur_y;

      iupStrToIntInt(IupGetGlobal("CURSORPOS"), &cur_x, &cur_y, 'x');

      if (ih->data->orientation == ISPLIT_VERT)
      {
        int width1 = iSplitGetWidth1(ih);
        width1 = ih->data->start_size + (cur_x - ih->data->start_pos);
        ih->data->val = (width1*1000)/(ih->currentwidth-ih->data->barsize);
      }
      else
      {
        int height1 = iSplitGetHeight1(ih);
        height1 = ih->data->start_size + (cur_y - ih->data->start_pos);
        ih->data->val = (height1*1000)/(ih->currentheight-ih->data->barsize);
      }

      iSplitCropVal(ih);

      if (ih->data->layoutdrag)
      {
        if (ih->data->autohide)
        {
          iSplitSetBarPosition(ih, cur_x, cur_y, 0);
          iSplitAutoHideXY(ih);
        }

        IupRefreshChildren(ih);  
      }
      else
        iSplitSetBarPosition(ih, cur_x, cur_y, 1);
    }
    else
      ih->data->is_holding = 0;
  }

  (void)x;
  (void)y;
  return IUP_DEFAULT;
}
开发者ID:svn2github,项目名称:iup-iup,代码行数:48,代码来源:iup_split.c

示例15: winToggleGetBgColorAttrib

static char* winToggleGetBgColorAttrib(Ihandle* ih)
{
    /* the most important use of this is to provide
       the correct background for images */
    if (iupwin_comctl32ver6 && ih->data->type==IUP_TOGGLE_IMAGE)
    {
        COLORREF cr;
        if (iupwinDrawGetThemeButtonBgColor(ih->handle, &cr))
            return iupStrReturnStrf("%d %d %d", (int)GetRValue(cr), (int)GetGValue(cr), (int)GetBValue(cr));
    }

    if (ih->data->type == IUP_TOGGLE_TEXT)
        return iupBaseNativeParentGetBgColorAttrib(ih);
    else
        return IupGetGlobal("DLGBGCOLOR");
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:16,代码来源:iupwin_toggle.c


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