summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2017-12-13 18:30:19 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2017-12-13 18:30:19 +0000
commit0a61f9d7395530ec80361a036b54374bd6688f01 (patch)
treef482f62013429db354a8e5a6bf9a3f603cdbf47b
parentbc4662fd23fb28bfa9e04d8a26cd9c17d8db3225 (diff)
Improve schemes unittest (add selection colors to buttons).
Use check and radio buttons with different selection colors to verify selection colors with different schemes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12590 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--test/unittest_schemes.cxx18
-rw-r--r--test/unittests.cxx11
2 files changed, 17 insertions, 12 deletions
diff --git a/test/unittest_schemes.cxx b/test/unittest_schemes.cxx
index 2efcaac82..6c1d7273a 100644
--- a/test/unittest_schemes.cxx
+++ b/test/unittest_schemes.cxx
@@ -3,7 +3,7 @@
//
// Unit tests for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2017 by Bill Spitzak and others.
//
// Nods to Edmanuel Torres for the widget layout (STR#2672)
//
@@ -200,21 +200,25 @@ public:
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(15, 140, 310, 190, "tab4");
- //o->box(FL_THIN_UP_BOX);
+ // o->box(FL_THIN_UP_BOX);
o->color(FL_DARK1);
o->hide();
{ Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 160, 120, 25, "Choice 1");
- o->tooltip("Fl_Radio_Round_Button");
+ o->tooltip("Fl_Radio_Round_Button (default)");
+ // don't set selection color (use default selection color)
o->value(1); // selected
} // Fl_Radio_Round_Button* o
{ Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 190, 120, 25, "Choice 2");
- o->tooltip("Fl_Radio_Round_Button");
+ o->tooltip("Fl_Radio_Round_Button (red)");
+ o->selection_color(FL_RED);
} // Fl_Radio_Round_Button* o
{ Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 220, 120, 25, "Choice 3");
- o->tooltip("Fl_Radio_Round_Button");
+ o->tooltip("Fl_Radio_Round_Button (green)");
+ o->selection_color(FL_GREEN);
} // Fl_Radio_Round_Button* o
{ Fl_Radio_Round_Button* o = new Fl_Radio_Round_Button(40, 250, 120, 25, "Choice 4");
- o->tooltip("Fl_Radio_Round_Button");
+ o->tooltip("Fl_Radio_Round_Button (blue)");
+ o->selection_color(FL_BLUE);
} // Fl_Radio_Round_Button* o
o->end();
} // Fl_Group* o
@@ -281,12 +285,14 @@ public:
o->box(FL_DOWN_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->selection_color((Fl_Color)30);
+ o->selection_color((Fl_Color)FL_RED);
o->tooltip("Fl_Light_Button with down box");
} // Fl_Light_Button* o
{ Fl_Check_Button* o = new Fl_Check_Button(110, 37, 105, 25, "Check");
o->box(FL_DOWN_FRAME);
o->down_box(FL_DOWN_BOX);
o->color(FL_DARK1);
+ o->selection_color((Fl_Color)FL_GREEN);
o->tooltip("Fl_Check_Button with down frame");
} // Fl_Check_Button* o
{ Fl_Input* o = new Fl_Input(220, 10, 100, 25);
diff --git a/test/unittests.cxx b/test/unittests.cxx
index a0d06b35e..5d0a4ad6e 100644
--- a/test/unittests.cxx
+++ b/test/unittests.cxx
@@ -3,7 +3,7 @@
//
// Unit tests for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2017 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -49,7 +49,7 @@ class MainWindow *mainwin = 0;
Fl_Hold_Browser *browser = 0;
// This class helps to automagically register a new test with the unittest app.
-// Please see the examples on how this is used.
+// Please see the examples on how this is used.
class UnitTest {
public:
UnitTest(const char *label, Fl_Widget* (*create)()) :
@@ -95,7 +95,7 @@ int UnitTest::nTest = 0;
UnitTest *UnitTest::fTest[200];
-// The main window needs an additional drawing feature in order to support
+// The main window needs an additional drawing feature in order to support
// the viewport alignment test.
class MainWindow : public Fl_Double_Window {
public:
@@ -168,14 +168,14 @@ void Browser_CB(Fl_Widget*, void*) {
}
-// this is the main call. It creates the window and adds all previously
+// This is the main call. It creates the window and adds all previously
// registered tests to the browser widget.
int main(int argc, char **argv) {
Fl::args(argc,argv);
Fl::get_system_colors();
Fl::scheme(Fl::scheme()); // init scheme before instantiating tests
Fl::visual(FL_RGB);
- mainwin = new MainWindow(MAINWIN_W, MAINWIN_H, "Fltk Unit Tests");
+ mainwin = new MainWindow(MAINWIN_W, MAINWIN_H, "FLTK Unit Tests");
browser = new Fl_Hold_Browser(BROWSER_X, BROWSER_Y, BROWSER_W, BROWSER_H, "Unit Tests");
browser->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
browser->when(FL_WHEN_CHANGED);
@@ -190,7 +190,6 @@ int main(int argc, char **argv) {
browser->add(t->label(), (void*)t);
}
- /////
mainwin->resizable(mainwin);
mainwin->show(argc,argv);
// Select first test in browser, and show that test.