diff options
Diffstat (limited to 'iup/test')
-rwxr-xr-x | iup/test/bigtest.c | 4 | ||||
-rwxr-xr-x | iup/test/button.c | 20 | ||||
-rwxr-xr-x | iup/test/canvas.c | 40 | ||||
-rwxr-xr-x | iup/test/config.mak | 42 | ||||
-rwxr-xr-x | iup/test/dialog.c | 2 | ||||
-rwxr-xr-x | iup/test/frame.c | 7 | ||||
-rwxr-xr-x | iup/test/getparam.c | 4 | ||||
-rwxr-xr-x | iup/test/glcanvas_cube.c | 2 | ||||
-rwxr-xr-x | iup/test/list.c | 15 | ||||
-rwxr-xr-x | iup/test/make_uname | 3 | ||||
-rwxr-xr-x | iup/test/matrix.c | 41 | ||||
-rwxr-xr-x | iup/test/matrix_cbmode.c | 66 | ||||
-rwxr-xr-x | iup/test/matrix_cbs.c | 2 | ||||
-rwxr-xr-x | iup/test/pplot.c | 9 | ||||
-rwxr-xr-x | iup/test/predialogs.c | 26 | ||||
-rwxr-xr-x | iup/test/sample.c | 24 | ||||
-rw-r--r-- | iup/test/split.c | 47 | ||||
-rwxr-xr-x | iup/test/tabs.c | 1 | ||||
-rwxr-xr-x | iup/test/tree.c | 109 | ||||
-rwxr-xr-x | iup/test/val.c | 6 | ||||
-rwxr-xr-x | iup/test/vbox.c | 12 | ||||
-rwxr-xr-x | iup/test/zbox.c | 5 |
22 files changed, 378 insertions, 109 deletions
diff --git a/iup/test/bigtest.c b/iup/test/bigtest.c index 713e752..84905e6 100755 --- a/iup/test/bigtest.c +++ b/iup/test/bigtest.c @@ -62,6 +62,7 @@ void ConfTest(void); void ZboxTest(void); void ScanfTest(void); void SboxTest(void); +void SplitTest(void); void ClipboardTest(void); void HelpTest(void) @@ -115,6 +116,7 @@ static TestItems test_list[] = { {"Progressbar", ProgressbarTest}, {"Sample", SampleTest}, {"Sbox", SboxTest}, + {"Split", SplitTest}, {"Scanf", ScanfTest}, {"Spin", SpinTest}, {"SysInfo", SysInfoTest}, @@ -164,8 +166,6 @@ int main(int argc, char* argv[]) IupOpen(&argc, &argv); IupControlsOpen(); -// IupOldValOpen(); -// IupOldTabsOpen(); dlg = IupDialog(IupVbox(list = IupList(NULL), NULL)); IupSetAttribute(dlg, "MARGIN", "10x10"); diff --git a/iup/test/button.c b/iup/test/button.c index da2906d..f04f082 100755 --- a/iup/test/button.c +++ b/iup/test/button.c @@ -346,13 +346,13 @@ void ButtonTest(void) // IupSetAttribute(button, "ALIGNMENT", "ALEFT:ATOP"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); // IupSetAttribute(button, "IMAGEPOSITION", "BOTTOM"); - IupSetAttribute(button, "PADDING", "5x5"); +// IupSetAttribute(button, "PADDING", "5x5"); // IupSetAttribute(button, "TITLE", "Text1"); - IupSetAttribute(button, "FONT", "Helvetica, 14"); +// IupSetAttribute(button, "FONT", "Helvetica, 14"); // IupSetAttribute(button, "IMAGE", "IUP_Tecgraf"); IupSetAttributeHandle(button, "IMAGE", image1); // IupSetAttributeHandle(button, "IMINACTIVE", image1i); -// IupSetAttributeHandle(button, "XXX__IMPRESS", image1p); + IupSetAttributeHandle(button, "IMPRESS", image1p); IupSetAttribute(button, "TIP", "Image Label"); IupSetAttribute(button, "NAME", "button4"); set_callbacks(button); @@ -360,13 +360,15 @@ void ButtonTest(void) button = IupButton(NULL, NULL); IupSetAttributeHandle(button, "IMAGE", image2); - IupSetAttribute(button, "TITLE", "Text2"); +// IupSetAttribute(button, "TITLE", "Text2"); // IupSetAttribute(button, "IMAGEPOSITION", "TOP"); // IupSetAttribute(button, "SPACING", "30"); // IupSetAttribute(button, "ALIGNMENT", "ALEFT"); // IupSetAttribute(button, "RASTERSIZE", "200x100"); IupSetAttribute(button, "FLAT", "YES"); - IupSetAttribute(button, "FOCUSONCLICK", "NO"); +// IupSetAttributeHandle(button, "IMPRESS", image2); +// IupSetAttribute(button, "FOCUSONCLICK", "NO"); +// IupSetAttribute(button, "RASTERSIZE", "15x15"); IupSetAttribute(button, "NAME", "button5"); set_callbacks(button); IupAppend(box2, button); @@ -382,12 +384,18 @@ void ButtonTest(void) label = IupLabel(NULL); IupSetAttribute(label, "SEPARATOR", "VERTICAL"); + IupSetHandle("teste1", label); + IupSetHandle("xxxx", label); + IupSetHandle("teste2", label); + IupSetHandle("yyy", label); + IupSetHandle("dasdasdas", label); + IupSetHandle("label", label); dlg = IupDialog(IupHbox(box1, label, box2, NULL)); IupSetAttribute(dlg, "TITLE", "IupButton Test"); // IupSetAttribute(box1, "BGCOLOR", "128 0 0"); // IupSetAttribute(dlg, "BGCOLOR", "0 128 0"); -// IupSetAttribute(dlg, "BACKGROUND", "0 0 128"); + IupSetAttribute(dlg, "BACKGROUND", "255 128 128"); // IupSetAttributeHandle(dlg, "BACKGROUND", image2); IupSetAttributeHandle(dlg, "STARTFOCUS", button); diff --git a/iup/test/canvas.c b/iup/test/canvas.c index d13945c..b01e5a6 100755 --- a/iup/test/canvas.c +++ b/iup/test/canvas.c @@ -58,19 +58,31 @@ static unsigned char pixmap_cursor [ ] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ; -//#define USE_GTK +//#define USE_GDK /* draw a rectangle that has w=600 always, white background and a red X */ -#ifdef USE_GTK +#ifdef USE_GDK #include <gtk/gtk.h> static void drawTest(Ihandle *ih, int posx) { GtkWidget* widget = (GtkWidget*)IupGetAttribute(ih, "WID"); - gdk_draw_arc (widget->window, - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], - TRUE, - 0, 0, widget->allocation.width, widget->allocation.height, - 0, 64 * 360); + GdkGC* gc = widget->style->fg_gc[GTK_WIDGET_STATE(widget)]; + int w, h; + GdkColor color; + + IupGetIntInt(ih, "DRAWSIZE", &w, &h); + + /* white background */ + color.red = 65535; color.green = 65535; color.blue = 65535; + gdk_gc_set_rgb_fg_color(gc, &color); + gdk_draw_rectangle(widget->window, gc, TRUE, 0, 0, w, h); + + /* red X */ + w = 600; /* virtual size */ + color.red = 65535; color.green = 0; color.blue = 0; + gdk_gc_set_rgb_fg_color(gc, &color); + gdk_draw_line(widget->window, gc, -posx, 0, w-posx, h); + gdk_draw_line(widget->window, gc, -posx, h, w-posx, 0); } #else #ifdef WIN32 @@ -232,6 +244,18 @@ static int wheel_cb(Ihandle *ih,float delta,int x,int y,char* status) static int motion_cb(Ihandle *ih,int x,int y,char* status) { printf("MOTION_CB(x=%d, y=%d [%s])\n",x,y, status); + + { + static int count=0; +#ifdef WIN32 + Sleep(1000); +#else + sleep(1); //or do anything that takes some time +#endif + count++; + printf("count(%d)\n",count); + } + return IUP_DEFAULT; } @@ -295,7 +319,7 @@ void CanvasTest(void) IupSetCallback(canvas, "MAP_CB", (Icallback)map_cb); IupSetCallback(canvas, "KEYPRESS_CB", (Icallback)keypress_cb); - IupSetCallback(canvas, "K_ANY", (Icallback)k_any); +// IupSetCallback(canvas, "K_ANY", (Icallback)k_any); IupSetCallback(canvas, "HELP_CB", (Icallback)help_cb); IupSetCallback(canvas, "GETFOCUS_CB", (Icallback)getfocus_cb); diff --git a/iup/test/config.mak b/iup/test/config.mak index 2764e6c..b97ae83 100755 --- a/iup/test/config.mak +++ b/iup/test/config.mak @@ -1,27 +1,38 @@ +PROJNAME = iup APPNAME = iuptest APPTYPE = CONSOLE -INCLUDES = ../include - -ifdef USE_GTK - ifndef GTK_DEFAULT - # Build GTK version in IRIX,SunOS,AIX,Win32 - APPNAME = iuptestgtk - endif -else - ifdef GTK_DEFAULT +ifdef GTK_DEFAULT + ifdef USE_MOTIF # Build Motif version in Linux,Darwin,FreeBSD - USE_MOTIF = Yes APPNAME = iuptestmot endif +else + ifdef USE_GTK + # Build GTK version in IRIX,SunOS,AIX,Win32 + APPNAME = iuptestgtk + endif +endif + +ifdef USE_GDK + APPNAME = iuptestgdk endif +INCLUDES = ../include + USE_IUP3 = Yes USE_STATIC = Yes IUP = .. -#TEC_UNAME_DIR = Win32.$(TEC_UNAME) -#DBG = Yes +ifdef DBG_DIR + IUPLIB = $(IUP)/lib/$(TEC_UNAME)d + CDLIB = $(CD)/lib/$(TEC_UNAME)d + IMLIB = $(IM)/lib/$(TEC_UNAME)d +else + IUPLIB = $(IUP)/lib/$(TEC_UNAME) + CDLIB = $(CD)/lib/$(TEC_UNAME) + IMLIB = $(IM)/lib/$(TEC_UNAME) +endif # Must uncomment all SRC lines DEFINES = BIG_TEST @@ -58,12 +69,13 @@ SRC += zbox.c SRC += scanf.c SRC += sbox.c SRC += clipboard.c +SRC += split.c #ifneq ($(findstring Win, $(TEC_SYSNAME)), ) # LIBS += iupimglib #else -# SLIB += $(IUP)/lib/$(TEC_UNAME)/libiupimglib.a +# SLIB += $(IUPLIB)/libiupimglib.a #endif USE_CD = Yes @@ -96,8 +108,8 @@ ifneq ($(findstring Win, $(TEC_SYSNAME)), ) # LIBS += cdpdflib # LDIR += $(IUP)/lib/$(TEC_UNAME) else - SLIB += $(IUP)/lib/$(TEC_UNAME)/libiup_pplot.a -# SLIB += $(CD)/lib/$(TEC_UNAME)/libcdpdflib.a + SLIB += $(IUPLIB)/libiup_pplot.a +# SLIB += $(CDLIB)/libcdpdflib.a endif ifneq ($(findstring Win, $(TEC_SYSNAME)), ) diff --git a/iup/test/dialog.c b/iup/test/dialog.c index f8097c9..334b1cc 100755 --- a/iup/test/dialog.c +++ b/iup/test/dialog.c @@ -338,7 +338,7 @@ static void new_dialog(int test, char* tip) // Windows and GTK Only IupSetCallback(dlg, "DROPFILES_CB", (Icallback)dropfiles_cb); - + if (test == 0 || test == 1) IupShow(dlg); else if (test == 3) diff --git a/iup/test/frame.c b/iup/test/frame.c index 2bcd128..5262c3f 100755 --- a/iup/test/frame.c +++ b/iup/test/frame.c @@ -29,11 +29,10 @@ void FrameTest(void) ); IupSetAttribute(frame1, "TITLE", "Title Text"); + IupSetAttribute(frame1, "MARGIN", "0x0"); // IupSetAttribute(frame1, "FGCOLOR", "255 0 0"); -// IupSetAttribute(frame1, "BGCOLOR", "0 128 0"); - IupSetAttribute(frame2, "SUNKEN", "YES"); +// IupSetAttribute(frame2, "SUNKEN", "YES"); - IupSetAttribute(frame1, "MARGIN", "0x0"); IupSetAttribute(frame2, "MARGIN", "0x0"); // IupSetAttribute(frame2, "BGCOLOR", "0 128 0"); dlg = IupDialog(IupHbox(frame1, frame2, NULL)); @@ -43,7 +42,7 @@ void FrameTest(void) IupSetAttribute(dlg, "GAP", "5"); IupSetAttribute(dlg, "FONTSIZE", "14"); // IupSetAttribute(dlg, "RASTERSIZE", "300x200"); -// IupSetAttribute(dlg, "BGCOLOR", "0 128 0"); +// IupSetAttribute(dlg, "BGCOLOR", "128 0 0"); IupShow(dlg); printf("RASTERSIZE(%s)\n", IupGetAttribute(frame1, "RASTERSIZE")); diff --git a/iup/test/getparam.c b/iup/test/getparam.c index fbda6bb..33937da 100755 --- a/iup/test/getparam.c +++ b/iup/test/getparam.c @@ -20,6 +20,9 @@ static int param_action(Ihandle* dialog, int param_index, void* user_data) case -3: printf("IupGetParam - Cancel\n"); break; + case -4: + printf("IupGetParam - Help\n"); + break; // case 1: // return 0; default: @@ -50,6 +53,7 @@ void GetParamTest(void) char file_name[500] = "test.jpg"; if (!IupGetParam("Title", param_action, 0, + "Bt %u[, MyCancel, Help!]\n" "Boolean: %b[No,Yes]\n" "Integer: %i\n" "Real 1: %r\n" diff --git a/iup/test/glcanvas_cube.c b/iup/test/glcanvas_cube.c index 3bd5ec5..da1244d 100755 --- a/iup/test/glcanvas_cube.c +++ b/iup/test/glcanvas_cube.c @@ -203,7 +203,7 @@ void GLCanvasCubeTest(void) dlg = IupDialog(IupSetAttributes(IupFrame(box), "TITLE=Teste")); IupSetAttribute(dlg, "TITLE", "IupGLCanvas Test"); - IupSetAttribute(dlg, "COMPOSITED", "NO"); +// IupSetAttribute(dlg, "COMPOSITED", "YES"); IupMap(dlg); diff --git a/iup/test/list.c b/iup/test/list.c index 5db582b..9555771 100755 --- a/iup/test/list.c +++ b/iup/test/list.c @@ -134,6 +134,14 @@ static int insertitem_cb(Ihandle *ih) return IUP_DEFAULT; } +static int setitem_cb(Ihandle *ih) +{ + Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST"); + Ihandle *text = IupGetDialogChild(ih, "text"); + IupSetAttribute(list, "3", IupGetAttribute(text, "VALUE")); + return IUP_DEFAULT; +} + static int appenditem_cb(Ihandle *ih) { Ihandle *list = (Ihandle*)IupGetAttribute(IupGetDialog(ih), "_ACTIVE_LIST"); @@ -257,13 +265,13 @@ void ListTest(void) IupSetAttributes(list1, "1=\"US$ 1000\", 2=\"US$ 2000\", 3=\"US$ 300.000.000\", 4=\"US$ 4000\"," "EDITBOX=YES, DROPDOWN=YES, TIP=Edit+Drop, VALUE=\"Edit Here\", NAME=list1"); IupSetAttributes(list2, "1=\"Banana\", 2=\"Apple\", 3=\"Orange\", 4=\"Strawberry\", 5=\"Grape\"," - "DROPDOWN=YES, NAME=list2, TIP=Drop, VALUE=2, SORT=YES"); + "DROPDOWN=YES, NAME=list2, TIP=Drop, VALUE=2, XXX_SORT=YES"); IupSetAttributes(list3, "1=\"Char A\", 2=\"Char B\", 3=\"Char CCCCC\", 4=\"Char D\", 5=\"Char E\", 6=\"Char F\"," - "EDITBOX=YES, NAME=list3, TIP=Edit+List, VALUE=\"Edit Here\""); + "XXX_EDITBOX=YES, NAME=list3, TIP=Edit+List, VALUE=\"Edit Here\""); // IupSetAttributes(list4, "1=\"Number 1\", 2=\"Number 2\", 3=\"Number 3\", 4=\"Number 4\", 5=\"Number 5\", 6=\"Number 6\", 7=\"Number 7\"," // "MULTIPLE=YES, NAME=list4, TIP=List, VALUE=+--++--"); IupSetAttributes(list4, "1=\"Number 3\", 2=\"Number 4\", 3=\"Number 2\", 4=\"Number 1\", 5=\"Number 6\", 6=\"Number 5\", 7=\"Number 7\"," - "MULTIPLE=YES, NAME=list4, TIP=List, SORT=YES, VALUE=+--++--"); + "MULTIPLE=YES, NAME=list4, TIP=List, XXX_SORT=YES, VALUE=+--++--"); set_callbacks(list1); set_callbacks(list2); @@ -312,6 +320,7 @@ void ListTest(void) IupSetCallbacks(IupButton("Get(COUNT)", NULL), "ACTION", getcount_cb, NULL), NULL); buttons2 = IupHbox( + IupSetCallbacks(IupButton("3", NULL), "ACTION", setitem_cb, NULL), IupSetCallbacks(IupButton("INSERTITEM3", NULL), "ACTION", insertitem_cb, NULL), IupSetCallbacks(IupButton("APPENDITEM", NULL), "ACTION", appenditem_cb, NULL), IupSetCallbacks(IupButton("REMOVEITEM", NULL), "ACTION", removeitem_cb, NULL), diff --git a/iup/test/make_uname b/iup/test/make_uname index ae0ab49..1df8629 100755 --- a/iup/test/make_uname +++ b/iup/test/make_uname @@ -1,4 +1,5 @@ #This builds all the libraries of the folder for 1 uname tecmake relink $1 $2 $3 $4 $5 $6 $7 -tecmake USE_GTK=Yes relink $1 $2 $3 $4 $5 $6 $7 +#tecmake USE_GTK=Yes USE_GDK=Yes relink $1 $2 $3 $4 $5 $6 $7 +tecmake USE_MOTIF=Yes relink $1 $2 $3 $4 $5 $6 $7 diff --git a/iup/test/matrix.c b/iup/test/matrix.c index 280ffdb..48aa474 100755 --- a/iup/test/matrix.c +++ b/iup/test/matrix.c @@ -6,6 +6,13 @@ #undef __IUPDEF_H #include "iup.h" #include "iupcontrols.h" +#include "iupcbs.h" + +static int mousemove_cb(Ihandle *ih, int lin, int col) +{ + printf("mousemove_cb(%d, %d)\n", lin, col); + return IUP_DEFAULT; +} static int dropcheck_cb(Ihandle *self, int lin, int col) { @@ -18,8 +25,9 @@ static Ihandle* create_matrix(void) { Ihandle* mat = IupMatrix(NULL); - IupSetAttribute(mat, "NUMCOL", "15"); +// IupSetAttribute(mat, "NUMCOL", "15"); IupSetAttribute(mat, "NUMLIN", "20"); + IupSetAttribute(mat, "NUMCOL", "8"); // IupSetAttribute(mat, "NUMCOL", "2"); // IupSetAttribute(mat, "NUMLIN", "3"); @@ -31,18 +39,19 @@ static Ihandle* create_matrix(void) IupSetAttribute(mat, "0:2", "February 2000"); IupSetAttribute(mat, "1:1", "5.6\n3.33"); IupSetAttribute(mat, "2:1", "2.2"); - IupSetAttribute(mat, "3:1", "7.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:2", "3.4"); + IupSetAttribute(mat, "3:1", "3.4"); IupSetAttribute(mat, "3:3", "Font Test"); - IupSetAttribute(mat, "WIDTH2", "90"); - IupSetAttribute(mat, "HEIGHT2", "30"); +// IupSetAttribute(mat, "WIDTH2", "90"); +// IupSetAttribute(mat, "HEIGHT2", "30"); IupSetAttribute(mat,"SORTSIGN2","DOWN"); // IupSetAttribute(mat, "WIDTHDEF", "34"); - IupSetAttribute(mat,"MULTILINE", "YES"); +// IupSetAttribute(mat,"MULTILINE", "YES"); IupSetAttribute(mat,"RESIZEMATRIX", "YES"); - IupSetAttribute(mat,"USETITLESIZE", "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"); @@ -55,6 +64,8 @@ static Ihandle* create_matrix(void) //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"); @@ -65,23 +76,27 @@ static Ihandle* create_matrix(void) 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,"MARKMODE","LINCOL"); //IupSetAttribute(mat, "NUMCOL_VISIBLE_LAST", "YES"); //IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES"); - IupSetAttribute(mat, "WIDTHDEF", "15"); - IupSetAttribute(mat, "20:15", "The End"); +// 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:7", "Middle Column"); - IupSetAttribute(mat, "0:11", "Middle Column"); + IupSetAttribute(mat, "0:4", "Middle Column"); IupSetAttribute(mat, "20:0", "Line Title Test"); - IupSetAttribute(mat, "0:15", "Column Title Test"); - IupSetAttribute(mat, "NUMCOL_VISIBLE", "6"); + IupSetAttribute(mat, "0:8", "Column Title Test"); + IupSetAttribute(mat, "NUMCOL_VISIBLE", "3"); IupSetAttribute(mat, "NUMLIN_VISIBLE", "8"); IupSetCallback(mat, "DROPCHECK_CB", (Icallback)dropcheck_cb); +// IupSetCallback(mat, "MOUSEMOVE_CB", (Icallback)mousemove_cb); return mat; } diff --git a/iup/test/matrix_cbmode.c b/iup/test/matrix_cbmode.c index 0d0e17c..99ac21f 100755 --- a/iup/test/matrix_cbmode.c +++ b/iup/test/matrix_cbmode.c @@ -5,33 +5,60 @@ #include "iup.h" #include "iupcontrols.h" -static char data[3][3][50] = +//static char data[3][3][50] = +//{ +// {"1:1", "1:2", "1:3"}, +// {"2:1", "2:2", "2:3"}, +// {"3:1", "3:2", "3:3"}, +//}; + + +static int dropcheck_cb(Ihandle *self, int lin, int col) { - {"1:1", "1:2", "1:3"}, - {"2:1", "2:2", "2:3"}, - {"3:1", "3:2", "3:3"}, -}; + if (lin == 3 && col == 1) + return IUP_DEFAULT; + return IUP_IGNORE; +} +static int drop(Ihandle *self, Ihandle *drop, int lin, int col) +{ + printf("drop_cb(%d, %d)\n", lin, col); + if(lin == 3 && col == 1) + { + IupSetAttribute(drop, "1", "A - Test of Very Big String for Dropdown!"); + IupSetAttribute(drop, "2", "B"); + IupSetAttribute(drop, "3", "C"); + IupSetAttribute(drop, "4", "XXX"); + IupSetAttribute(drop, "5", "5"); + IupSetAttribute(drop, "6", "6"); + IupSetAttribute(drop, "7", "7"); + IupSetAttribute(drop, "8", NULL); + return IUP_DEFAULT; + } + return IUP_IGNORE; +} static char* value_cb(Ihandle *self, int lin, int col) { if (lin == 0 || col == 0) return "Title"; - return data[lin-1][col-1]; + return "cell"; +// return data[lin-1][col-1]; } static int value_edit_cb(Ihandle *self, int lin, int col, char* newvalue) { - strcpy(data[lin-1][col-1], newvalue); +// strcpy(data[lin-1][col-1], newvalue); return IUP_DEFAULT; } static Ihandle* create_matrix(void) { Ihandle* mat = IupMatrix(NULL); + int lin, col; - IupSetAttribute(mat, "NUMCOL", "3"); - IupSetAttribute(mat, "NUMLIN", "3"); + IupSetAttribute(mat, "NUMCOL", "20"); + IupSetAttribute(mat, "NUMLIN", "5000"); IupSetAttribute(mat, "NUMCOL_VISIBLE", "3"); IupSetAttribute(mat, "NUMLIN_VISIBLE", "3"); @@ -40,19 +67,36 @@ static Ihandle* create_matrix(void) // IupSetAttribute(mat, "HEIGHT2", "30"); // IupSetAttribute(mat, "WIDTHDEF", "34"); // IupSetAttribute(mat,"RESIZEMATRIX", "YES"); - IupSetAttribute(mat,"SCROLLBAR", "NO"); + IupSetAttribute(mat,"SCROLLBAR", "YES"); IupSetCallback(mat,"VALUE_CB",(Icallback)value_cb); - IupSetCallback(mat,"VALUE_EDIT_CB",(Icallback)value_edit_cb); +// IupSetCallback(mat,"VALUE_EDIT_CB",(Icallback)value_edit_cb); +// IupSetCallback(mat, "DROPCHECK_CB", (Icallback)dropcheck_cb); +// IupSetCallback(mat,"DROP_CB",(Icallback)drop); // IupSetAttribute(mat, "HEIGHT0", "10"); // IupSetAttribute(mat, "WIDTH0", "90"); // IupSetAttribute(mat,"MARKMODE","LIN"); // IupSetAttribute(mat,"MARKMULTIPLE","NO"); + IupSetAttribute(mat,"MARKMODE","CELL"); + IupSetAttribute(mat,"MARKMULTIPLE","YES"); + IupSetAttribute(mat,"USETITLESIZE","YES"); //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"); + + for (lin = 0; lin < 3000; lin++) + { + for (col = 0; col < 20; col++) + { + IupMatSetAttribute(mat,"BGCOLOR", lin, col, "192 192 192"); + IupMatSetAttribute(mat,"FGCOLOR", lin, col, "1 1 1"); + } + } + return mat; } diff --git a/iup/test/matrix_cbs.c b/iup/test/matrix_cbs.c index 1b7afb9..31d2207 100755 --- a/iup/test/matrix_cbs.c +++ b/iup/test/matrix_cbs.c @@ -305,7 +305,7 @@ void MatrixCbsTest(void) // IupZbox( IupTabs( IupSetAttributes( - IupVbox((create_mat()), bt, IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"), + IupVbox((create_mat()), bt, IupText(""), IupLabel("Label Text"), IupFrame(IupVal("HORIZONTAL")), NULL), "MARGIN=10x10, GAP=10, TABTITLE=Test1"), IupSetAttributes( IupVbox(IupFrame(create_mat()), IupText(""), IupLabel("Label Text"), IupVal("HORIZONTAL"), diff --git a/iup/test/pplot.c b/iup/test/pplot.c index 639aa34..1283179 100755 --- a/iup/test/pplot.c +++ b/iup/test/pplot.c @@ -199,6 +199,7 @@ static void InitPlots(void) } IupPPlotEnd(plot[2]); IupSetAttribute(plot[2], "DS_COLOR", "100 100 200"); + IupSetAttribute(plot[2], "DS_LINESTYLE", "DOTTED"); /* PLOT 3 - MakeExamplePlot5 */ IupSetAttribute(plot[3], "TITLE", "Bar Mode"); @@ -579,8 +580,8 @@ void PPlotTest(void) boxinfo = IupVbox(lbl1, IupFill(), lbl2, NULL); boxdial1 = IupHbox(boxinfo, dial1, NULL); - IupSetAttribute(boxdial1, "ALIGN", "ACENTER"); - IupSetAttribute(boxinfo, "ALIGN", "ACENTER"); + IupSetAttribute(boxdial1, "ALIGNMENT", "ACENTER"); + IupSetAttribute(boxinfo, "ALIGNMENT", "ACENTER"); IupSetAttribute(boxinfo, "SIZE", "20x52"); IupSetAttribute(boxinfo, "GAP", "2"); IupSetAttribute(boxinfo, "MARGIN", "4"); @@ -608,8 +609,8 @@ void PPlotTest(void) boxinfo = IupHbox(lbl1, IupFill(), lbl2, NULL); boxdial2 = IupVbox(dial2, boxinfo, NULL); - IupSetAttribute(boxdial2, "ALIGN", "ACENTER"); - IupSetAttribute(boxinfo, "ALIGN", "ACENTER"); + IupSetAttribute(boxdial2, "ALIGNMENT", "ACENTER"); + IupSetAttribute(boxinfo, "ALIGNMENT", "ACENTER"); IupSetAttribute(boxinfo, "SIZE", "64x16"); IupSetAttribute(boxinfo, "GAP", "2"); IupSetAttribute(boxinfo, "MARGIN", "4"); diff --git a/iup/test/predialogs.c b/iup/test/predialogs.c index e7b36ea..570dffd 100755 --- a/iup/test/predialogs.c +++ b/iup/test/predialogs.c @@ -6,7 +6,25 @@ #include "iupkey.h" #include "iupcontrols.h" +//#define USE_GDK +#ifdef USE_GDK +#include <gtk/gtk.h> +static void drawTest(Ihandle *ih) +{ + GtkWidget* widget = (GtkWidget*)IupGetAttribute(ih, "WID"); + GdkGC* gc = widget->style->fg_gc[GTK_WIDGET_STATE(widget)]; + int w = IupGetInt(ih, "PREVIEWWIDTH"); + int h = IupGetInt(ih, "PREVIEWHEIGHT"); + GdkColor color; + + color.red = 65535; color.green = 0; color.blue = 0; + gdk_gc_set_rgb_fg_color(gc, &color); + + gdk_draw_line(widget->window, gc, 0, 0, w-1, h-1); + gdk_draw_line(widget->window, gc, 0, h-1, w-1, 0); +} +#else #ifdef WIN32 #undef _WIN32_WINNT #define _WIN32_WINNT 0x0500 @@ -62,8 +80,12 @@ static void drawTest(Ihandle* ih) XDrawLine(dpy, wnd, gc, 0, h-1, w-1, 0); } #endif +#endif #ifdef USE_OPENGL +#ifdef WIN32 +#include <windows.h> +#endif #include <GL/gl.h> #include "iupgl.h" @@ -223,12 +245,12 @@ static void new_file(char* dialogtype, int preview) // IupSetAttributes(dlg, "FILE = \"test.bmp\", DIRECTORY = \"/tecgraf/iup\""); // OK // IupSetAttributes(dlg, "FILE = \"test.bmp\", DIRECTORY = \"\\tecgraf\\iup\""); // OK // IupSetAttribute(dlg, "NOCHANGEDIR", "NO"); -// IupSetAttribute(dlg, "MULTIPLEFILES", "YES"); + IupSetAttribute(dlg, "MULTIPLEFILES", "YES"); + IupSetCallback(dlg, "FILE_CB", (Icallback)file_cb); if (preview) { IupSetAttribute(dlg, "SHOWPREVIEW", "YES"); - IupSetCallback(dlg, "FILE_CB", (Icallback)file_cb); #ifdef USE_OPENGL if (preview==2) diff --git a/iup/test/sample.c b/iup/test/sample.c index e99617d..038cffd 100755 --- a/iup/test/sample.c +++ b/iup/test/sample.c @@ -185,6 +185,24 @@ static int help_cb(Ihandle* ih) return IUP_DEFAULT; } +static int action1_cb(Ihandle* ih) +{ + IupSetAttribute(IupGetDialog(ih), "BACKGROUND", "255 128 128"); + return IUP_DEFAULT; +} + +static int action2_cb(Ihandle* ih) +{ + IupSetAttribute(IupGetDialog(ih), "BGCOLOR", "0 128 0"); + return IUP_DEFAULT; +} + +static int action3_cb(Ihandle* ih) +{ + IupSetAttribute(IupGetChild(IupGetDialog(ih), 0), "BGCOLOR", "128 0 0"); + return IUP_DEFAULT; +} + static Ihandle* set_callbacks(Ihandle* ih) { IupSetCallback(ih, "VALUECHANGED_CB", (Icallback)valuechanged_cb); @@ -237,9 +255,9 @@ void SampleTest(void) _frm_1 = IupFrame( IupVbox( set_callbacks(IupSetAttributes(IupButton("Button Text", NULL), "PADDING=5x5")), - set_callbacks(IupSetAttributes(IupButton("Text", NULL), "IMAGE=img1, PADDING=5x5")), - set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=img1")), - set_callbacks(IupSetAttributes(IupButton("", NULL), "IMAGE=img1,IMPRESS=img2")), + IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("Text", NULL), "IMAGE=img1, PADDING=5x5")),"ACTION", action1_cb, NULL), + IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=img1")),"ACTION", action2_cb, NULL), + IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("", NULL), "IMAGE=img1,IMPRESS=img2")),"ACTION", action3_cb, NULL), NULL)); IupSetAttribute(_frm_1,"TITLE","IupButton"); diff --git a/iup/test/split.c b/iup/test/split.c new file mode 100644 index 0000000..7b3208a --- /dev/null +++ b/iup/test/split.c @@ -0,0 +1,47 @@ +#include <stdio.h> +#include "iup.h" + +void SplitTest(void) +{ + Ihandle *dlg, *bt, *split, *ml, *vbox; + + bt = IupButton("Button", NULL); + IupSetAttribute(bt, "EXPAND", "YES"); + + ml = IupMultiLine(NULL); + IupSetAttribute(ml, "EXPAND", "YES"); + IupSetAttribute(ml, "VISIBLELINES", "5"); + IupSetAttribute(ml, "VISIBLECOLUMNS", "10"); + + split = IupSplit(bt, ml); +// IupSetAttribute(split, "DIRECTION", "VERTICAL"); +// IupSetAttribute(split, "DIRECTION", "HORIZONTAL"); +// IupSetAttribute(split, "COLOR", "127 127 255"); +// IupSetAttribute(split, "LAYOUTDRAG", "NO"); +// IupSetAttribute(split, "AUTOHIDE", "YES"); +// IupSetAttribute(split, "SHOWGRIP", "NO"); + + vbox = IupVbox(split, NULL); + IupSetAttribute(vbox, "MARGIN", "10x10"); + IupSetAttribute(vbox, "GAP", "10"); + + dlg = IupDialog(vbox); + IupSetAttribute(dlg, "TITLE", "IupSplit Example"); + + IupShow(dlg); +} + +#ifndef BIG_TEST +int main(int argc, char* argv[]) +{ + IupOpen(&argc, &argv); + + SplitTest(); + + IupMainLoop(); + + IupClose(); + + return EXIT_SUCCESS; +} +#endif diff --git a/iup/test/tabs.c b/iup/test/tabs.c index a069f01..1efc1a9 100755 --- a/iup/test/tabs.c +++ b/iup/test/tabs.c @@ -73,6 +73,7 @@ static int cbValuePos(Ihandle* ih) { Ihandle* tabs = (Ihandle*)IupGetAttribute(ih, "APP_TABS"); IupSetAttribute(tabs, "VALUEPOS", "0"); +// IupSetAttribute(tabs, "TABTITLE0", "1asdasd"); // printf("VALUE=%s\n", IupGetAttribute(tabs, "VALUE")); return IUP_DEFAULT; } diff --git a/iup/test/tree.c b/iup/test/tree.c index 009c97f..ed1f6aa 100755 --- a/iup/test/tree.c +++ b/iup/test/tree.c @@ -72,41 +72,49 @@ static Ihandle* load_image_TestImage(void) static int addleaf(void) { - char attr[50]; Ihandle* tree = IupGetHandle("tree"); int id = IupGetInt(tree, "VALUE"); - sprintf(attr, "ADDLEAF%d", id); - IupSetAttribute(tree, attr, ""); + IupTreeSetAttribute(tree, "ADDLEAF", id, ""); return IUP_DEFAULT; } static int insertleaf(void) { - char attr[50]; Ihandle* tree = IupGetHandle("tree"); int id = IupGetInt(tree, "VALUE"); - sprintf(attr, "INSERTLEAF%d", id); - IupSetAttribute(tree, attr, ""); + IupTreeSetAttribute(tree, "INSERTLEAF", id, ""); return IUP_DEFAULT; } static int addbranch(void) { - char attr[50]; Ihandle* tree = IupGetHandle("tree"); int id = IupGetInt(tree, "VALUE"); - sprintf(attr, "ADDBRANCH%d", id); - IupSetAttribute(tree, attr, ""); + IupTreeSetAttribute(tree, "ADDBRANCH", id, ""); return IUP_DEFAULT; } static int insertbranch(void) { - char attr[50]; Ihandle* tree = IupGetHandle("tree"); int id = IupGetInt(tree, "VALUE"); - sprintf(attr, "INSERTBRANCH%d", id); - IupSetAttribute(tree, attr, ""); + IupTreeSetAttribute(tree, "INSERTBRANCH", id, ""); + return IUP_DEFAULT; +} + +static int togglestate(void) +{ + char *value; + Ihandle* tree = IupGetHandle("tree"); + int id = IupGetInt(tree, "VALUE"); + value = IupTreeGetAttribute(tree, "STATE", id); + if (value) + { + if (strcmp(value, "EXPANDED")==0) + IupTreeSetAttribute(tree, "STATE", id, "COLLAPSED"); + else + IupTreeSetAttribute(tree, "STATE", id, "EXPANDED"); + } return IUP_DEFAULT; } @@ -139,6 +147,34 @@ static int removechild(void) return IUP_DEFAULT; } +static int removemarked(void) +{ + Ihandle* tree = IupGetHandle("tree"); + IupSetAttribute(tree, "DELNODE", "MARKED"); + return IUP_DEFAULT; +} + +static int removeall(void) +{ + Ihandle* tree = IupGetHandle("tree"); + IupSetAttribute(tree, "DELNODE", "ALL"); + return IUP_DEFAULT; +} + +static int expandall(void) +{ + Ihandle* tree = IupGetHandle("tree"); + IupSetAttribute(tree, "EXPANDALL", "YES"); + return IUP_DEFAULT; +} + +static int contractall(void) +{ + Ihandle* tree = IupGetHandle("tree"); + IupSetAttribute(tree, "EXPANDALL", "NO"); + return IUP_DEFAULT; +} + int renamenode(void) { Ihandle* tree = IupGetHandle("tree"); @@ -162,6 +198,8 @@ static int showrename_cb(Ihandle* ih, int id) { (void)ih; printf("SHOWRENAME_CB(%d)\n", id); + if (id == 6) + return IUP_IGNORE; return IUP_DEFAULT; } @@ -183,15 +221,20 @@ static int multiselection_cb(Ihandle *ih, int* ids, int n) return IUP_DEFAULT; } -static int executeleaf_cb(Ihandle* ih, int id) +static int multiunselection_cb(Ihandle *ih, int* ids, int n) { - printf("EXECUTELEAF_CB (%d)\n", id); + int i; + (void)ih; + printf("MULTIUNSELECTION_CB("); + for (i = 0; i < n; i++) + printf("%d, ", ids[i]); + printf("n=%d)\n", n); return IUP_DEFAULT; } -static int renamenode_cb(Ihandle* ih, int id, char* title) +static int executeleaf_cb(Ihandle* ih, int id) { - printf("RENAMENODE_CB (%d=%s)\n", id, title); + printf("EXECUTELEAF_CB (%d)\n", id); return IUP_DEFAULT; } @@ -219,6 +262,12 @@ static int branchclose_cb(Ihandle* ih, int id) return IUP_DEFAULT; } +static int noderemoved_cb(Ihandle* ih, void* data) +{ + printf("NODEREMOVED_CB(%p)\n", data); + return IUP_DEFAULT; +} + static int dragdrop_cb(Ihandle* ih, int drag_id, int drop_id, int shift, int control) { printf("DRAGDROP_CB (%d)->(%d)\n", drag_id, drop_id); @@ -317,6 +366,11 @@ static int rightclick_cb(Ihandle* ih, int id) IupItem ("Insert Branch","insertbranch"), IupItem ("Remove Node","removenode"), IupItem ("Remove Children","removechild"), + IupItem ("Remove Marked","removemarked"), + IupItem ("Remove All","removeall"), + IupItem ("Toggle State","togglestate"), + IupItem ("Expand All","expandall"), + IupItem ("Contract All","contractall"), IupSubmenu("Focus", IupMenu( IupItem ("ROOT", "selectnode"), IupItem ("LAST", "selectnode"), @@ -342,7 +396,12 @@ static int rightclick_cb(Ihandle* ih, int id) IupSetFunction("insertbranch", (Icallback) insertbranch); IupSetFunction("removenode", (Icallback) removenode); IupSetFunction("removechild", (Icallback) removechild); + IupSetFunction("removemarked", (Icallback) removemarked); IupSetFunction("renamenode", (Icallback) renamenode); + IupSetFunction("togglestate", (Icallback) togglestate); + IupSetFunction("removeall", (Icallback) removeall); + IupSetFunction("expandall", (Icallback) expandall); + IupSetFunction("contractall", (Icallback) contractall); // sprintf(attr, "%d", id); // IupSetAttribute(ih, "VALUE", attr); @@ -374,7 +433,8 @@ static int next(Ihandle *ih) static int prev(Ihandle *ih) { Ihandle* tree = IupGetHandle("tree"); - IupSetAttribute(tree, "VALUE", "PREVIOUS"); +// IupSetAttribute(tree, "VALUE", "PREVIOUS"); + IupSetAttribute(tree, "STATE2", "COLLAPSED"); return IUP_DEFAULT; } @@ -384,7 +444,6 @@ static void init_tree(void) Ihandle* tree = IupTree(); IupSetCallback(tree, "EXECUTELEAF_CB", (Icallback) executeleaf_cb); - IupSetCallback(tree, "RENAMENODE_CB", (Icallback) renamenode_cb); IupSetCallback(tree, "RENAME_CB", (Icallback) rename_cb); IupSetCallback(tree, "BRANCHCLOSE_CB", (Icallback) branchclose_cb); IupSetCallback(tree, "BRANCHOPEN_CB", (Icallback) branchopen_cb); @@ -394,12 +453,14 @@ static void init_tree(void) IupSetCallback(tree, "SHOWRENAME_CB", (Icallback) showrename_cb); IupSetCallback(tree, "SELECTION_CB", (Icallback) selection_cb); IupSetCallback(tree, "MULTISELECTION_CB", (Icallback) multiselection_cb); + IupSetCallback(tree, "MULTIUNSELECTION_CB", (Icallback) multiunselection_cb); IupSetCallback(tree, "GETFOCUS_CB", (Icallback) getfocus_cb); IupSetCallback(tree, "KILLFOCUS_CB", (Icallback) killfocus_cb); //IupSetCallback(tree, "ENTERWINDOW_CB", (Icallback) enterwindow_cb); //IupSetCallback(tree, "LEAVEWINDOW_CB", (Icallback)leavewindow_cb); //IupSetCallback(tree, "BUTTON_CB", (Icallback)button_cb); //IupSetCallback(tree, "MOTION_CB", (Icallback)motion_cb); + IupSetCallback(tree, "NODEREMOVED_CB", (Icallback)noderemoved_cb); IupSetCallback(tree, "HELP_CB", (Icallback)help_cb); @@ -409,11 +470,10 @@ static void init_tree(void) // IupSetAttribute(tree, "BGCOLOR", "255 255 255"); IupSetAttribute(tree, "MARKMODE", "MULTIPLE"); - //IupSetAttribute(tree, "SHOWDRAGDROP", "YES"); IupSetAttribute(tree, "SHOWRENAME", "YES"); - //IupSetAttribute(tree, "AUTODRAGDROP", "YES"); /* Gtk Only */ +// IupSetAttribute(tree, "SHOWDRAGDROP", "YES"); - //IupSetAttribute(tree, "ADDEXPANDED", "NO"); + IupSetAttribute(tree, "ADDEXPANDED", "YES"); // IupSetAttribute(tree, "HIDELINES", "YES"); // IupSetAttribute(tree, "HIDEBUTTONS", "YES"); // IupSetAttribute(tree, "INDENTATION", "40"); @@ -457,7 +517,7 @@ static void init_tree_nodes(void) //IupSetAttribute(tree, "VALUE", "0"); IupSetAttribute(tree, "TITLE", "Figures"); /* title of the root, id=0 */ IupSetAttribute(tree, "ADDBRANCH", "3D"); /* 3D=1 */ - IupSetAttribute(tree, "ADDBRANCH", "2D"); /* add to the root, so it will be before "3D", now 2D=1, 3D=2 */ + 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"); @@ -474,14 +534,15 @@ static void init_tree_nodes(void) 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, "INSERTBRANCH6","2D"); /* new id=9 */ + IupSetAttribute(tree, "INSERTLEAF6","2D"); /* new id=9 */ IupSetAttribute(tree, "INSERTBRANCH9","3D"); #endif - IupSetAttribute(tree, "VALUE", "6"); + //IupSetAttribute(tree, "VALUE", "6"); IupSetAttribute(tree, "RASTERSIZE", NULL); /* remove the minimum size limitation */ IupSetAttribute(tree, "COLOR8", "92 92 255"); IupSetAttribute(tree, "TITLEFONT8", "Courier, 14"); diff --git a/iup/test/val.c b/iup/test/val.c index 2f0b500..c1b4724 100755 --- a/iup/test/val.c +++ b/iup/test/val.c @@ -118,8 +118,6 @@ void ValTest(void) { Ihandle *dlg, *val_h, *val_v; -// IupOldValOpen(); - lbl_v = IupLabel("VALUE="); IupSetAttribute(lbl_v, "SIZE", "70x"); @@ -143,8 +141,8 @@ void ValTest(void) val_h = IupVal("HORIZONTAL"); IupSetAttribute(val_h, "MAX", "100.0"); - IupSetAttribute(val_h, "SHOWTICKS", "10"); - IupSetAttribute(val_h, "TICKSPOS", "BOTH"); /* Windows Only */ +// IupSetAttribute(val_h, "SHOWTICKS", "10"); +// IupSetAttribute(val_h, "TICKSPOS", "BOTH"); /* Windows Only */ // IupSetAttribute(val_h, "INVERTED", "YES"); IupSetAttribute(val_h, "EXPAND", "HORIZONTAL"); diff --git a/iup/test/vbox.c b/iup/test/vbox.c index 3040ea6..ac53b6b 100755 --- a/iup/test/vbox.c +++ b/iup/test/vbox.c @@ -28,13 +28,17 @@ void VboxTest(void) IupSetAttribute(fr1, "TITLE", "ALIGNMENT=ALEFT"); IupSetAttribute(btn_11, "SIZE", "20x10"); - IupSetAttribute(btn_12, "SIZE", "30x20"); - IupSetAttribute(btn_13, "SIZE", "40x30"); +// IupSetAttribute(btn_12, "SIZE", "30x20"); + IupSetAttribute(btn_12, "EXPAND", "VERTICAL"); + IupSetAttribute(btn_12, "EXPANDWEIGTH", "1.3"); +// IupSetAttribute(btn_13, "SIZE", "40x30"); + IupSetAttribute(btn_13, "EXPAND", "VERTICAL"); + IupSetAttribute(btn_13, "EXPANDWEIGTH", "0.7"); IupSetAttribute(vbox_1, "ALIGNMENT", "ALEFT"); // IupSetAttribute(vbox_1, "MARGIN", "20x20"); // IupSetAttribute(vbox_1, "GAP", "10"); - IupSetAttribute(vbox_1, "HOMOGENEOUS", "YES"); - IupSetAttribute(vbox_1, "EXPANDCHILDREN", "YES"); +// IupSetAttribute(vbox_1, "HOMOGENEOUS", "YES"); +// IupSetAttribute(vbox_1, "EXPANDCHILDREN", "YES"); // IupSetAttribute(btn_12, "VISIBLE", "NO"); // IupSetAttribute(btn_12, "FLOATING", "YES"); diff --git a/iup/test/zbox.c b/iup/test/zbox.c index 0451277..1e8571e 100755 --- a/iup/test/zbox.c +++ b/iup/test/zbox.c @@ -29,7 +29,7 @@ void ZboxTest(void) text = IupText(""); - IupSetAttributes (text, "EXPAND = YES, VALUE = \"Enter your text here\""); + IupSetAttributes (text, "EXPAND=YES, VALUE=\"Enter your text here\""); /* Creates a label */ lbl = IupLabel("This element is a label"); @@ -42,9 +42,10 @@ void ZboxTest(void) IupSetHandle ("text", text); IupSetHandle ("lbl", lbl); IupSetHandle ("btn", btn); - + /* Creates zbox with four elements */ zbox = IupZbox (frame, text, lbl, btn, NULL); +// zbox = IupZbox (IupZbox(IupSetAttributes(IupCanvas(NULL), "RASTERSIZE=100x100"), NULL), NULL); /* Associates handle "zbox" with zbox */ IupSetHandle ("zbox", zbox); |