8 # define sleep(x) Sleep(x)
12 #undef BUILDING_FOX16_GUI
15 #include <gwen-gui-fox16/fox16_gui.hpp>
20 #include "../testdialogs/dlg_test.h"
21 #include "../testdialogs/dlg_test2.h"
23 #include <gwenhywfar/debug.h>
29 int test1(
int argc,
char **argv) {
30 FXApp a(
"libtest",
"Martin Preuss");
33 const char testString[]=
36 "This is <b>a</b> test. "
37 "And this, is the second line: followed by something else."
48 "And this is after the table.<br>"
49 "and this <font color=\"red\">one</font> is red.";
51 "This is before right"
52 "<right>RIGHT</right>"
53 "and this after right.";
66 ctx.setText(testString);
80 int test2(
int argc,
char **argv) {
81 FXApp application(
"libtest",
"Martin Preuss");
89 application.init(argc,argv);
101 "<p><b>This</b> is an example <i>text</i>..</p>"
102 "<p>As you can see <font color=red>colors</font> can "
107 for (i1=1; i1<=15; i1++) {
109 "Step %d: This is a another step in the test of progress widgets",
115 "Starting 2nd progress...",
118 for (i2=1; i2<=3; i2++) {
120 fprintf(stderr,
"Advancing %d/%d\n", (
int)i1, (
int)i2);
123 fprintf(stderr,
"Aborted by user\n");
131 fprintf(stderr,
"Aborted by user\n");
144 FXApp a(
"libtest",
"Martin Preuss");
149 const char testString[]=
153 "This is <b>a</b> test. "
154 "And this, is the second line: followed by something else."
155 "<right>This should be right aligned</right>"
163 " <td>this is longer data (data2)</td>"
166 "And this is after the table.<br>"
167 "and this <font color=\"red\">one</font> is red.";
169 "This is before right"
170 "<right>Right</right>"
171 "and this after right.";
179 dbox=
new FXDialogBox(&a,
"Test", DECOR_ALL);
180 vf=
new FXVerticalFrame(dbox, LAYOUT_FILL_X | LAYOUT_FILL_Y,
181 0, 0, 0, 0, 1, 1, 1, 1);
182 label=
new FOX16_HtmlLabel(vf, FXString(testString), LAYOUT_FILL_X|LAYOUT_FILL_Y);
183 new FXSpring(vf, LAYOUT_FILL_X | LAYOUT_FILL_Y);
184 new FXLabel(vf,
"Normal Testlabel");
187 dbox->resize(300, 200);
197 FXApp application(
"libtest",
"Martin Preuss");
205 application.init(argc,argv);
207 application.create();
217 "<p><b>Test</b> f\xc3\xbcr Umlaute.</p>"
221 for (i1=1; i1<=10; i1++) {
224 snprintf(numbuf,
sizeof(numbuf)-1,
"Step %d", (
int)i1);
230 "Starting 2nd progress...",
233 for (i2=1; i2<=10; i2++) {
235 fprintf(stderr,
"Advancing %d/%d\n", (
int)i1, (
int)i2);
238 fprintf(stderr,
"Aborted by user\n");
246 fprintf(stderr,
"Aborted by user\n");
259 FXApp a(
"libtest",
"Martin Preuss");
264 const char testString[]=
268 "This is <b>a</b> test. "
269 "And this, is the second line: followed by something else."
270 "<right>This should be right aligned</right>"
278 " <td>this is longer data (data2)</td>"
281 "And this is after the table.<br>"
282 "and this <font color=\"red\">one</font> is red.";
284 "This is before right"
285 "<right>Right</right>"
286 "and this after right.";
294 dbox=
new FXDialogBox(&a,
"Test", DECOR_ALL);
295 vf=
new FXVerticalFrame(dbox, LAYOUT_FILL_X | LAYOUT_FILL_Y,
296 0, 0, 0, 0, 1, 1, 1, 1);
298 LAYOUT_FILL_X|LAYOUT_FILL_Y |
299 HSCROLLING_OFF | VSCROLLER_ALWAYS);
300 new FXSpring(vf, LAYOUT_FILL_X | LAYOUT_FILL_Y);
301 new FXLabel(vf,
"Normal Testlabel");
304 dbox->resize(300, 200);
314 FXApp application(
"libtest",
"Martin Preuss");
322 application.init(argc,argv);
324 application.create();
334 "<p><b>Test</b> f\xc3\xbcr Umlaute.</p>"
338 for (i1=1; i1<=20; i1++) {
341 snprintf(numbuf,
sizeof(numbuf)-1,
"Step %d", (
int)i1);
347 "Starting 2nd progress...",
350 for (i2=1; i2<=5; i2++) {
352 fprintf(stderr,
"Advancing %d/%d\n", (
int)i1, (
int)i2);
356 fprintf(stderr,
"Aborted by user\n");
364 fprintf(stderr,
"Aborted by user\n");
377 FXApp application(
"libtest",
"Martin Preuss");
381 application.init(argc,argv);
383 application.create();
390 "<html>This is the text.</html>This is ASCII",
403 FXApp application(
"libtest",
"Martin Preuss");
408 application.init(argc,argv);
410 application.create();
421 fprintf(stderr,
"Could not create dialog.\n");
426 fprintf(stderr,
"Result: %d\n", rv);
434 FXApp application(
"libtest",
"Martin Preuss");
439 application.init(argc,argv);
441 application.create();
452 fprintf(stderr,
"Could not create dialog.\n");
457 fprintf(stderr,
"Result: %d\n", rv);
465 int main(
int argc,
char **argv) {
467 if (strcasecmp(argv[1],
"1")==0)
468 return test1(argc, argv);
469 else if (strcasecmp(argv[1],
"2")==0)
470 return test2(argc, argv);
471 else if (strcasecmp(argv[1],
"3")==0)
472 return test3(argc, argv);
473 else if (strcasecmp(argv[1],
"4")==0)
474 return test4(argc, argv);
475 else if (strcasecmp(argv[1],
"5")==0)
476 return test5(argc, argv);
477 else if (strcasecmp(argv[1],
"6")==0)
478 return test6(argc, argv);
479 else if (strcasecmp(argv[1],
"7")==0)
480 return test7(argc, argv);
481 else if (strcasecmp(argv[1],
"8")==0)
482 return test8(argc, argv);
483 else if (strcasecmp(argv[1],
"9")==0)
484 return test9(argc, argv);
487 return test7(argc, argv);