summaryrefslogtreecommitdiff
path: root/iup/test
diff options
context:
space:
mode:
Diffstat (limited to 'iup/test')
-rwxr-xr-xiup/test/button.c4
-rwxr-xr-xiup/test/config.mak127
-rwxr-xr-xiup/test/dialog.c8
-rwxr-xr-xiup/test/glcanvas.c7
-rwxr-xr-xiup/test/iuptest.rc5
-rwxr-xr-xiup/test/make_uname5
-rwxr-xr-xiup/test/matrix_cbmode.c40
-rwxr-xr-xiup/test/predialogs.c1
-rwxr-xr-xiup/test/sample.c20
-rw-r--r--iup/test/split.c2
-rwxr-xr-xiup/test/tree.c2
-rwxr-xr-xiup/test/vbox.c4
12 files changed, 71 insertions, 154 deletions
diff --git a/iup/test/button.c b/iup/test/button.c
index f04f082..37c4e68 100755
--- a/iup/test/button.c
+++ b/iup/test/button.c
@@ -156,7 +156,8 @@ static char* get_name(Ihandle* ih)
static int action_cb(Ihandle *ih)
{
- printf("ACTION(%s)\n", get_name(ih));
+ static int count = 1;
+ printf("ACTION(%s) - %d\n", get_name(ih), count); count++;
return IUP_DEFAULT;
}
@@ -366,6 +367,7 @@ void ButtonTest(void)
// IupSetAttribute(button, "ALIGNMENT", "ALEFT");
// IupSetAttribute(button, "RASTERSIZE", "200x100");
IupSetAttribute(button, "FLAT", "YES");
+// IupSetAttribute(button, "CANFOCUS", "NO");
// IupSetAttributeHandle(button, "IMPRESS", image2);
// IupSetAttribute(button, "FOCUSONCLICK", "NO");
// IupSetAttribute(button, "RASTERSIZE", "15x15");
diff --git a/iup/test/config.mak b/iup/test/config.mak
deleted file mode 100755
index b97ae83..0000000
--- a/iup/test/config.mak
+++ /dev/null
@@ -1,127 +0,0 @@
-PROJNAME = iup
-APPNAME = iuptest
-APPTYPE = CONSOLE
-
-ifdef GTK_DEFAULT
- ifdef USE_MOTIF
- # Build Motif version in Linux,Darwin,FreeBSD
- 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 = ..
-
-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
-SRC += bigtest.c
-
-SRC += tray.c
-SRC += dialog.c
-SRC += predialogs.c
-SRC += timer.c
-SRC += label.c
-SRC += canvas.c
-SRC += frame.c
-SRC += idle.c
-SRC += button.c
-SRC += toggle.c
-SRC += vbox.c
-SRC += hbox.c
-SRC += progressbar.c
-SRC += text.c
-SRC += val.c
-SRC += tabs.c
-SRC += sample.c
-SRC += menu.c
-SRC += spin.c
-SRC += text_spin.c
-SRC += list.c
-SRC += sysinfo.c
-SRC += mdi.c
-SRC += getparam.c
-SRC += getcolor.c
-SRC += class_conf.c
-SRC += tree.c
-SRC += zbox.c
-SRC += scanf.c
-SRC += sbox.c
-SRC += clipboard.c
-SRC += split.c
-
-
-#ifneq ($(findstring Win, $(TEC_SYSNAME)), )
-# LIBS += iupimglib
-#else
-# SLIB += $(IUPLIB)/libiupimglib.a
-#endif
-
-USE_CD = Yes
-SRC += canvas_scrollbar.c
-SRC += canvas_cddbuffer.c
-SRC += canvas_cdsimple.c
-
-USE_OPENGL = Yes
-DEFINES += USE_OPENGL
-SRC += glcanvas.c
-SRC += glcanvas_cube.c
-
-USE_IUPCONTROLS = Yes
-SRC += colorbrowser.c
-SRC += dial.c
-SRC += colorbar.c
-SRC += cells_numbering.c
-SRC += cells_degrade.c
-SRC += cells_checkboard.c
-SRC += gauge.c
-SRC += matrix.c
-SRC += matrix_cbs.c
-SRC += matrix_cbmode.c
-
-LINKER = g++
-DEFINES += PPLOT_TEST
-SRC += pplot.c
-ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- LIBS += iup_pplot
-# LIBS += cdpdflib
-# LDIR += $(IUP)/lib/$(TEC_UNAME)
-else
- SLIB += $(IUPLIB)/libiup_pplot.a
-# SLIB += $(CDLIB)/libcdpdflib.a
-endif
-
-ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- SRC += iuptest.rc
-else
- ifneq ($(findstring cygw, $(TEC_UNAME)), )
- SRC += iuptest.rc
- endif
-endif
-
-#ifneq ($(findstring Win, $(TEC_SYSNAME)), )
-# USE_GDIPLUS=Yes
-#else
-# USE_XRENDER=Yes
-#endif
diff --git a/iup/test/dialog.c b/iup/test/dialog.c
index 334b1cc..b1b3d89 100755
--- a/iup/test/dialog.c
+++ b/iup/test/dialog.c
@@ -304,10 +304,10 @@ static void new_dialog(int test, char* tip)
{
IupSetAttribute(dlg, "BGCOLOR", "255 0 255");
IupSetAttribute(dlg, "RESIZE", "NO");
- IupSetAttribute(dlg, "MENUBOX", "NO");
- IupSetAttribute(dlg, "MAXBOX", "NO");
- IupSetAttribute(dlg, "MINBOX", "NO");
- IupSetAttribute(dlg, "BORDER", "NO");
+// IupSetAttribute(dlg, "MENUBOX", "NO");
+ //IupSetAttribute(dlg, "MAXBOX", "NO");
+// IupSetAttribute(dlg, "MINBOX", "NO");
+// IupSetAttribute(dlg, "BORDER", "NO");
IupSetAttribute(dlg, "RASTERSIZE", "500x500");
}
diff --git a/iup/test/glcanvas.c b/iup/test/glcanvas.c
index 6a34c29..8c8fbd2 100755
--- a/iup/test/glcanvas.c
+++ b/iup/test/glcanvas.c
@@ -11,6 +11,12 @@
#include "iupgl.h"
+static int button_cb(Ihandle *ih,int but,int pressed,int x,int y,char* status)
+{
+ printf("BUTTON_CB(but=%c (pressed=%d), x=%d, y=%d [%s])\n",(char)but,pressed,x,y, status);
+ return IUP_DEFAULT;
+}
+
static int action(Ihandle *ih)
{
IupGLMakeCurrent(ih);
@@ -45,6 +51,7 @@ void GLCanvasTest(void)
IupSetAttribute(canvas, "BUFFER", "DOUBLE");
IupSetAttribute(canvas, "BORDER", "NO");
IupSetAttribute(canvas, "RASTERSIZE", "300x200");
+ IupSetCallback(canvas, "BUTTON_CB", (Icallback)button_cb);
IupAppend(box, canvas);
dlg = IupDialog(box);
diff --git a/iup/test/iuptest.rc b/iup/test/iuptest.rc
index 94e5ca1..ef9ffbf 100755
--- a/iup/test/iuptest.rc
+++ b/iup/test/iuptest.rc
@@ -1,6 +1,5 @@
TECGRAF_ICON ICON "../etc/tecgraf.ico"
-TECGRAF_BITMAP BITMAP "../test/tecgraf.bmp"
-
+TECGRAF_BITMAP BITMAP "tecgraf.bmp"
CURSOR_PEN CURSOR "../etc/pen.cur"
/* To avoid the inclusion of <winuser.h> */
@@ -23,7 +22,7 @@ END
#ifndef IUP_DLL
/* The following line will enable Windows XP Visual Styles */
-#ifdef WIN64
+#ifdef TEC_64
1 24 "../etc/iup64.manifest"
#else
1 24 "../etc/iup.manifest"
diff --git a/iup/test/make_uname b/iup/test/make_uname
deleted file mode 100755
index 1df8629..0000000
--- a/iup/test/make_uname
+++ /dev/null
@@ -1,5 +0,0 @@
-#This builds all the libraries of the folder for 1 uname
-
-tecmake 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_cbmode.c b/iup/test/matrix_cbmode.c
index 99ac21f..57e420d 100755
--- a/iup/test/matrix_cbmode.c
+++ b/iup/test/matrix_cbmode.c
@@ -5,13 +5,15 @@
#include "iup.h"
#include "iupcontrols.h"
-//static char data[3][3][50] =
-//{
-// {"1:1", "1:2", "1:3"},
-// {"2:1", "2:2", "2:3"},
-// {"3:1", "3:2", "3:3"},
-//};
-
+//#define BIG_MATRIX
+#ifndef BIG_MATRIX
+static char data[3][3][50] =
+{
+ {"1:1", "1:2", "1:3"},
+ {"2:1", "2:2", "2:3"},
+ {"3:1", "3:2", "3:3"},
+};
+#endif
static int dropcheck_cb(Ihandle *self, int lin, int col)
{
@@ -40,15 +42,22 @@ static int drop(Ihandle *self, Ihandle *drop, int lin, int col)
static char* value_cb(Ihandle *self, int lin, int col)
{
+#ifdef BIG_MATRIX
if (lin == 0 || col == 0)
return "Title";
return "cell";
-// return data[lin-1][col-1];
+#else
+ if (lin == 0 || col == 0)
+ return NULL;
+ return data[lin-1][col-1];
+#endif
}
static int value_edit_cb(Ihandle *self, int lin, int col, char* newvalue)
{
-// strcpy(data[lin-1][col-1], newvalue);
+#ifndef BIG_MATRIX
+ strcpy(data[lin-1][col-1], newvalue);
+#endif
return IUP_DEFAULT;
}
@@ -57,8 +66,13 @@ 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");
@@ -85,9 +99,12 @@ static Ihandle* create_matrix(void)
//IupSetAttribute(mat, "NUMLIN_VISIBLE_LAST", "YES");
// IupSetAttribute(mat, "WIDTHDEF", "15");
-// IupSetAttribute(mat,"FRAMEVERTCOLOR1:2","BGCOLOR");
-// IupSetAttribute(mat,"FRAMEHORIZCOLOR2:1","BGCOLOR");
+ 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 BIG_MATRIX
for (lin = 0; lin < 3000; lin++)
{
for (col = 0; col < 20; col++)
@@ -96,6 +113,7 @@ static Ihandle* create_matrix(void)
IupMatSetAttribute(mat,"FGCOLOR", lin, col, "1 1 1");
}
}
+#endif
return mat;
}
diff --git a/iup/test/predialogs.c b/iup/test/predialogs.c
index 570dffd..a0a7bea 100755
--- a/iup/test/predialogs.c
+++ b/iup/test/predialogs.c
@@ -246,6 +246,7 @@ static void new_file(char* dialogtype, int preview)
// IupSetAttributes(dlg, "FILE = \"test.bmp\", DIRECTORY = \"\\tecgraf\\iup\""); // OK
// IupSetAttribute(dlg, "NOCHANGEDIR", "NO");
IupSetAttribute(dlg, "MULTIPLEFILES", "YES");
+// IupSetAttribute(dlg, "RASTERSIZE", "800x600");
IupSetCallback(dlg, "FILE_CB", (Icallback)file_cb);
if (preview)
diff --git a/iup/test/sample.c b/iup/test/sample.c
index 038cffd..3c00d8d 100755
--- a/iup/test/sample.c
+++ b/iup/test/sample.c
@@ -138,6 +138,12 @@ static unsigned char img_bits2[] =
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
};
+static int copydata_cb(Ihandle* ih, char* value, int size)
+{
+ printf("COPYDATA(%s, %d)\n", value, size);
+ return IUP_DEFAULT;
+}
+
static int valuechanged_cb(Ihandle *ih)
{
printf("VALUECHANGED_CB(%s)=%s\n", IupGetClassName(ih), IupGetAttribute(ih, "VALUE"));
@@ -397,6 +403,11 @@ void SampleTest(void)
// IupSetAttribute(box, "FGCOLOR", "255 0 0");
+// IupSetAttribute(dlg,"RASTERSIZE","1000x800");
+
+ IupSetCallback(dlg, "COPYDATA_CB", (Icallback)copydata_cb);
+
+
IupMap(dlg);
IupSetAttribute(tree, "TITLE0", "Figures");
@@ -407,6 +418,8 @@ void SampleTest(void)
IupSetAttribute(tree, "ADDLEAF4", "scalenus");
IupShow(dlg);
+
+// IupSetAttribute(dlg,"RASTERSIZE", NULL);
}
#ifndef BIG_TEST
@@ -414,6 +427,13 @@ int main(int argc, char* argv[])
{
IupOpen(&argc, &argv);
+ IupSetGlobal("SINGLEINSTANCE", "Iup Sample");
+ if (!IupGetGlobal("SINGLEINSTANCE"))
+ {
+ IupClose();
+ return EXIT_SUCCESS;
+ }
+
SampleTest();
IupMainLoop();
diff --git a/iup/test/split.c b/iup/test/split.c
index 7b3208a..7576e78 100644
--- a/iup/test/split.c
+++ b/iup/test/split.c
@@ -7,6 +7,7 @@ void SplitTest(void)
bt = IupButton("Button", NULL);
IupSetAttribute(bt, "EXPAND", "YES");
+// IupSetAttribute(bt, "MINSIZE", "30x");
ml = IupMultiLine(NULL);
IupSetAttribute(ml, "EXPAND", "YES");
@@ -20,6 +21,7 @@ void SplitTest(void)
// IupSetAttribute(split, "LAYOUTDRAG", "NO");
// IupSetAttribute(split, "AUTOHIDE", "YES");
// IupSetAttribute(split, "SHOWGRIP", "NO");
+// IupSetAttribute(split, "MINMAX", "100:800");
vbox = IupVbox(split, NULL);
IupSetAttribute(vbox, "MARGIN", "10x10");
diff --git a/iup/test/tree.c b/iup/test/tree.c
index ed1f6aa..0fdb04b 100755
--- a/iup/test/tree.c
+++ b/iup/test/tree.c
@@ -458,7 +458,7 @@ static void init_tree(void)
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, "BUTTON_CB", (Icallback)button_cb);
//IupSetCallback(tree, "MOTION_CB", (Icallback)motion_cb);
IupSetCallback(tree, "NODEREMOVED_CB", (Icallback)noderemoved_cb);
diff --git a/iup/test/vbox.c b/iup/test/vbox.c
index ac53b6b..5587a3c 100755
--- a/iup/test/vbox.c
+++ b/iup/test/vbox.c
@@ -30,10 +30,10 @@ void VboxTest(void)
IupSetAttribute(btn_11, "SIZE", "20x10");
// IupSetAttribute(btn_12, "SIZE", "30x20");
IupSetAttribute(btn_12, "EXPAND", "VERTICAL");
- IupSetAttribute(btn_12, "EXPANDWEIGTH", "1.3");
+ IupSetAttribute(btn_12, "EXPANDWEIGHT", "1.3");
// IupSetAttribute(btn_13, "SIZE", "40x30");
IupSetAttribute(btn_13, "EXPAND", "VERTICAL");
- IupSetAttribute(btn_13, "EXPANDWEIGTH", "0.7");
+ IupSetAttribute(btn_13, "EXPANDWEIGHT", "0.7");
IupSetAttribute(vbox_1, "ALIGNMENT", "ALEFT");
// IupSetAttribute(vbox_1, "MARGIN", "20x20");
// IupSetAttribute(vbox_1, "GAP", "10");