Beispiel #1
0
Ihandle *create_mat(void)
{
  Ihandle *mat = IupMatrix(NULL); 
  
  IupSetAttribute(mat,"NUMCOL","5"); 
  IupSetAttribute(mat,"NUMLIN","10"); 
  
  IupSetAttribute(mat,"NUMCOL_VISIBLE","2");
  IupSetAttribute(mat,"NUMLIN_VISIBLE","3");
  
  IupSetAttribute(mat,"0:0","Inflation");
  IupSetAttribute(mat,"1:0","Medicine");
  IupSetAttribute(mat,"2:0","Food"); 
  IupSetAttribute(mat,"3:0","Energy"); 
  IupSetAttribute(mat,"0:1","January 2000"); 
  IupSetAttribute(mat,"0:2","February 2000"); 
  IupSetAttribute(mat,"1:1","5.6");
  IupSetAttribute(mat,"2:1","2.2");
  IupSetAttribute(mat,"3:1","7.2");
  IupSetAttribute(mat,"1:2","4.5");
  IupSetAttribute(mat,"2:2","8.1");
  IupSetAttribute(mat,"3:2","3.4");
//  IupSetAttribute(mat,"WIDTHDEF","34");
  IupSetAttribute(mat,"RESIZEMATRIX","YES");
//  IupSetAttribute(mat,"MARKMODE","CELL");
  IupSetAttribute(mat,"MARKMODE","LINCOL");
  IupSetAttribute(mat,"MULTIPLE","YES");
  IupSetAttribute(mat,"AREA","NOT_CONTINUOUS");

  return mat;
}
Beispiel #2
0
static int Matrix(lua_State *L)
{
  Ihandle *ih = IupMatrix(NULL);
  iuplua_plugstate(L, ih);
  iuplua_pushihandle_raw(L, ih);
  return 1;
}
Beispiel #3
0
Ihandle *create_mat(void)
{
  int i, j;
  Ihandle *mat = IupMatrix(NULL); 
  
  IupSetAttribute(mat,IUP_NUMCOL,"2"); 
  IupSetAttribute(mat,IUP_NUMLIN,"100"); 
  
  IupSetAttribute(mat,IUP_NUMCOL_VISIBLE,"2") ;
  IupSetAttribute(mat,IUP_NUMLIN_VISIBLE,"20") ;

  for(i = 0; i < 100; i++)
  {
    for(j = 0; j <= 2; j++)
    {
      char pos[10];
      char pos2[10];
      sprintf(pos, "%d:%d", i, j);
      strcpy(pos2, pos);
      IupStoreAttribute(mat, pos, pos2);
    }
  }

  IupSetAttribute(mat,"WIDTHDEF","34");

  return mat;
}
Beispiel #4
0
static Ihandle *create_mat(void)
{
  Ihandle *mat = IupMatrix(NULL); 
 
  IupSetAttribute(mat, "NUMCOL", "1"); 
  IupSetAttribute(mat, "NUMLIN", "3"); 
  IupSetAttribute(mat, "NUMCOL_VISIBLE", "1");
  IupSetAttribute(mat, "NUMLIN_VISIBLE", "3");
  IupSetAttribute(mat, "EXPAND", "NO");
  IupSetAttribute(mat, "SCROLLBAR", "NO");

  IupSetAttribute(mat, "0:0", "Inflation");
  IupSetAttribute(mat, "1:0", "Medicine ");
  IupSetAttribute(mat, "2:0", "Food"); 
  IupSetAttribute(mat, "3:0", "Energy"); 
  IupSetAttribute(mat, "0:1", "January 2000"); 
  IupSetAttribute(mat, "1:1", "5.6");
  IupSetAttribute(mat, "2:1", "2.2");
  IupSetAttribute(mat, "3:1", "7.2");

  IupSetAttribute(mat,"BGCOLOR","255 255 255");
  IupSetAttribute(mat,"BGCOLOR1:0","255 128 0");
  IupSetAttribute(mat,"BGCOLOR2:1","255 128 0");
  IupSetAttribute(mat,"FGCOLOR2:0","255 0 128");
  IupSetAttribute(mat,"FGCOLOR1:1","255 0 128");

  IupSetAttribute(mat,"CX","600");
  IupSetAttribute(mat,"CY","250");

  return mat;
}
Beispiel #5
0
static Ihandle* create_matrix(void)
{
  Ihandle* mat = IupMatrix(NULL); 
  
  IupSetAttribute(mat, "NUMCOL", "3"); 
  IupSetAttribute(mat, "NUMLIN", "3"); 
  
  IupSetAttribute(mat, "NUMCOL_VISIBLE", "3");
  IupSetAttribute(mat, "NUMLIN_VISIBLE", "3");
  
//  IupSetAttribute(mat, "HEIGHT0", "10");

//  IupSetAttribute(mat, "WIDTH2", "90");
//  IupSetAttribute(mat, "HEIGHT2", "30");
//  IupSetAttribute(mat, "WIDTHDEF", "34");
//  IupSetAttribute(mat,"RESIZEMATRIX", "YES");
  IupSetAttribute(mat,"SCROLLBAR", "NO");
  IupSetCallback(mat,"VALUE_CB",(Icallback)value_cb);
  IupSetCallback(mat,"VALUE_EDIT_CB",(Icallback)value_edit_cb);


  //IupSetAttribute(mat, "NUMCOL_VISIBLE_LAST", "YES");
  //IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES");
//  IupSetAttribute(mat, "WIDTHDEF", "15");

  return mat;
}
Beispiel #6
0
Ihandle *create_mat(void)
{
  Ihandle *mat = IupMatrix(NULL); 

  IupSetAttribute(mat,"NUMCOL","3"); 
  IupSetAttribute(mat,"NUMLIN","3"); 
  IupSetAttribute(mat,"NUMCOL_VISIBLE","3");
  IupSetAttribute(mat,"NUMLIN_VISIBLE","3");
  IupSetAttribute(mat,"WIDTH0", "0");
  IupSetAttribute(mat,"WIDTH1","100");
  IupSetAttribute(mat,"WIDTH3","70");
  
  IupSetAttribute(mat,"1:0","Medicine");
  IupSetAttribute(mat,"2:0","Food"); 
  IupSetAttribute(mat,"3:0","Energy"); 
  IupSetAttribute(mat,"1:1","5.6");
  IupSetAttribute(mat,"2:1","2.2");
  IupSetAttribute(mat,"3:1","7.2");
  IupSetAttribute(mat,"1:2","4.5");
  IupSetAttribute(mat,"2:2","8.1");
  IupSetAttribute(mat,"3:2","3.4");
  IupSetAttribute(mat,"READONLY","YES");
  IupSetAttribute(mat,"SCROLLBAR","VERTICAL");
  return mat;
}
Beispiel #7
0
static Ihandle* create_matrix(void)
{
  Ihandle* mat = IupMatrix(NULL); 
  
//  IupSetAttribute(mat, "NUMCOL", "15"); 
  IupSetAttribute(mat, "NUMLIN", "20"); 
  IupSetAttribute(mat, "NUMCOL", "8"); 
//  IupSetAttribute(mat, "NUMCOL", "2"); 
//  IupSetAttribute(mat, "NUMLIN", "3"); 
  
  IupSetAttribute(mat, "0:0", "Inflation");
  IupSetAttribute(mat, "1:0", "Medicine\nPharma");
  IupSetAttribute(mat, "2:0", "Food"); 
  IupSetAttribute(mat, "3:0", "Energy"); 
  IupSetAttribute(mat, "0:1", "January 2000"); 
  IupSetAttribute(mat, "0:2", "February 2000"); 
  IupSetAttribute(mat, "1:1", "5.6\n3.33");
  IupSetAttribute(mat, "2:1", "2.2");
  IupSetAttribute(mat, "3:2", "Very Very Very Very Very Large Text");
  IupSetAttribute(mat, "1:2", "4.5");
  IupSetAttribute(mat, "2:2", "8.1");
  IupSetAttribute(mat, "3:1", "3.4");
  IupSetAttribute(mat, "3:3", "Font Test");
//  IupSetAttribute(mat, "HEIGHT2", "30");
//  IupSetAttribute(mat, "WIDTH2", "190");
//  IupSetAttributeId(mat, "WIDTH", 2, "190");
  IupSetAttribute(mat,"SORTSIGN2","DOWN");
//  IupSetAttribute(mat, "WIDTHDEF", "34");
//  IupSetAttribute(mat,"MULTILINE", "YES");
//  IupSetAttribute(mat,"RESIZEMATRIX", "YES");
//  IupSetAttribute(mat,"HIDDENTEXTMARKS", "YES");
//  IupSetAttribute(mat,"USETITLESIZE", "YES");
  //IupSetAttribute(mat,"SCROLLBAR", "NO");
  //IupSetAttribute(mat, "BGCOLOR1:2", "255 92 255");
  //IupSetAttribute(mat, "BGCOLOR2:*", "92 92 255");
  //IupSetAttribute(mat, "BGCOLOR*:3", "255 92 92");
  //IupSetAttribute(mat, "FGCOLOR1:2", "255 0 0");
  //IupSetAttribute(mat, "FGCOLOR2:*", "0 128 0");
  //IupSetAttribute(mat, "FGCOLOR*:3", "0 0 255");
  IupSetAttribute(mat, "FONT3:3", "Helvetica, 24");
  //IupSetAttribute(mat, "FONT2:*", "Courier, 14");
  //IupSetAttribute(mat, "FONT*:3", "Times, Bold 14");
  //IupSetAttribute(mat, "ALIGNMENT2", "ARIGHT");
//  IupSetAttribute(mat, "ACTIVE", "NO");
  IupSetAttribute(mat, "EXPAND", "NO");
//  IupSetAttribute(mat, "ALIGNMENT", "ALEFT");

  IupSetAttribute(mat,"MARKMODE","CELL");
//  IupSetAttribute(mat,"MARKMODE","LIN");
//  IupSetAttribute(mat,"MARKMULTIPLE","NO");
  IupSetAttribute(mat,"MARKMULTIPLE","YES");
//  IupSetAttribute(mat,"MARKAREA","NOT_CONTINUOUS");
  IupSetAttribute(mat,"MARK2:2","YES");
  IupSetAttribute(mat,"MARK2:3","YES");
  IupSetAttribute(mat,"MARK3:3","YES");

  IupSetAttribute(mat,"FRAMEVERTCOLOR1:2","BGCOLOR");
  IupSetAttribute(mat,"FRAMEHORIZCOLOR1:2","0 0 255");
  IupSetAttribute(mat,"FRAMEHORIZCOLOR1:3","0 255 0");
  IupSetAttribute(mat,"FRAMEVERTCOLOR2:2","255 255 0");
  IupSetAttribute(mat,"FRAMEVERTCOLOR*:4","0 255 0");

//  IupSetAttribute(mat,"MARKMODE","LINCOL");

  //IupSetAttribute(mat, "NUMCOL_VISIBLE_LAST", "YES");
  //IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES");
//  IupSetAttribute(mat, "WIDTHDEF", "15");
  IupSetAttribute(mat, "20:8", "The End");
  IupSetAttribute(mat, "10:0", "Middle Line");
  IupSetAttribute(mat, "15:0", "Middle Line");
  IupSetAttribute(mat, "0:4", "Middle Column");
  IupSetAttribute(mat, "20:0", "Line Title Test");
  IupSetAttribute(mat, "0:8", "Column Title Test");
  IupSetAttribute(mat, "NUMCOL_VISIBLE", "3");
  IupSetAttribute(mat, "NUMLIN_VISIBLE", "3");
//  IupSetAttribute(mat,"EDITNEXT","COLCR");
//  IupSetAttribute(mat, "LIMITEXPAND", "Yes");
  IupSetAttribute(mat, "NUMCOL_NOSCROLL", "1");

  return mat;
}
Beispiel #8
0
static Ihandle *create_mat(int mati)
{
  Ihandle *mat = IupMatrix(NULL); 
  char name[30];

  sprintf(name, "mat%d", mati);

  IupSetHandle(name, mat);
  
  IupSetAttribute(mat,"NUMCOL","15"); 
  IupSetAttribute(mat,"NUMLIN","18"); 
  
  IupSetAttribute(mat,"NUMCOL_VISIBLE","5");
  IupSetAttribute(mat,"NUMLIN_VISIBLE","8");

//  IupSetAttribute(mat,"EXPAND", "NO");
//  IupSetAttribute(mat,"SCROLLBAR", "NO");
  IupSetAttribute(mat,"RESIZEMATRIX", "YES");

  IupSetAttribute(mat,"MARKMODE", "CELL");
//  IupSetAttribute(mat,"MARKMODE", "LINCOL");
  IupSetAttribute(mat,"MARKMULTIPLE", "YES");
//  IupSetAttribute(mat,"MARKAREA", "NOT_CONTINUOUS");
 IupSetAttribute(mat, "MARKAREA", "CONTINUOUS");

  IupSetAttribute(mat,"0:0","Inflation");
  IupSetAttribute(mat,"1:0","Medicine ");
  IupSetAttribute(mat,"2:0","Food"); 
  IupSetAttribute(mat,"3:0","Energy"); 
  IupSetAttribute(mat,"0:1","January 2000"); 
  IupSetAttribute(mat,"0:2","February 2000"); 
  IupSetAttribute(mat,"1:1","5.6");
  IupSetAttribute(mat,"2:1","2.2");
  IupSetAttribute(mat,"3:1","7.2");
  IupSetAttribute(mat,"1:2","4.5");
  IupSetAttribute(mat,"2:2","8.1");
  IupSetAttribute(mat,"3:2","3.4 (RO)");

//  IupSetAttribute(mat,"BGCOLOR1:*","255 128 0");
  IupSetAttribute(mat,"BGCOLOR2:1","255 128 0");
  IupSetAttribute(mat,"FGCOLOR2:0","255 0 128");
//  IupSetAttribute(mat,"BGCOLOR0:*","255 0 128");
  IupSetAttribute(mat,"FGCOLOR1:1","255 0 128");
  IupSetAttribute(mat,"BGCOLOR3:*","255 128 0");
  IupSetAttribute(mat,"BGCOLOR*:4","255 128 0");
  //IupSetAttribute(mat,"FONT2:*", "Times:BOLD:8");
  //IupSetAttribute(mat,"FONT*:2", "Courier::12");
  IupSetAttribute(mat,"SORTSIGN1","UP");
//  IupSetAttribute(mat,"SORTSIGN2","DOWN");
  IupSetAttribute(mat,"FRAMEVERTCOLOR2:2","255 255 255");

//  IupSetAttribute(mat,"MARKAREA","NOT_CONTINUOUS");
//  IupSetAttribute(mat,"MARKMULTIPLE","YES");

  IupSetCallback(mat,"LEAVEITEM_CB",(Icallback)leave);
  IupSetCallback(mat,"ENTERITEM_CB",(Icallback)enter);
  IupSetCallback(mat,"DROPSELECT_CB",(Icallback)dropselect);
  IupSetCallback(mat,"DROP_CB",(Icallback)drop);
  IupSetCallback(mat,"DROPCHECK_CB",(Icallback)dropcheck);
  IupSetCallback(mat,"EDITION_CB",(Icallback)edition);
  IupSetCallback(mat,"CLICK_CB",(Icallback)click);
  IupSetCallback(mat,"DRAW_CB",(Icallback)drawcb);
  IupSetCallback(mat,"ACTION_CB",(Icallback)actioncb);

//  IupSetCallback(mat,"VALUE_CB",(Icallback)value);
//  IupSetAttribute(mat,"WIDTH0","24");
//  IupSetAttribute(mat,"HEIGHT0","8");

//  iupmaskMatSet(mat, IUPMASK_FLOAT, 0, 1, 2, 1) ;

  return mat;
}
Beispiel #9
0
static Ihandle* create_matrix(void)
{
  Ihandle* mat = IupMatrix(NULL); 
  int lin, col;
  
#ifdef BIG_MATRIX
  IupSetAttribute(mat, "NUMCOL", "20"); 
  IupSetAttribute(mat, "NUMLIN", "5000"); 
#else
  IupSetAttribute(mat, "NUMCOL", "3"); 
  IupSetAttribute(mat, "NUMLIN", "3"); 
#endif
  
  IupSetAttribute(mat, "NUMCOL_VISIBLE", "3");
  IupSetAttribute(mat, "NUMLIN_VISIBLE", "3");
  
//  IupSetAttribute(mat, "WIDTH2", "90");
//  IupSetAttribute(mat, "HEIGHT2", "30");
//  IupSetAttribute(mat, "WIDTHDEF", "34");
//  IupSetAttribute(mat,"RESIZEMATRIX", "YES");
  IupSetAttribute(mat,"SCROLLBAR", "YES");
  IupSetCallback(mat,"VALUE_CB",(Icallback)value_cb);
//  IupSetCallback(mat,"VALUE_EDIT_CB",(Icallback)value_edit_cb);
//  IupSetCallback(mat,"EDITION_CB",(Icallback)edition_cb);
  
//  IupSetCallback(mat, "DROPCHECK_CB", (Icallback)dropcheck_cb);
//  IupSetCallback(mat,"DROP_CB",(Icallback)drop);

#ifdef BIG_MATRIX
  IupSetAttribute(mat, "HEIGHT0", "10");
  IupSetAttribute(mat, "WIDTH0", "90");
#endif
//  IupSetAttribute(mat,"MARKMODE","LIN");
//  IupSetAttribute(mat,"MARKMULTIPLE","NO");
  IupSetAttribute(mat,"MARKMODE","CELL");
  IupSetAttribute(mat,"MARKMULTIPLE","YES");
//  IupSetAttribute(mat,"USETITLESIZE","YES");
//  IupSetAttribute(mat, "NUMCOL_NOSCROLL", "1");

//  IupSetAttribute(mat,"RASTERSIZE","x200");
//  IupSetAttribute(mat,"FITTOSIZE","LINES");

  //IupSetAttribute(mat, "NUMCOL_VISIBLE_LAST", "YES");
  //IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES");
//  IupSetAttribute(mat, "WIDTHDEF", "15");

  IupSetAttribute(mat,"FRAMEVERTCOLOR1:2","BGCOLOR");
  IupSetAttribute(mat,"FRAMEHORIZCOLOR2:1","BGCOLOR");
//  IupSetAttribute(mat,"FRAMEVERTCOLOR1:2","255 255 255");
//  IupSetAttribute(mat,"FRAMEHORIZCOLOR2:1","255 255 255");

#ifdef XXXBIG_MATRIX
  for (lin = 0; lin < 3000; lin++)
  {
    for (col = 0; col < 20; col++)
    {
      IupSetAttributeId2(mat,"BGCOLOR", lin, col, "192 192 192");
      IupSetAttributeId2(mat,"FGCOLOR", lin, col, "1 1 1");
    }
  }
#endif

  return mat;
}
Beispiel #10
0
void GLCanvasCubeTest(void)
{
  Ihandle *dlg, *canvas, *box, *gtoggle, *gtoggle1, *gtoggle2,
    *hbox, *vbox, *glabel, *gsep1, *gsep2, *gbutton1, *gbutton2,
    *pbar1, *pbar2, *glink, *gval1, *gval2, *gframe1, *gframe2,
    *gexp1, *gexp2, *image_open, *image_close, *image_high,
    *gframe3, *vbox2, *gtoggle3, *gtoggle4, *gtoggle5, *gsbox,
    *text, *vbox3, *matrix, *image_val;

  IupGLCanvasOpen();
  IupGLControlsOpen();
  IupControlsOpen();

  glabel = IupGLLabel("Label");
//  IupSetAttribute(glabel, "FGCOLOR", "255 255 255");
  IupSetAttribute(glabel, "FONT", "Helvetica, 24");
  IupSetAttributeHandle(glabel, "IMAGE", load_image_Tecgraf());

  gbutton1 = IupGLButton("Button");
  IupSetAttribute(gbutton1, "PADDING", "5x5");
  //IupSetAttribute(gbutton1, "BGCOLOR", "245 0 245 92");
  IupSetCallback(gbutton1, "ACTION", button_action_cb);
  IupSetAttribute(gbutton1, "NAME", "button1");
  IupSetAttribute(gbutton1, "TIP", "Button Tip");
  //  IupSetAttribute(gbutton1, "RASTERSIZE", "x100");

  if (0)
  {
    Ihandle* pressed_back = IupLoadImage("../test/pressed_back.png");
    Ihandle* enabled_back = IupLoadImage("../test/enabled_back.png");
    Ihandle* highlighted_back = IupLoadImage("../test/highlighted_back.png");

    IupSetAttributeHandle(gbutton1, "BACKIMAGE", enabled_back);
    IupSetAttributeHandle(gbutton1, "BACKIMAGEPRESS", pressed_back);
    IupSetAttributeHandle(gbutton1, "BACKIMAGEHIGHLIGHT", highlighted_back);
    IupSetAttribute(gbutton1, "BORDERCOLOR", "0 0 0 0");
  }

  gbutton2 = IupGLButton(NULL);
  IupSetAttribute(gbutton2, "PADDING", "5x5");
  IupSetAttributeHandle(gbutton2, "IMAGE", load_image_FileSave());
  IupSetCallback(gbutton2, "ACTION", button_action_cb);
  IupSetAttribute(gbutton2, "NAME", "button2");

  gtoggle = IupGLToggle("Toggle");
  IupSetAttribute(gtoggle, "PADDING", "5x5");
  IupSetCallback(gtoggle, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle, "NAME", "toggle");

  gtoggle1 = IupGLToggle(NULL);
  IupSetAttribute(gtoggle1, "PADDING", "5x5");
  IupSetAttributeHandle(gtoggle1, "IMAGE", load_image_Test());
  IupSetCallback(gtoggle1, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle1, "NAME", "toggle1");

  gtoggle2 = IupGLToggle(NULL);
  IupSetAttribute(gtoggle2, "PADDING", "5x5");
  IupSetAttributeHandle(gtoggle2, "IMAGE", load_image_Test());
  IupSetCallback(gtoggle2, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle2, "NAME", "toggle2");

  gsep1 = IupGLSeparator();

  glink = IupGLLink("http://www.tecgraf.puc-rio.br/iup", "IUP Toolkit");
  IupSetCallback(glink, "ACTION", (Icallback)link_action_cb);

  pbar1 = IupGLProgressBar();
  IupSetAttribute(pbar1, "VALUE", "0.3");
  IupSetAttribute(pbar1, "SHOWTEXT", "Yes");

  //image_val = IupLoadImage("../test/slider_handler.png");

  gval1 = IupGLVal();
  IupSetAttribute(gval1, "VALUE", "0.3");
  IupSetCallback(gval1, "VALUECHANGED_CB", val_action_cb);
  IupSetAttribute(gval1, "PROGRESSBAR", (char*)pbar1);
  IupSetAttribute(gval1, "NAME", "val1");
  IupSetAttribute(gval1, "TIP", "Val Tip");
  //IupSetAttributeHandle(gval1, "IMAGE", image_val);

  hbox = IupHbox(glabel, gsep1, gbutton1, gtoggle, glink, pbar1, gval1, NULL);
  IupSetAttribute(hbox, "ALIGNMENT", "ACENTER");
  IupSetAttribute(hbox, "MARGIN", "5x5");
  IupSetAttribute(hbox, "GAP", "5");

  pbar2 = IupGLProgressBar();
  IupSetAttribute(pbar2, "VALUE", "0.3");
  IupSetAttribute(pbar2, "ORIENTATION", "VERTICAL");

  gval2 = IupGLVal();
  IupSetAttribute(gval2, "VALUE", "0.3");
  IupSetAttribute(gval2, "ORIENTATION", "VERTICAL");
  IupSetCallback(gval2, "VALUECHANGED_CB", val_action_cb);
  IupSetAttribute(gval2, "PROGRESSBAR", (char*)pbar2);
  IupSetAttribute(gval2, "NAME", "val2");

  gsep2 = IupGLSeparator();
  IupSetAttribute(gsep2, "ORIENTATION", "HORIZONTAL");

  vbox = IupVbox(gbutton2, gsep2, 
    IupRadio(IupSetAttributes(IupVbox(gtoggle1, gtoggle2, NULL), "MARGIN=0x0")),
    pbar2,
    gval2,
    NULL);
  IupSetAttribute(vbox, "ALIGNMENT", "ACENTER");
  IupSetAttribute(vbox, "MARGIN", "5x5");
  IupSetAttribute(vbox, "GAP", "5");

  gtoggle5 = IupGLToggle("Toggle");
  IupSetAttribute(gtoggle5, "PADDING", "5x5");
  IupSetCallback(gtoggle5, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle5, "NAME", "toggle5");
  IupSetAttribute(gtoggle5, "CHECKMARK", "Yes");
//  IupSetAttribute(gtoggle5, "RIGHTBUTTON", "Yes");

  gtoggle3 = IupGLToggle("Radio Toggle");
  IupSetAttribute(gtoggle3, "PADDING", "5x5");
  IupSetCallback(gtoggle3, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle3, "NAME", "toggle3");
  IupSetAttribute(gtoggle3, "CHECKMARK", "Yes");

  gtoggle4 = IupGLToggle("Radio Toggle");
  IupSetAttribute(gtoggle4, "PADDING", "5x5");
  IupSetAttributeHandle(gtoggle4, "IMAGE", load_image_Test());
  IupSetCallback(gtoggle4, "ACTION", (Icallback)toggle_action_cb);
  IupSetAttribute(gtoggle4, "NAME", "toggle4");
  IupSetAttribute(gtoggle4, "CHECKMARK", "Yes");
//  IupSetAttribute(gtoggle4, "RIGHTBUTTON", "Yes");

  vbox2 = IupVbox(
    IupRadio(IupSetAttributes(IupVbox(gtoggle3, gtoggle4, NULL), "MARGIN=0x0")),
    gtoggle5,
    NULL);

  gsbox = IupSetAttributes(IupGLScrollBox(vbox2), "RASTERSIZE=90x90");
  gsbox = IupGLSizeBox(gsbox);

  gframe1 = IupSetAttributes(IupGLFrame(hbox), "TITLE=Frame1");
  gframe2 = IupSetAttributes(IupGLFrame(vbox), "BACKCOLOR=\"250 250 160 128\", FRAMECOLOR=\"250 250 160\"");
  gframe3 = IupSetAttributes(IupGLFrame(gsbox), "TITLE=Frame3, TITLEBOX=Yes");
//  IupSetAttributeHandle(gframe3, "TITLEBACKIMAGE", load_image_Tecgraf());

  gexp1 = IupSetAttributes(IupGLExpander(gframe1), "TITLE=Expander");
  gexp2 = IupSetAttributes(IupGLExpander(gframe2), "BARPOSITION=LEFT");

  text = IupText(NULL);
  IupSetAttribute(text, "VALUE", "Text");

  matrix = IupMatrix(NULL);
  IupSetAttribute(matrix, "NUMLIN", "3");
  IupSetAttribute(matrix, "NUMCOL", "2");
  IupSetAttribute(matrix, "NUMLIN_VISIBLE", "3");
  IupSetAttribute(matrix, "NUMCOL_VISIBLE", "2");
  IupSetAttribute(matrix, "0:0", "Inflation");
  IupSetAttribute(matrix, "1:0", "Medicine");
  IupSetAttribute(matrix, "2:0", "Food");
  IupSetAttribute(matrix, "3:0", "Energy");
  IupSetAttribute(matrix, "0:1", "January 2000");
  IupSetAttribute(matrix, "0:2", "February 2000");
  IupSetAttribute(matrix, "1:1", "5.6");
  IupSetAttribute(matrix, "2:1", "2.2");
  IupSetAttribute(matrix, "3:1", "4.1");
  IupSetAttribute(matrix, "1:2", "10");
  IupSetAttribute(matrix, "2:2", "1");
  IupSetAttribute(matrix, "3:2", "0.5");
//  IupSetAttribute(matrix, "EXPAND", "No");
  IupSetAttribute(matrix, "SCROLLBAR", "No");

  vbox3 = IupVbox(
    text,
    matrix,
    NULL);

  vbox3 = IupSetAttributes(IupGLFrame(vbox3), "TITLE=Frame4");

  canvas = IupGLCanvasBox(
    IupSetAttributes(gexp1, "HORIZONTALALIGN=ACENTER, VERTICALALIGN=ATOP, MOVEABLE=Yes, MOVETOTOP=Yes"),
    IupSetAttributes(gexp2, "HORIZONTALALIGN=ALEFT, VERTICALALIGN=ACENTER"),
    IupSetAttributes(gframe3, "MOVEABLE=Yes, POSITION=\"550,200\", MOVETOTOP=Yes"),
    IupSetAttributes(vbox3, "MOVEABLE=Yes, POSITION=\"250,350\""),
    NULL);
    
  IupSetAttribute(canvas, "DEPTH_SIZE", "16");

  image_open = IupImage(16, 16, img_open);
  image_close = IupImage(16, 16, img_close);
  image_high = IupImage(16, 16, img_close);
  IupSetAttribute(image_open, "0", "BGCOLOR");
  IupSetAttribute(image_open, "1", "192 192 192");
  IupSetAttribute(image_close, "0", "BGCOLOR");
  IupSetAttribute(image_close, "1", "192 192 192");
  IupSetAttribute(image_high, "1", "192 192 192");

  //  IupSetAttribute(gexp1, "BARSIZE", "50");
  //  IupSetAttributeHandle(gexp1, "IMAGE", image_close);
  //  IupSetAttributeHandle(gexp1, "IMOPEN", image_open);
  //  IupSetAttribute(gexp1, "IMAGE", "img1");
  IupSetCallback(gexp1, "ACTION", (Icallback)expand_cb);
  IupSetAttribute(gexp1, "EXTRABUTTONS", "3");
  IupSetCallback(gexp1, "EXTRABUTTON_CB", (Icallback)extrabutton_cb);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRA1", image_close);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS1", image_open);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT1", image_high);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRA2", image_close);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS2", image_open);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT2", image_high);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRA3", image_close);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAPRESS3", image_open);
  IupSetAttributeHandle(gexp1, "IMAGEEXTRAHIGHLIGHT3", image_high);
  //IupSetAttribute(gexp1, "REDRAWALL", "No");

  IupSetCallback(canvas, "ACTION", action);
  IupSetCallback(canvas, "BUTTON_CB", (Icallback)button_cb);
  IupSetCallback(canvas, "MOTION_CB", (Icallback)motion_cb);
  IupSetAttribute(canvas, "BUFFER", "DOUBLE");
  IupSetAttribute(canvas, "MARGIN", "10x10");

  box = IupVbox(canvas, NULL);
  IupSetAttribute(box, "MARGIN", "25x25");

  dlg = IupDialog(box);
  IupSetAttribute(dlg, "TITLE", "IupGLCanvas Test");
  IupSetAttribute(dlg, "RASTERSIZE", "800x600");

  IupMap(dlg);

  IupGLMakeCurrent(canvas);
  printf("Vendor: %s\n", glGetString(GL_VENDOR));
  printf("Renderer: %s\n", glGetString(GL_RENDERER));
  printf("Version: %s\n", glGetString(GL_VERSION));

  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
  IupSetAttribute(dlg, "RASTERSIZE", NULL);
}
Beispiel #11
0
static Ihandle* create_matrix(void)
{
  Ihandle* mat = IupMatrix(NULL); 
  
//  IupSetAttribute(mat, "NUMLIN", "3"); 
  IupSetAttribute(mat, "NUMLIN", "4"); 
  IupSetAttribute(mat, "NUMCOL", "8"); 
//  IupSetAttribute(mat, "NUMCOL", "15"); 
//  IupSetAttribute(mat, "NUMLIN", "3"); 
//  IupSetAttribute(mat, "NUMCOL", "2"); 
//  IupSetAttribute(mat, "NUMLIN", "8"); 
//  IupSetAttribute(mat, "NUMCOL", "5"); 
//  IupSetAttribute(mat, "ACTIVE", "NO");
//  IupSetAttribute(mat, "EDITHIDEONFOCUS", "NO");
//  IupSetAttribute(mat, "EDITALIGN", "Yes");
//  IupSetAttribute(mat, "EDITFITVALUE", "Yes");
//  IupSetAttribute(mat, "READONLY", "Yes");
  
  //IupSetAttribute(mat, "0:0", "Inflation");
  //IupSetAttribute(mat, "1:0", "Medicine\nPharma");
  //IupSetAttribute(mat, "2:0", "Food"); 
  //IupSetAttribute(mat, "3:0", "Energy"); 
  //IupSetAttribute(mat, "0:1", "January 2000"); 
  //IupSetAttribute(mat, "0:2", "February 2000"); 
  IupSetAttribute(mat, "1:1", "5.6\n3.33");
  IupSetAttribute(mat, "2:1", "2.2");
  IupSetAttribute(mat, "3:2", "Very Very Very Very Very Large Text");
  IupSetAttribute(mat, "1:2", "4.5");
  if (IupGetInt(NULL, "UTF8MODE"))
    IupSetAttribute(mat, "2:2", "(çãõáóé)");
  else
    IupSetAttribute(mat, "2:2", "(ηγυασι)");

  IupSetAttribute(mat, "3:1", "3.4");
  IupSetAttribute(mat, "3:3", "Font Test");
//  IupSetAttribute(mat, "HEIGHT2", "30");
//  IupSetAttribute(mat, "WIDTH2", "190");
//  IupSetAttributeId(mat, "WIDTH", 2, "190");
  IupSetAttribute(mat,"SORTSIGN2","DOWN");
//  IupSetAttribute(mat, "WIDTHDEF", "34");
//  IupSetAttribute(mat,"MULTILINE", "YES");
  IupSetAttribute(mat,"RESIZEMATRIX", "YES");
//  IupSetAttribute(mat,"HIDDENTEXTMARKS", "YES");
//  IupSetAttribute(mat,"USETITLESIZE", "YES");
  //IupSetAttribute(mat,"SCROLLBAR", "NO");
//  IupSetAttribute(mat, "SCROLLBAR", "HORIZONTAL");
  //IupSetAttribute(mat, "BGCOLOR1:2", "255 92 255");
  //IupSetAttribute(mat, "BGCOLOR2:*", "92 92 255");
  //IupSetAttribute(mat, "BGCOLOR*:3", "255 92 92");
  //IupSetAttribute(mat, "FGCOLOR1:2", "255 0 0");
  //IupSetAttribute(mat, "FGCOLOR2:*", "0 128 0");
  //IupSetAttribute(mat, "FGCOLOR*:3", "0 0 255");
  IupSetAttribute(mat, "FONT3:3", "Helvetica, 24");
  //IupSetAttribute(mat, "FONT2:*", "Courier, 14");
  //IupSetAttribute(mat, "FONT*:3", "Times, Bold 14");
//  IupSetAttribute(mat, "ALIGNMENT1", "ALEFT");
//  IupSetAttribute(mat, "ALIGNMENT3", "ARIGHT");
//  IupSetAttribute(mat, "ALIGN2:1", ":ARIGHT");
//  IupSetAttribute(mat, "LINEALIGNMENT1", "ATOP");
  //  IupSetAttribute(mat, "ACTIVE", "NO");
//  IupSetAttribute(mat, "EXPAND", "NO");
//  IupSetAttribute(mat, "ALIGNMENT", "ALEFT");

//  IupSetAttribute(mat, "MASK1:3", IUP_MASK_FLOAT);
//  IupSetAttribute(mat, "MASK1:3", "[a-zA-Z][0-9a-zA-Z_]*");
//  IupSetAttribute(mat, "MASKFLOAT1:3", "0.0:10.0");
  IupSetAttribute(mat, "MASK*:3", "[a-zA-Z][0-9a-zA-Z_]*");

  IupSetAttribute(mat, "TYPE4:1", "COLOR");
  IupSetAttribute(mat, "4:1", "255 0 128");

  IupSetAttribute(mat, "TYPE4:2", "FILL");
  IupSetAttribute(mat, "4:2", "60");
  IupSetAttribute(mat, "SHOWFILLVALUE", "Yes");

  {
    Ihandle* image = IupImageRGBA(TEST_IMAGE_SIZE, TEST_IMAGE_SIZE, image_data_32);
    IupSetAttribute(mat, "TYPE4:3", "IMAGE");
    IupSetAttributeHandle(mat, "4:3", image);
  }

//  IupSetAttribute(mat, "TOGGLEVALUE4:4", "ON");
//  IupSetAttribute(mat, "VALUE4:4", "1");
  IupSetAttribute(mat, "TOGGLECENTERED", "Yes");

  IupSetAttribute(mat,"MARKMODE","CELL");
//  IupSetAttribute(mat,"MARKMODE","LIN");
//  IupSetAttribute(mat,"MARKMULTIPLE","NO");
  IupSetAttribute(mat,"MARKMULTIPLE","YES");
//  IupSetAttribute(mat,"MARKAREA","NOT_CONTINUOUS");
//  IupSetAttribute(mat,"MARK2:2","YES");
//  IupSetAttribute(mat,"MARK2:3","YES");
//  IupSetAttribute(mat,"MARK3:3","YES");

  IupSetAttribute(mat,"FRAMEVERTCOLOR1:2","BGCOLOR");
  IupSetAttribute(mat,"FRAMEHORIZCOLOR1:2","0 0 255");
  IupSetAttribute(mat,"FRAMEHORIZCOLOR1:3","0 255 0");
  IupSetAttribute(mat,"FRAMEVERTCOLOR2:2","255 255 0");
  IupSetAttribute(mat,"FRAMEVERTCOLOR*:4","0 255 0");
  IupSetAttribute(mat,"FRAMEVERTCOLOR*:5","BGCOLOR");

//  IupSetAttribute(mat,"MARKMODE","LINCOL");

  //IupSetAttribute(mat, "NUMCOL_VISIBLE_LAST", "YES");
  //IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES");
//  IupSetAttribute(mat, "WIDTHDEF", "15");
  IupSetAttribute(mat, "20:8", "The End");
  //IupSetAttribute(mat, "10:0", "Middle Line");
  //IupSetAttribute(mat, "15:0", "Middle Line");
  //IupSetAttribute(mat, "0:4", "Middle Column");
  //IupSetAttribute(mat, "20:0", "Line Title Test");
  //IupSetAttribute(mat, "0:8", "Column Title Test");
  IupSetAttribute(mat, "NUMCOL_VISIBLE", "3");
  IupSetAttribute(mat, "NUMLIN_VISIBLE", "5");
//  IupSetAttribute(mat,"EDITNEXT","COLCR");
//  IupSetAttribute(mat, "NUMCOL_NOSCROLL", "1");

//  IupSetAttribute(mat, "LIMITEXPAND", "Yes");
//  IupSetAttribute(mat, "XAUTOHIDE", "NO");
//  IupSetAttribute(mat, "YAUTOHIDE", "NO");

//  IupSetAttribute(mat,"RASTERSIZE","x300");
//  IupSetAttribute(mat,"FITTOSIZE","LINES");
  
//  IupSetAttribute(mat,"TYPECOLORINACTIVE","No");
//  IupSetAttribute(mat, "ACTIVE", "No");

//  IupSetAttribute(mat, "FRAMEBORDER", "Yes");
//  IupSetAttribute(mat, "FLATSCROLLBAR", "Yes");
//  IupSetAttribute(mat, "SHOWFLOATING", "Yes");

  /* test for custom matrix attributes */
  //{
  //  char* v;
  //  IupSetAttribute(mat, "MTX_LINE_ACTIVE_FLAG3:4", "Test1");
  //  IupSetAttributeId2(mat, "MTX_LINE_ACTIVE_FLAG", 5, 7, "Test2");
  //  printf("Test1=%s\n", IupGetAttribute(mat, "MTX_LINE_ACTIVE_FLAG3:4"));
  //  printf("Test2=%s\n", IupGetAttributeId2(mat, "MTX_LINE_ACTIVE_FLAG", 5, 7));
  //}

  IupSetCallback(mat, "DROPCHECK_CB", (Icallback)dropcheck_cb);
  IupSetCallback(mat,"DROP_CB",(Icallback)drop);
//  IupSetCallback(mat,"MENUDROP_CB",(Icallback)drop);
//  IupSetCallback(mat, "MOUSEMOVE_CB", (Icallback)mousemove_cb);
//  IupSetCallback(mat,"CLICK_CB",(Icallback)click);
//  IupSetCallback(mat,"ENTERITEM_CB",(Icallback)enteritem_cb);
  IupSetCallback(mat,"TOGGLEVALUE_CB",(Icallback)togglevalue_cb);

  return mat;
}