예제 #1
0
int IupOpen(int *argc, char ***argv)
{
  if (iup_opened)
    return IUP_OPENED;
  iup_opened = 1;

  if (!argc || !(*argc) || !argv)
  {
    argc = &iup_dummy_argc;
    argv = &iup_dummy_argv;
  }

  iupNamesInit();
  iupFuncInit();
  iupStrMessageInit();
  iupGlobalAttribInit(); 
  iupRegisterInit();
  iupKeyInit();
  iupImageStockInit();

  IupSetLanguage("ENGLISH");
  IupSetGlobal("VERSION", IupVersion());
  IupSetGlobal("COPYRIGHT",  IUP_COPYRIGHT);

  if (iupdrvOpen(argc, argv) == IUP_NOERROR)
  {
    char* value;

    iupdrvFontInit();

    IupStoreGlobal("SYSTEM", iupdrvGetSystemName());
    IupStoreGlobal("SYSTEMVERSION", iupdrvGetSystemVersion());
    IupStoreGlobal("COMPUTERNAME", iupdrvGetComputerName());
    IupStoreGlobal("USERNAME", iupdrvGetUserName());
    IupSetGlobal("DEFAULTFONT", iupdrvGetSystemFont());  /* Use SetGlobal because iupdrvGetSystemFont returns a static string */

    iupRegisterInternalClasses();

    value = getenv("IUP_QUIET");
    if (value && !iupStrBoolean(value)) /* if not defined do NOT print */
      printf("IUP %s %s\n", IupVersion(), IUP_COPYRIGHT);

    value = getenv("IUP_VERSION");
    if (iupStrBoolean(value))
      iupVersionDlg();

    return IUP_NOERROR;
  }
  else
  {
#ifdef  IUP_ASSERT
    /* can not use pre-defined dialogs here, so only output to console. */
    fprintf(stderr, "IUP ERROR: IupOpen failed.\n");
#endif
    return IUP_ERROR;
  }
}
예제 #2
0
파일: winver.c 프로젝트: svn2github/iup-iup
void iupwinVersion(void)
{
   Ihandle* dial, *ok;

   dial = IupDialog(IupVbox(IupFrame(IupVbox(
                        IupLabel(IupVersion()),
                        IupLabel(IUP_VERSION_DATE),
                        IupLabel(IUP_COPYRIGHT),
                        NULL)), 
                      ok = IupButton("Ok", NULL),
                      NULL));

   IupSetCallback(ok, "ACTION", (Icallback)ok_cb);

   IupSetAttribute(dial,IUP_TITLE,"IUP");
   IupSetAttribute(dial,IUP_MENUBOX,IUP_NO);
   IupSetAttribute(dial,IUP_MINBOX,IUP_NO);
   IupSetAttribute(dial,IUP_MAXBOX,IUP_NO);
   IupSetAttribute(dial,IUP_RESIZE,IUP_NO);

   IupSetAttribute(dial,"GAP","5");
   IupSetAttribute(dial,"MARGIN","5");

   IupPopup(dial, IUP_CENTER, IUP_CENTER);
   IupDestroy(dial);
}
예제 #3
0
void iupVersionDlg(void)
{
  Ihandle* dlg;

  dlg = IupDialog(IupVbox(IupFrame(IupVbox(
                      IupLabel(IupVersion()),
                      IupLabel(IUP_VERSION_DATE),
                      IupLabel(IUP_COPYRIGHT),
                      NULL)), 
                    IupButton("OK", NULL),
                    NULL));

  IupSetAttribute(dlg,"TITLE","IUP Version");
  IupSetAttribute(dlg,"DIALOGFRAME","YES");
  IupSetAttribute(dlg,"DIALOGHINT","YES");
  IupSetAttribute(dlg,"GAP","10");
  IupSetAttribute(dlg,"MARGIN","10x10");

  IupPopup(dlg, IUP_CENTER, IUP_CENTER);
  IupDestroy(dlg);
}
예제 #4
0
파일: iuplua.c 프로젝트: mwoz/Hildim.Source
static void setinfo (lua_State *L) 
{
  /* global table is at the stack */

  lua_pushliteral (L, IUP_COPYRIGHT);
  lua_setfield(L, -2, "_COPYRIGHT");

  lua_pushliteral (L, IUP_DESCRIPTION);
  lua_setfield(L, -2, "_DESCRIPTION");

  lua_pushliteral (L, IUP_NAME);
  lua_setfield(L, -2, "_NAME");

  lua_pushstring (L, IupVersion());
  lua_setfield(L, -2, "_VERSION");

  lua_pushliteral (L, IUP_VERSION_DATE);
  lua_setfield(L, -2, "_VERSION_DATE");

  lua_pushinteger (L, IupVersionNumber());
  lua_setfield(L, -2, "_VERSION_NUMBER");
}
예제 #5
0
파일: iuplua_api.c 프로젝트: LuaDist/iup
static int Version(lua_State *L)
{
  lua_pushstring(L, IupVersion());
  return 1;
}                                                                             
예제 #6
0
static void Version(void)
{
  lua_pushstring(IupVersion());
}