Exemple #1
0
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);

  ButtonTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);
  IupControlsOpen();

  CellsCheckboardTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
int main(int argc, char **argv){
	IupOpen(&argc, &argv);
	led_load(); //Loads the GUI compiled from LED files.
	mainDlg = IupGetHandle("mainDlg"); //Get the window named "mainDlg"
	IupShowXY(mainDlg, IUP_CENTER, IUP_CENTER); //Shows the main window

	aboutDlg = about_init(); //Get the window named "aboutDlg"
	IupSetCallback(IupGetHandle("about"), "ACTION", (Icallback)main_about); //Callback: Associates the click action of the button "about" with the "about" function.

 	IupMainLoop();
 	IupClose();
	return EXIT_SUCCESS;
}
Exemple #4
0
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);
  IupControlsOpen();

  ScrollBoxTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
Exemple #5
0
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);
  IupControlsOpen();

  MatrixCbModeTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
Exemple #6
0
int main(int argc, char **argv)
{
  Ihandle *dlg;
  Ihandle *text;
  Ihandle *menu, *menu_file;
  Ihandle *submenu_file;
  Ihandle *item_save, *item_autosave, *item_exit;

  IupOpen(&argc, &argv);
 
  text = IupText(NULL);

  IupSetAttribute(text, "VALUE", "This is an empty text");

  item_save = IupItem("Save\tCtrl+S", NULL);  /* this is NOT related with the Ctrl+S key callback, it will just align the text at right */
  item_autosave = IupItem("&Auto Save", NULL);
  item_exit = IupItem("Exit", "item_exit_act");

  IupSetAttribute(item_exit, "KEY", "x");   /* this is NOT related with the K_X key callback, it will just underline the letter */

  IupSetCallback(item_exit, "ACTION", (Icallback) item_exit_cb);
  IupSetCallback(item_autosave, "ACTION", (Icallback) item_autosave_cb);

  IupSetAttribute(item_autosave, "VALUE", "ON");
  IupSetHandle("item_autosave", item_autosave); /* giving a name to a iup handle */

  menu_file = IupMenu(item_save, item_autosave, item_exit, NULL);
  
  submenu_file = IupSubmenu("File", menu_file);
  
  menu = IupMenu(submenu_file, NULL);
 
  IupSetHandle("menu", menu);
                                
  dlg = IupDialog(IupVbox(text, IupButton("Test", NULL), NULL));

  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "10");
  IupSetAttribute(dlg, "TITLE", "IupItem");
  IupSetAttribute(dlg, "MENU", "menu");
  IupSetCallback(dlg, "K_cX", (Icallback) item_exit_cb);   /* this will also affect the IupText if at focus, since it is used for clipboard cut */
  IupSetCallback(dlg, "K_cA", (Icallback) item_autosave_cb);  /* this will also affect the IupText if at focus, since it is used for select all */
  IupSetCallback(dlg, "K_cS", (Icallback) item_save_cb);

  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
  IupMainLoop();
  IupClose();

  return EXIT_SUCCESS;

}
Exemple #7
0
/* Main program */
int main(int argc, char **argv)
{
  Ihandle *dlg;
  IupOpen(&argc, &argv);       
  IupControlsOpen ();

  dlg = IupDialog(create_mat());
  IupSetAttribute(dlg, "TITLE", "IupMatrix");
  IupShowXY (dlg,IUP_CENTER,IUP_CENTER);
  IupMainLoop ();
  IupClose ();  
  return EXIT_SUCCESS;

}
Exemple #8
0
/*-----------------------*/
int main(int argc, char* argv[]) 
{
  Ihandle* dialog;

  IupOpen(&argc, &argv);                       /* opens the IUP lib */
  IupGLCanvasOpen();                          /* enable the use of OpenGL to draw in canvas */

  dialog = initDialog();                      /* local function to create a dialog with buttons and canvas */
  IupShowXY(dialog, IUP_CENTER, IUP_CENTER);  /* shows dialog in the center of screen */

  IupMainLoop();                              /* handle the program control to the IUP lib until a return IUP_CLOSE */

  IupClose();                               /* closes the IUP lib */ 
}
Exemple #9
0
int main(int argc, char **argv)
{
  IupOpen(&argc, &argv);      
  IupControlsOpen();      
  func_1();
  IupShowXY(IupGetHandle("dlg"),IUP_CENTER,IUP_CENTER);
  IupMainLoop();
  IupDestroy(IupGetHandle("img1"));
  IupDestroy(IupGetHandle("img2"));
  IupDestroy(IupGetHandle("dlg"));
  IupControlsClose();      
  IupClose();  
  return 0;
}
Exemple #10
0
int main(int argc, char **argv)
{
  unsigned char r, g, b;

  IupOpen(&argc, &argv);
  IupControlsOpen () ;

  if(IupGetColor(100, 100, &r, &g, &b))
    printf("RGB = %.2X%.2X%.2X", r, g, b);

  IupControlsClose() ;
  IupClose();
  return 1;
}
Exemple #11
0
static void factoryCache_Release() {
  CriticalSectionObject cs(&cs_factoryCache); // won't let other threads enter till it goes out of scope
  lua_getglobal(factoryCache,"factories");
    lua_pushnil(factoryCache); 
    while(lua_next(factoryCache,-2) != 0) {
    tLuaCOMClassFactory* pFactory = (tLuaCOMClassFactory*)luaCompat_getPointer(factoryCache,-1);
    pFactory->Release();
    lua_pop(factoryCache,1);
    }
  lua_pop(factoryCache,1);
  #ifdef IUP
    IupClose();
  #endif
}
Exemple #12
0
int main(int argc, char **argv)
{
  Ihandle *male, *female, *exclusive, *frame, *dialog;

  IupOpen(&argc, &argv);

  male  = IupToggle ("Male", "");
  female = IupToggle ("Female", "");

  exclusive = IupRadio
  (
    IupVbox
    (
      male,
      female,
      NULL
    )
  );
  IupSetHandle("male", male);
  IupSetHandle("female", female);
  IupSetAttribute(exclusive, IUP_VALUE, "female");
  IupSetAttribute(exclusive, IUP_TIP, "Two state button - Exclusive - RADIO");

  frame = IupFrame
  (
    exclusive
  );
  IupSetAttribute (frame, IUP_TITLE, "Gender");

  dialog = IupDialog
  (
    IupHbox
    (
      IupFill(),
      frame,
      IupFill(),
      NULL
    )
  );

  IupSetAttributes(dialog, "SIZE=140, TITLE=IupRadio, RESIZE=NO, MINBOX=NO, MAXBOX=NO");

  IupShow(dialog);
  IupMainLoop();
  IupDestroy(dialog);
  IupClose();

  return 0; 
}
Exemple #13
0
int main(int argc, char **argv)
{
  Ihandle *dlg, *bt, *dbox, *lbl, *ml, *hbox, *bt2, *txt;
  IupOpen(&argc, &argv);

  bt = IupButton("Detache Me!", NULL);
  IupSetCallback(bt, "ACTION", (Icallback)btn_detach_cb);
  IupSetHandle("detach", bt);

  ml = IupMultiLine(NULL);
  IupSetAttribute(ml, "EXPAND", "YES");
  IupSetAttribute(ml, "VISIBLELINES", "5");

  hbox = IupHbox(bt, ml, NULL);
  IupSetAttribute(hbox, "MARGIN", "10x0");

  dbox = IupDetachBox(hbox);
  IupSetAttribute(dbox, "ORIENTATION", "VERTICAL");
  //IupSetAttribute(dbox, "SHOWGRIP", "NO");
  //IupSetAttribute(dbox, "BARSIZE", "0");
  //IupSetAttribute(dbox, "COLOR", "255 0 0");
  IupSetCallback(dbox, "DETACHED_CB", (Icallback)detached_cb);
  IupSetHandle("dbox", dbox);

  lbl = IupLabel("Label");
  IupSetAttribute(lbl, "EXPAND", "VERTICAL");

  bt2 = IupButton("Restore me!", NULL);
  IupSetAttribute(bt2, "EXPAND", "YES");
  IupSetAttribute(bt2, "ACTIVE", "NO");
  IupSetCallback(bt2, "ACTION", (Icallback)btn_restore_cb);
  IupSetHandle("restore", bt2);

  txt = IupText(NULL);
  IupSetAttribute(txt, "EXPAND", "HORIZONTAL");

  dlg = IupDialog(IupVbox(dbox, lbl, bt2, txt, NULL));
  IupSetAttribute(dlg, "TITLE", "IupDetachBox Example");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "10");
  IupSetAttribute(dlg, "RASTERSIZE", "300x300");

  IupShow(dlg);

  IupMainLoop();
  IupClose();
  return EXIT_SUCCESS;
}
Exemple #14
0
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);

  // CreateMainDialog();

  LongProcessing();

  IupMainLoop();

  counter_release();

  IupClose();

  return EXIT_SUCCESS;
}
Exemple #15
0
int main()
{
  IupOpen();

  Ihandle * dlg = createdialog();
//  createdialog();
//  createdialog();

  IupMainLoop();

  IupDestroy(dlg);

  IupClose();

  return 0;
}
Exemple #16
0
/* Main program */
int main(int argc, char **argv)
{
  Ihandle* dlg;
  Ihandle *tree1, *tree2;
  
  IupOpen(&argc, &argv);                  /* IUP initialization */

  IupSetGlobal("UTF8MODE", "Yes");

  tree1 = IupTree();
  IupSetHandle("tree1", tree1);
  
  tree2 = IupTree();
  IupSetHandle("tree2", tree2);

  //Generic DND
  //IupSetAttribute(tree1, "SHOWDRAGDROP", "YES");
  //IupSetAttribute(tree1, "DRAGTYPES", "TEXT,STRING");
  //Tree2Tree DND
  IupSetAttribute(tree1, "DRAGDROPTREE", "YES");
  //Common DND Attrib
  IupSetAttribute(tree1, "DRAGSOURCE", "YES");
  IupSetAttribute(tree1, "DRAGSOURCEMOVE", "YES");
  IupSetAttribute(tree1, "DRAGTYPES", "TREEBRANCH");

  //Generic DND
  //IupSetAttribute(tree2, "SHOWDRAGDROP", "YES");
  //IupSetAttribute(tree2, "DROPTYPES", "TEXT,STRING");  
  //Tree2Tree DND
  IupSetAttribute(tree2, "DRAGDROPTREE", "YES");
  //Common DND Attrib
  IupSetAttribute(tree2, "DROPTARGET", "YES");
  IupSetAttribute(tree2, "DROPTYPES", "TREEBRANCH");  
  
  init_dlg();                             /* Initializes the dialog */
  dlg = IupGetHandle("dlg");              /* Retrieves the dialog handle */
  IupShowXY(dlg, IUP_CENTER, IUP_CENTER); /* Displays the dialog */

  init_tree1_atributes();                 /* Initializes attributes, can be done here or anywhere */
  init_tree2_atributes();                 /* Initializes attributes, can be done here or anywhere */

  IupMainLoop();                          /* Main loop */
  IupClose();                             /* Ends IUP */

  return EXIT_SUCCESS;

}
Exemple #17
0
int main(int argc, char **argv)
{
  Ihandle *dlg;
  IupOpen(&argc, &argv);       
  IupMatrixOpen();

  matrixHandle = create_mat();
  IupSetAttribute(matrixHandle, IUP_CLICK_CB, "CLICK_ACTION");
  IupSetFunction("CLICK_ACTION", (Icallback)matrixClickCallback);

  dlg = IupDialog(matrixHandle);

  IupShowXY (dlg,IUP_CENTER,IUP_CENTER) ;
  IupMainLoop () ;
  IupClose () ;  
  return 0 ;
}
Exemple #18
0
int main(int argc, char* argv[]) 
{
  /* IUP initialization */
  IupOpen();
  IupGLCanvasOpen();

  /* Create and show the main dialog */
  mainDialogCreate();

  /* IUP event loop */
  IupMainLoop();

  /* IUP closing */
  IupClose();

  return 0;
}
Exemple #19
0
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);
  IupControlsOpen();

