summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--test/demo.cxx45
-rw-r--r--test/input_choice.cxx3
-rw-r--r--test/tiled_image.cxx3
4 files changed, 34 insertions, 19 deletions
diff --git a/CHANGES b/CHANGES
index 207a01e74..7de87594f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - The demo master test program now supports scheme
+ selection and all demos use it (STR #1459)
- fl_arc() and fl_pie() did not draw properly on WIN32
when the start and end points were identical (STR
#1461)
diff --git a/test/demo.cxx b/test/demo.cxx
index ece3369bd..aa0b7734c 100644
--- a/test/demo.cxx
+++ b/test/demo.cxx
@@ -41,6 +41,7 @@
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
+#include <FL/Fl_Choice.H>
#include <FL/filename.H>
#include <FL/x.H>
@@ -49,33 +50,46 @@
void doexit(Fl_Widget *, void *);
void doback(Fl_Widget *, void *);
void dobut(Fl_Widget *, long);
+void doscheme(Fl_Choice *c, void *) {
+ Fl::scheme(c->text(c->value()));
+}
Fl_Window *form;
Fl_Button *but[9];
void create_the_forms() {
Fl_Widget *obj;
- form = new Fl_Window(370, 450);
- obj = new Fl_Box(FL_FRAME_BOX,20,390,330,40,"FLTK Demonstration");
+ form = new Fl_Window(350, 440);
+ obj = new Fl_Box(FL_FRAME_BOX,10,385,330,40,"FLTK Demonstration");
obj->color(FL_GRAY-4);
obj->labelsize(24);
obj->labelfont(FL_BOLD);
obj->labeltype(FL_ENGRAVED_LABEL);
- obj = new Fl_Box(FL_FRAME_BOX,20,50,330,330,0);
+ obj = new Fl_Box(FL_FRAME_BOX,10,45,330,330,0);
obj->color(FL_GRAY-8);
- obj = new Fl_Button(130,10,110,30,"Exit");
+ obj = new Fl_Button(280,10,60,25,"Exit");
obj->callback(doexit);
- obj = new Fl_Button(20,50,330,380); obj->type(FL_HIDDEN_BUTTON);
+ Fl_Choice *choice = new Fl_Choice(75, 10, 100, 25, "Scheme:");
+ choice->labelfont(FL_HELVETICA_BOLD);
+ choice->add("none");
+ choice->add("gtk+");
+ choice->add("plastic");
+ choice->callback((Fl_Callback *)doscheme);
+ Fl::scheme(NULL);
+ if (!Fl::scheme()) choice->value(0);
+ else if (!strcmp(Fl::scheme(), "gtk+")) choice->value(1);
+ else choice->value(2);
+ obj = new Fl_Button(10,45,330,380); obj->type(FL_HIDDEN_BUTTON);
obj->callback(doback);
- obj = but[0] = new Fl_Button(40,270,90,90);
- obj = but[1] = new Fl_Button(140,270,90,90);
- obj = but[2] = new Fl_Button(240,270,90,90);
- obj = but[5] = new Fl_Button(240,170,90,90);
- obj = but[4] = new Fl_Button(140,170,90,90);
- obj = but[3] = new Fl_Button(40,170,90,90);
- obj = but[6] = new Fl_Button(40,70,90,90);
- obj = but[7] = new Fl_Button(140,70,90,90);
- obj = but[8] = new Fl_Button(240,70,90,90);
+ obj = but[0] = new Fl_Button(30,265,90,90);
+ obj = but[1] = new Fl_Button(130,265,90,90);
+ obj = but[2] = new Fl_Button(230,265,90,90);
+ obj = but[5] = new Fl_Button(230,165,90,90);
+ obj = but[4] = new Fl_Button(130,165,90,90);
+ obj = but[3] = new Fl_Button(30,165,90,90);
+ obj = but[6] = new Fl_Button(30,65,90,90);
+ obj = but[7] = new Fl_Button(130,65,90,90);
+ obj = but[8] = new Fl_Button(230,65,90,90);
for (int i=0; i<9; i++) {
but[i]->align(FL_ALIGN_WRAP);
but[i]->callback(dobut, i);
@@ -321,7 +335,6 @@ int load_the_menu(const char* fname)
int main(int argc, char **argv) {
putenv((char *)"FLTK_DOCDIR=../documentation");
- create_the_forms();
char buf[256];
strcpy(buf, argv[0]);
#if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
@@ -336,6 +349,8 @@ int main(int argc, char **argv) {
Fl::fatal("Usage: %s <switches> <menufile>\n%s",argv[0],Fl::help);
if (i < argc) fname = argv[i];
+ create_the_forms();
+
if (!load_the_menu(fname)) Fl::fatal("Can't open %s",fname);
if (buf!=fname)
strcpy(buf,fname);
diff --git a/test/input_choice.cxx b/test/input_choice.cxx
index 39fc40482..6f7471330 100644
--- a/test/input_choice.cxx
+++ b/test/input_choice.cxx
@@ -3,7 +3,7 @@
//
// Test program for Fl_Input_Choice
//
-// Copyright 1998-2005 by Bill Spitzak and others.
+// Copyright 1998-2006 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -40,7 +40,6 @@ void input_choice_cb(Fl_Widget*,void*data) {
}
int main(int argc, char **argv) {
- Fl::scheme("plastic"); // optional
Fl_Window win(300, 200);
Fl_Input_Choice in(40,40,100,28,"Test");
diff --git a/test/tiled_image.cxx b/test/tiled_image.cxx
index 90feef767..0a3d86864 100644
--- a/test/tiled_image.cxx
+++ b/test/tiled_image.cxx
@@ -3,7 +3,7 @@
//
// Fl_Tiled_Image test program for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2005 by Bill Spitzak and others.
+// Copyright 1998-2006 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -90,7 +90,6 @@ int main(int argc, char **argv) {
Fl_Button b(340,365,50,25,"Close"); ::b = &b;
b.callback(button_cb);
- b.box(FL_PLASTIC_UP_BOX);
group.end();