Ejemplo n.º 1
0
static void init_tree_nodes(void)  
{
  Ihandle* tree = IupGetHandle("tree");

//  IupSetAttribute(tree, "AUTOREDRAW", "No");
#if 0
  /* create from bottom to top */
  /* the current node is the ROOT */
  //IupSetAttribute(tree, "VALUE", "0");
  IupSetAttribute(tree, "TITLE",         "Figures");  /* title of the root, id=0 */
  IupSetAttribute(tree, "ADDBRANCH",    "3D");    /* 3D=1 */
  IupSetAttribute(tree, "ADDLEAF",    "2D");    /* add to the root, so it will be before "3D", now 2D=1, 3D=2 */
  IupSetAttribute(tree, "ADDBRANCH",   "parallelogram"); /* id=1 */ 
  IupSetAttribute(tree, "ADDLEAF1",     "diamond");
  IupSetAttribute(tree, "ADDLEAF1",     "square");
  IupSetAttribute(tree, "ADDBRANCH",   "triangle");       
  IupSetAttribute(tree, "ADDLEAF1",     "scalenus");
  IupSetAttribute(tree, "ADDLEAF1",     "isoceles");
  IupSetAttribute(tree, "ADDLEAF1",     "equilateral");
  IupSetAttribute(tree, "ADDLEAF",      "Other (чущ)");
#else
  /* create from top to bottom */
  IupSetAttribute(tree, "TITLE0",         "Figures");  
  IupSetAttribute(tree, "ADDLEAF0",      "Other");     /* new id=1 */
  IupSetAttribute(tree, "ADDBRANCH1",   "triangle");  /* new id=2 */     
  IupSetAttribute(tree, "ADDLEAF2",     "equilateral");  /* ... */
  IupSetAttribute(tree, "ADDLEAF3",     "isoceles");
  IupSetAttribute(tree, "ADDLEAF4",     "scalenus");
  IupSetAttribute(tree, "STATE2",     "collapsed");
  IupSetAttribute(tree, "INSERTBRANCH2","parallelogram");  /* same depth as id=2, new id=6 */
  IupSetAttribute(tree, "ADDLEAF6",     "square");
  IupSetAttribute(tree, "ADDLEAF7",     "diamond");
  IupSetAttribute(tree, "INSERTLEAF6","2D");  /* new id=9 */
  IupSetAttribute(tree, "INSERTBRANCH9","3D");
#endif
  IupSetAttribute(tree, "TOGGLEVALUE2", "ON");
  IupSetAttribute(tree, "TOGGLEVALUE6", "ON");
  IupSetAttribute(tree, "TOGGLEVALUE9", "NOTDEF");
  IupSetAttribute(tree, "TOGGLEVALUE2", "OFF");
//  IupSetAttribute(tree, "AUTOREDRAW", "Yes");

  IupSetAttribute(tree, "MARKED1", "Yes");
  IupSetAttribute(tree, "MARKED8", "Yes");
  IupSetAttribute(tree, "VALUE",        "6");

  IupSetAttribute(tree, "RASTERSIZE", NULL);   /* remove the minimum size limitation */
  IupSetAttribute(tree, "COLOR8", "92 92 255");
//  IupSetAttribute(tree, "TITLEFONT8", "Courier, 14");
  IupSetAttributeHandle(tree, "IMAGE8", load_image_LogoTecgraf());
  IupSetAttributeHandle(tree, "IMAGE7", load_image_TestImage());
  IupSetAttribute(tree, "IMAGE6", IupGetAttribute(tree, "IMAGE8"));
}
Ejemplo n.º 2
0
static Ihandle* CreateTabs(int tab)
{
  Ihandle *vboxA, *vboxB, *vboxG, *text, *button,
          *vboxC, *vboxD,*vboxE, *vboxF, *vboxH, *vboxI,
          *tabs;

  text = IupText(NULL);
  IupSetAttribute(text, "NAME", "ATEXT");
  button  = IupButton("Button EEEFOCUS", "cbChildButton");
  IupSetAttribute(button, "NAME", "EEEEEBUTTON");

//  if (tab)  // to test Tabs inside Tabs
  //  vboxA = IupVbox(CreateTabs(0), NULL);
//  else
    vboxA = IupFrame(IupVbox(IupFill(), IupLabel("Label AAA"), IupButton("Button AAA", "cbChildButton"), //NULL));
                     text, IupToggle("Button TTTT", "cbChildButton"), 
                     IupVal(NULL), IupSetAttributes(IupProgressBar(), "VALUE=0.5"), NULL));
  vboxB = IupFrame(IupVbox(IupLabel("Label BBB"), IupButton("Button BBB", "cbChildButton"), NULL));
  vboxC = IupFrame(IupVbox(IupLabel("Label CCC"), IupButton("Button CCC", "cbChildButton"), NULL));
  vboxD = IupFrame(IupVbox(IupLabel("Label DDD"), IupButton("Button DDD", "cbChildButton"), NULL));
  vboxE = IupVbox(IupFill(), IupLabel("Label EEE"), IupButton("Button EEE", "cbChildButton"), 
                  button, IupButton("Button EEE", "cbChildButton"), NULL);
  vboxF = IupVbox(IupLabel("Label FFF"), IupButton("Button FFF", "cbChildButton"), NULL);
  vboxG = IupVbox(IupLabel("Label GGG"), IupButton("Button GGG", "cbChildButton"), NULL);
  vboxH = IupVbox(IupLabel("Label HHH"), IupButton("Button HHH", "cbChildButton"), NULL);
  vboxI = IupVbox(IupLabel("Canvas"), IupCanvas(NULL), NULL);

  IupSetAttribute(vboxA, "TABTITLE", "A");
  IupSetAttributeHandle(vboxA, "TABIMAGE", load_image_LogoTecgraf());
//  IupSetAttribute(vboxB, "TABTITLE", "&BB");
  //  IupSetAttribute(vboxC, "TABTITLE", "CCC");
  IupStoreAttribute(vboxC, "TABIMAGE", IupGetAttribute(vboxA, "TABIMAGE"));
  IupSetAttribute(vboxD, "TABTITLE", "DDDD");
  IupSetAttribute(vboxE, "TABTITLE", "&EEEEE");
  IupSetAttribute(vboxF, "TABTITLE", "FFFFFF");
  IupSetAttribute(vboxG, "TABTITLE", "GGGGGGG");
  IupSetAttribute(vboxH, "TABTITLE", "HHHHHHHH");
  IupSetAttribute(vboxI, "TABTITLE", "Canvas");
  IupSetAttribute(vboxA, "TITLE", "TABS A");
  IupSetAttribute(vboxB, "TITLE", "TABS BB");
  IupSetAttribute(vboxC, "TITLE", "TABS CCC");
//  IupSetAttribute(vboxC, "ACTIVE", "NO");
  IupSetAttribute(vboxF, "TABSIZE", "100");
  IupSetAttribute(vboxI, "BGCOLOR", "32 192 32");

  tabs = IupTabs(vboxA, vboxB, vboxC, vboxD, vboxE, vboxF, vboxG, vboxH, vboxI, NULL);

  IupSetAttribute(tabs, "TABTITLE1", "&BB");

  //IupSetCallback(tabs, "TABCHANGE_CB", (Icallback)cbTabChange);
  IupSetCallback(tabs, "TABCHANGEPOS_CB", (Icallback)cbTabChangePos);
  IupSetCallback(tabs, "RIGHTCLICK_CB", (Icallback)cbTabRightButton);

  //IupSetAttributeHandle(tabs, "TABIMAGE1", load_image_LogoTecgraf());
  IupSetAttributeHandle(tabs, "TABIMAGE1", load_image_TestImage());

  IupSetAttribute(tabs, "TABVISIBLE2", "NO");

  // In Windows, must be set before map
//  IupSetAttribute(tabs, "MULTILINE", "YES");
//  IupSetAttribute(tabs, "TABTYPE", "LEFT");
//  IupSetAttribute(tabs, "TABTYPE", "RIGHT");
//  IupSetAttribute(tabs, "TABTYPE", "BOTTOM");
//  IupSetAttribute(tabs, "TABORIENTATION", "VERTICAL");

  IupSetAttribute(tabs, "SHOWCLOSE", "YES");
  
//  IupSetAttribute(tabs, "ALIGNMENT", "NW");
//  IupSetAttribute(tabs, "ALIGNMENT", "NORTH");
//  IupSetAttribute(tabs, "ALIGNMENT", "WEST");
//  IupSetAttribute(tabs, "ALIGNMENT", "EAST");
//  IupSetAttribute(tabs, "ALIGNMENT", "SOUTH");
//  IupSetAttribute(tabs, "ALIGNMENT", "SE");

//  IupSetAttribute(tabs, "BACKGROUND", "10 150 200");
//  IupSetAttribute(tabs, "BGCOLOR", "92 92 255");
//  IupSetAttribute(tabs, "FGCOLOR", "250 0 0");
//  IupSetAttribute(tabs, "FONT", "Helvetica, Italic 16");

  IupSetAttribute(tabs, "TIP", "IupTabs Tip");
//  IupSetAttribute(tabs, "TIPFONT", "SYSTEM");
//  IupSetAttribute(tabs, "TIPBGCOLOR", "255 128 128");
//  IupSetAttribute(tabs, "TIPFGCOLOR", "0 92 255");

//  IupSetAttribute(tabs, "EXPAND", "YES");
  IupSetAttribute(tabs, "MARGIN", "0x0");  /* for children */
  IupSetAttribute(tabs, "RASTERSIZE", "300x200");  /* initial size */
  
  // Windows Only  
  //IupSetAttribute(tabs, "TIPBALLOON", "YES");
  //IupSetAttribute(tabs, "TIPBALLOONTITLE", "Tip Title");
  //IupSetAttribute(tabs, "TIPBALLOONTITLEICON", "2");
  //IupSetAttribute(tabs, "TIPDELAY", "5000");

  //IupSetCallback(tabs, "K_ANY",        (Icallback)k_any);
  //IupSetCallback(tabs, "HELP_CB",      (Icallback)help_cb);

  //IupSetCallback(tabs, "GETFOCUS_CB",  (Icallback)getfocus_cb); 
  //IupSetCallback(tabs, "KILLFOCUS_CB", (Icallback)killfocus_cb);
  //IupSetCallback(tabs, "ENTERWINDOW_CB", (Icallback)enterwindow_cb);
  //IupSetCallback(tabs, "LEAVEWINDOW_CB", (Icallback)leavewindow_cb);

  return tabs;
}
Ejemplo n.º 3
0
static Ihandle* CreateTabs(int tab)
{
  Ihandle *vboxA, *vboxB, *vboxG, *text, *button,
          *vboxC, *vboxD,*vboxE, *vboxF, *vboxH, *vboxI,
          *tabs;

  text = IupText(NULL);
  IupSetAttribute(text, "NAME", "ATEXT");
  button  = IupButton("Button EEEFOCUS", "cbChildButton");
  IupSetAttribute(button, "NAME", "EEEEEBUTTON");

//  if (tab)  // to test Tabs inside Tabs
  //  vboxA = IupVbox(CreateTabs(0), NULL);
//  else
  vboxA = IupBackgroundBox(IupVbox(IupFill(), IupSetAttributes(IupLabel("Label AAA"), "EXPAND=HORIZONTAL"), IupButton("Button AAA", "cbChildButton"), //NULL));
                             text, IupToggle("Button TTTT", "cbChildButton"), 
                             IupVal(NULL), IupSetAttributes(IupProgressBar(), "VALUE=0.5"), NULL));
  vboxB = IupBackgroundBox(IupVbox(IupLabel("Label BBB"), IupButton("Button BBB", "cbChildButton"), NULL));
  vboxC = IupBackgroundBox(IupVbox(IupLabel("Label CCC"), IupButton("Button CCC", "cbChildButton"), NULL));
  vboxD = IupBackgroundBox(IupVbox(IupLabel("Label DDD"), IupButton("Button DDD", "cbChildButton"), NULL));
  vboxE = IupBackgroundBox(IupVbox(IupFill(), IupLabel("Label EEE"), IupButton("Button EEE", "cbChildButton"), 
                                   button, IupButton("Button EEE", "cbChildButton"), NULL));
  vboxF = IupBackgroundBox(IupVbox(IupLabel("Label FFF"), IupButton("Button FFF", "cbChildButton"), NULL));
  vboxG = IupBackgroundBox(IupVbox(IupLabel("Label GGG"), IupButton("Button GGG", "cbChildButton"), NULL));
  vboxH = IupBackgroundBox(IupVbox(IupLabel("Label HHH"), IupButton("Button HHH", "cbChildButton"), NULL));
  vboxI = IupBackgroundBox(IupVbox(IupLabel("Canvas"), IupCanvas(NULL), NULL));

  IupSetAttribute(vboxA, "TABTITLE", "Aj");
  IupSetAttributeHandle(vboxA, "TABIMAGE", load_image_LogoTecgraf());
//  IupSetAttribute(vboxB, "TABTITLE", "BB");
  //  IupSetAttribute(vboxC, "TABTITLE", "CCC");
  IupStoreAttribute(vboxC, "TABIMAGE", IupGetAttribute(vboxA, "TABIMAGE"));
  IupSetAttribute(vboxD, "TABTITLE", "DDDD");
  IupSetAttribute(vboxE, "TABTITLE", "EEEjj");
  IupSetAttribute(vboxF, "TABTITLE", "FFFFff");
  IupSetAttribute(vboxG, "TABTITLE", "GGGG ggg");
  IupSetAttribute(vboxH, "TABTITLE", "HHHHHHHH");
  IupSetAttribute(vboxI, "TABTITLE", "Canvas (зг)");
  IupSetAttribute(vboxA, "TITLE", "TABS A");
  IupSetAttribute(vboxB, "TITLE", "TABS BB");
  IupSetAttribute(vboxC, "TITLE", "TABS CCC");
//  IupSetAttribute(vboxC, "ACTIVE", "NO");
  IupSetAttribute(vboxF, "TABSIZE", "100");
  IupSetAttribute(vboxI, "BGCOLOR", "32 192 32");

  tabs = IupFlatTabs(vboxA, vboxB, vboxC, vboxD, vboxE, vboxF, vboxG, vboxH, vboxI, NULL);

  IupSetAttribute(tabs, "TABTITLE1", "BB");

  //IupSetCallback(tabs, "TABCHANGE_CB", (Icallback)cbTabChange);
  IupSetCallback(tabs, "TABCHANGEPOS_CB", (Icallback)cbTabChangePos);
  IupSetCallback(tabs, "RIGHTCLICK_CB", (Icallback)cbTabRightButton);

  //IupSetAttributeHandle(tabs, "TABIMAGE1", load_image_LogoTecgraf());
  IupSetAttributeHandle(tabs, "TABIMAGE1", load_image_TestImage());

  IupSetAttribute(tabs, "TABVISIBLE2", "NO");
  IupSetAttribute(tabs, "TABACTIVE3", "NO");
//  IupSetAttribute(tabs, "TABSHIGHCOLOR", "192 0 0");
  IupSetAttribute(tabs, "TABTIP4", "Tip Tab4");

  /* like Office 2016 */
  if (0)
  {
    IupSetAttribute(tabs, "FORECOLOR", "192 0 0");
    IupSetAttribute(tabs, "TABSBACKCOLOR", "192 0 0");
    IupSetAttribute(tabs, "HIGHCOLOR", "255 128 128");
    IupSetAttribute(tabs, "CLOSEHIGHCOLOR", "255 128 128");
    IupSetAttribute(tabs, "TABSFORECOLOR", "255 255 255");
    IupSetAttribute(tabs, "SHOWLINES", "NO");
  }
  
//  IupSetAttribute(tabs, "EXTRABUTTONS", "3");
//  IupSetAttribute(tabs, "EXTRATITLE1", "Button1");
//  IupSetAttribute(tabs, "EXTRATITLE2", "But2");
//  IupSetAttribute(tabs, "EXTRATIP2", "Tip But2");
  //  IupSetAttribute(tabs, "EXTRATITLE3", "3");
//  IupSetStrAttribute(tabs, "EXTRAIMAGE3", IupGetAttribute(tabs, "TABIMAGE1"));

//  IupSetAttribute(tabs, "EXPANDBUTTON", "Yes");

//  IupSetAttribute(tabs, "SHOWCLOSE", "yes");
//  IupSetAttribute(tabs, "TABSPADDING", "10x50");
//  IupSetAttribute(tabs, "TABSFONTSIZE", "36");
//  IupSetAttribute(tabs, "TABSTEXTORIENTATION", "90");

  IupSetAttribute(tabs, "TABFONTSTYLE4", "Bold");

//  IupSetAttribute(tabs, "BACKGROUND", "10 150 200");
//  IupSetAttribute(tabs, "BGCOLOR", "92 92 255");
//  IupSetAttribute(tabs, "FGCOLOR", "250 0 0");
//  IupSetAttribute(tabs, "FONT", "Helvetica, Italic 16");

  IupSetAttribute(tabs, "TIP", "IupFlatTabs Tip");
//  IupSetAttribute(tabs, "TIPFONT", "SYSTEM");
//  IupSetAttribute(tabs, "TIPBGCOLOR", "255 128 128");
//  IupSetAttribute(tabs, "TIPFGCOLOR", "0 92 255");

//  IupSetAttribute(tabs, "EXPAND", "YES");
  IupSetAttribute(tabs, "MARGIN", "0x0");  /* for children */
  IupSetAttribute(tabs, "RASTERSIZE", "500x200");  /* initial size */
  
  //IupSetCallback(tabs, "K_ANY",        (Icallback)k_any);
  //IupSetCallback(tabs, "HELP_CB",      (Icallback)help_cb);

  //IupSetCallback(tabs, "GETFOCUS_CB",  (Icallback)getfocus_cb); 
  //IupSetCallback(tabs, "KILLFOCUS_CB", (Icallback)killfocus_cb);
  //IupSetCallback(tabs, "ENTERWINDOW_CB", (Icallback)enterwindow_cb);
  //IupSetCallback(tabs, "LEAVEWINDOW_CB", (Icallback)leavewindow_cb);
  IupSetCallback(tabs, "EXTRABUTTON_CB", (Icallback)extrabutton_cb);

  return tabs;
}