#ifdef USE_OPENGL
  IupGLCanvasOpen();
#endif

  PreDialogsTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
Exemple #20
0
int main(int argc, char **argv)
{
  Ihandle *dlg, *multitext, *vbox;
  Ihandle *file_menu, *item_exit, *item_open, *item_saveas;
  Ihandle *sub1_menu, *menu;

  IupOpen(&argc, &argv);

  multitext = IupText(NULL);
  IupSetAttribute(multitext, "MULTILINE", "YES");
  IupSetAttribute(multitext, "EXPAND", "YES");

  item_open = IupItem("Open", NULL);
  item_saveas = IupItem("Save As", NULL);
  item_exit = IupItem("Exit", NULL);
  IupSetCallback(item_exit, "ACTION", (Icallback)exit_cb);

  file_menu = IupMenu(
    item_open,
    item_saveas,
    IupSeparator(),
    item_exit,
    NULL);

  sub1_menu = IupSubmenu("File", file_menu);

  menu = IupMenu(sub1_menu, NULL);

  vbox = IupVbox(
    multitext,
    NULL);

  dlg = IupDialog(vbox);
  IupSetAttributeHandle(dlg, "MENU", menu);
  IupSetAttribute(dlg, "TITLE", "Simple Notepad");
  IupSetAttribute(dlg, "SIZE", "QUARTERxQUARTER");

  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
  IupSetAttribute(dlg, "USERSIZE", NULL);

  IupMainLoop();

  IupClose();
  return EXIT_SUCCESS;
}
Exemple #21
0
int main(int argc, char* argv[])
{
//  IupOpen(&argc, &argv);
IupOpen(NULL, NULL);
  create_images();

  new_dialog(0, "IupDialog as a main window,\n"
                "all decorations.\n"
                "rastersize+centered.");

  IupMainLoop();

  destroy_images();

  IupClose();

  return 0;
}
Exemple #22
0
int main( int argc, char **argv )
{
    //Inicializa IUP.
    IupOpen( &argc, &argv );

    //Abre o canvas OpenGL.
    IupGLCanvasOpen( );

    //Instancia a janela.
    Window *window = new Window( );

    //Exibe a Janela.
    window->show( );

    IupMainLoop( );
    delete window;
    IupClose( );
    return EXIT_SUCCESS;
}
Exemple #23
0
int main(int argc, char **argv)
{
  Ihandle* txt, *bt;
  IupOpen(&argc, &argv);
  IupOleControlOpen();

  // Creates an instance of the WebBrowser control
  Ihandle* control = IupOleControl("Shell.Explorer.2");

  // Sets production mode
  IupSetAttribute(control, "DESIGNMODE", "NO");

  // Creates a dialog containing the OLE control
  Ihandle* dlg = IupDialog(IupVbox(IupHbox(txt = IupText(""), bt = IupButton("Load", NULL), NULL), control, NULL));
  IupSetAttribute(dlg, "TITLE", "IupOle");
  IupSetAttribute(dlg, "MY_TEXT", (char*)txt);
  IupSetAttribute(txt, "EXPAND", "HORIZONTAL");
  IupSetCallback(bt, "ACTION", (Icallback)load_cb);

  // Maps the dialog to force the creation of the control
  IupMap(dlg);

  // Gathers the IUnknown pointer to access the control's interface

  IUnknown* punk = (IUnknown*) IupGetAttribute(control, "IUNKNOWN");
  IWebBrowser2 *pweb = NULL;
  punk->QueryInterface(IID_IWebBrowser2, (void **)&pweb);
  punk->Release();
  IupSetAttribute(dlg, "MY_WEB", (char*)pweb);

  // Shows dialog
  IupShow(dlg);

  IupMainLoop();

  // Releases the control interface
  pweb->Release();

  IupClose();

  return EXIT_SUCCESS;

}
Exemple #24
0
/* Main program */
int main(int argc, char **argv)
{
  Ihandle *dlg;
  IupOpen(&argc, &argv);       
  IupControlsOpen();
 
  IupSetFunction("removeline", (Icallback)removeline);
  IupSetFunction("addline", (Icallback)addline);
  IupSetFunction("removecol", (Icallback)removecol);
  IupSetFunction("addcol", (Icallback)addcol);
  IupSetFunction("redraw", (Icallback)redraw);

  createmenu();
  
  dlg = IupDialog(
          IupTabs(
            IupSetAttributes(
              IupVbox((create_mat()), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"), 
                NULL), "MARGIN=10x10, GAP=10, TABTITLE=Test1"),
            IupSetAttributes(
              IupVbox(IupFrame(create_mat()), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"), 
//                NULL), "BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2,FONT=HELVETICA_ITALIC_14"), 
                NULL), "FONT=HELVETICA_NORMAL_12, BGCOLOR=\"0 255 255\", MARGIN=10x10, GAP=10, TABTITLE=Test2"), 
            NULL)); 
  IupSetAttribute(dlg,IUP_TITLE, "IupMatrix");
  IupSetAttribute(dlg,IUP_MENU, "mymenu");
//  IupSetAttribute(dlg,"BGCOLOR", "255 0 255");

  //IupSetAttribute(dlg,"COMPOSITED", "YES");
  //IupSetAttribute(dlg,"LAYERED", "YES");
  //IupSetAttribute(dlg,"LAYERALPHA", "192");

  IupShowXY(dlg,IUP_CENTER,IUP_CENTER) ;
  IupMainLoop();

  iupmaskMatRemove(IupGetHandle("mat1"), 2, 1) ;
  iupmaskMatRemove(IupGetHandle("mat2"), 2, 1) ;
  IupDestroy(dlg);

  IupControlsClose();
  IupClose();  
  return 0;
}
Exemple #25
0
int main(int argc, char **argv)
{
  Ihandle *text, *dg;

  IupOpen(&argc, &argv);

  text = IupText("");
  IupSetAttribute(text, "MASK", "/d*");

  IupSetAttribute(text, "SIZE",   "100x");
  IupSetAttribute(text, "EXPAND", "HORIZONTAL");

  dg = IupDialog(text);
  IupSetAttribute(dg, "TITLE", "IupText MASK");

  IupShow(dg);
  IupMainLoop();
  IupClose();
  return EXIT_SUCCESS;
}
Exemple #26
0
/* Main program */
int main(int argc, char **argv) 
{
   Ihandle* dlg = NULL;
   Ihandle* cells = NULL;

   IupOpen(&argc, &argv);
   IupControlsOpen();

   cells = create();
   dlg = IupDialog(cells);

   IupSetAttribute(dlg,"RASTERSIZE","440x480");
   IupSetAttribute(dlg,"TITLE","IupCells");

   IupShowXY(dlg,IUP_CENTER,IUP_CENTER);
   IupMainLoop();
   IupClose();
   return EXIT_SUCCESS;

}
Exemple #27
0
void main(int argc, char **argv)
{
  Ihandle *dlg, *ml;

  IupOpen(&argc, &argv);

  ml = IupMultiLine(NULL);
  IupSetCallback(ml, "ACTION", (Icallback)mlaction);
  IupSetAttribute(ml, IUP_EXPAND, IUP_YES);
  IupSetAttribute(ml, IUP_VALUE,  "I ignore the DEL key!");
  IupSetAttribute(ml, IUP_BORDER, IUP_YES);

  dlg = IupDialog(ml);
  IupSetAttribute(dlg, IUP_TITLE, "IupMultiline");
  IupSetAttribute(dlg, IUP_SIZE,  "QUARTERxQUARTER");

  IupShow(dlg);
  IupMainLoop();
  IupDestroy(dlg);
  IupClose();
}
Exemple #28
0
/* Main program */
int main(int argc, char **argv)
{
    Ihandle* dlg, *cells, *box;

    IupOpen(&argc, &argv);
    IupControlsOpen();

    cells = create();
    box = IupVbox(cells, NULL);
    IupSetAttribute(box,"MARGIN","10x10");

    dlg = IupDialog(box);

    IupSetAttribute(dlg,"TITLE","IupCells");
    IupSetAttribute(dlg, "RASTERSIZE","350x250");
    IupShowXY(dlg,IUP_CENTER,IUP_CENTER);
    IupMainLoop();
    IupClose();
    return EXIT_SUCCESS;

}
Exemple #29
0
/* main program */
int main(int argc, char **argv)
{
  char *error=NULL;
  
  /* IUP initialization */
  IupOpen(&argc, &argv);       
  IupControlsOpen () ;

  /* loads LED */
  if(error = IupLoad("iupgauge.led"))
  {
    IupMessage("LED error", error);
    return 1 ;
  }

  dlg = IupGetHandle("dialog_name");
  gauge = IupGetHandle("gauge_name");

  /* sets callbacks */
  IupSetFunction( "acao_pausa", (Icallback) pausa_cb );
  IupSetFunction( "acao_inicio", (Icallback) inicio_cb );
  IupSetFunction( "acao_acelera", (Icallback) acelera_cb );
  IupSetFunction( "acao_freia", (Icallback) freia_cb );
  IupSetFunction( "acao_exibe", (Icallback) exibe_cb );
  IupSetFunction( "IDLE_ACTION", (Icallback) idle_cb);
  
  /* shows dialog */
  IupShowXY(dlg,IUP_CENTER,IUP_CENTER);

  /* main loop */
  IupMainLoop();

  IupDestroy(dlg);

  /* ends IUP */
  IupControlsClose() ;
  IupClose();

  return 0 ;
}
Exemple #30
0
int main(int argc, char* argv[])
{
  int i, count = sizeof(test_list)/sizeof(TestItems);
  char str[50];
  Ihandle *dlg, *list;

  IupOpen(&argc, &argv);
  IupControlsOpen();

//  IupSetGlobal("UTF8MODE", "Yes");
//  IupSetGlobal("LANGUAGE", "PORTUGUESE");
//  IupSetGlobal("DEFAULTDECIMALSYMBOL", ".");
  //  setlocale(LC_NUMERIC, "C");

  dlg = IupDialog(IupVbox(list = IupList(NULL), NULL));
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "TITLE", "IupTests");
  IupSetCallback(dlg, "CLOSE_CB", close_cb);
//  IupSetAttribute(dlg, "ICON", "SIZE_ICON");
  IupSetHandle("BIGTEST", dlg);

  IupSetAttribute(list, "VISIBLELINES", "15");
  IupSetAttribute(list, "EXPAND", "YES");
  IupSetCallback(list, "DBLCLICK_CB", (Icallback)dblclick_cb);
  IupSetCallback(list, "K_CR", k_enter_cb);

  for (i=0; i<count; i++)
  {
    sprintf(str, "%d", i+1);
    IupSetAttribute(list, str, test_list[i].title);
  }

  IupShowXY(dlg, 100, IUP_CENTER);

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}