Esempio n. 1
0
static int GridBox(lua_State *L)
{
  Ihandle *ih = IupGridBox(NULL);
  iuplua_plugstate(L, ih);
  iuplua_pushihandle_raw(L, ih);
  return 1;
}
Esempio n. 2
0
			{"&About", (Icallback)_about, CONDITION_NONE},
			{NULL}
		}),
		NULL
	);

	//List of images
	list = IupList(NULL);
	IupSetAttributes(list, "EXPAND=VERTICAL, SHOWIMAGE=YES, MINSIZE=155x, VISIBLELINES=1");
	IupSetCallback(list, "ACTION", (Icallback)_render_image);

	//Image containers
	placeholder = IupImage(1,1,0);	//This is needed for some reason
	preview = IupLabel(NULL);
	IupSetAttributeHandle(preview, "IMAGE", placeholder);
	imgmod = IupGridBox(NULL);
	IupSetAttributes(imgmod, "GAPLIN=5, GAPCOL=5");

	//Horizontal box to contain all but the console
	Ihandle* hbox = IupHbox(
		list,
		IupSplit(
			IupVbox(
					IupSetAttributes(IupLabel("Scaled Image"),"ALIGNMENT=ACENTER, EXPAND=HORIZONTAL"),
					IupScrollBox(preview),
					NULL
			),
			IupVbox(
					IupSetAttributes(IupLabel("Resulting Map"),"ALIGNMENT=ACENTER, EXPAND=HORIZONTAL"),
					IupScrollBox(imgmod),
					NULL
Esempio n. 3
0
void GridBoxTest(void)
{
  Ihandle *dlg;
  Ihandle *fr1;
  Ihandle *gbox;

  fr1 = IupFrame
  (
    gbox = IupGridBox
    (
      IupSetAttributes(IupLabel(""), ""),
      IupSetAttributes(IupLabel("col1"), "FONTSTYLE=Bold"),
      IupSetAttributes(IupLabel("col2"), "FONTSTYLE=Bold"),

      IupSetAttributes(IupLabel("lin1"), "FONTSTYLE=Bold"),
      IupSetAttributes(IupLabel("lbl"), "XSIZE=50x12"),
      IupSetAttributes(IupButton("but", NULL), "XSIZE=50"),

      IupSetAttributes(IupLabel("lin2"), "FONTSTYLE=Bold"),
      IupSetAttributes(IupLabel("label"), "XSIZE=x12"),
      IupSetAttributes(IupButton("button", NULL), "XEXPAND=Horizontal"),

      IupSetAttributes(IupLabel("lin3"), "FONTSTYLE=Bold"),
      IupSetAttributes(IupLabel("label large"), "XSIZE=x12"),
      IupSetAttributes(IupButton("button large", NULL), ""),
      NULL
    )
  );
  
  IupSetAttribute(gbox, "SIZECOL", "2");
  IupSetAttribute(gbox, "SIZELIN", "3");
//  IupSetAttribute(gbox, "HOMOGENEOUSLIN", "Yes");
//  IupSetAttribute(gbox, "HOMOGENEOUSCOL", "Yes");
//  IupSetAttribute(gbox, "EXPANDCHILDREN", "HORIZONTAL");
//  IupSetAttribute(gbox, "NORMALIZESIZE", "BOTH");
//  IupSetAttribute(gbox, "NORMALIZESIZE", "HORIZONTAL");

  IupSetAttribute(gbox, "NUMDIV", "3");
//  IupSetAttribute(gbox, "NUMDIV", "2");

//  IupSetAttribute(gbox, "ORIENTATION", "VERTICAL");
//  IupSetAttribute(gbox, "SIZECOL", "3");
//  IupSetAttribute(gbox, "SIZELIN", "2");

//  IupSetAttribute(gbox, "SIZE", "70x");
//  IupSetAttribute(gbox, "NUMDIV", "AUTO");
//  IupSetAttribute(gbox, "NORMALIZESIZE", "BOTH");

  IupSetAttribute(gbox, "ALIGNMENTLIN", "ACENTER");
  IupSetAttribute(gbox, "MARGIN", "10x10");
  IupSetAttribute(gbox, "GAPLIN", "5");
  IupSetAttribute(gbox, "GAPCOL", "5");

  dlg = IupDialog
  (
    IupHbox
    (
      fr1,
      NULL
    )
  );

  IupSetAttribute(dlg, "TITLE", "IupGridBox Test");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(fr1, "MARGIN", "0x0");   /* avoid attribute propagation */

  /* Shows dlg in the center of the screen */
  IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
}