From 349f32693398b57d4273f4a6abed9bd9db5d4e56 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 8 Jul 2015 23:41:19 +0000 Subject: Fix compiler warning, add inactive (deactivated) box test mode. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10780 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/boxtype.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/boxtype.cxx b/test/boxtype.cxx index 806be0220..d344db7a5 100644 --- a/test/boxtype.cxx +++ b/test/boxtype.cxx @@ -49,13 +49,14 @@ int N = 0; static const int outline = 0; // draw 1-px red frame around all boxes static const int box_bg = 0; // draw white background inside all boxes +static const int inactive = 0; // deactivate boxes and use green background class BoxGroup : public Fl_Group { public: BoxGroup(int x, int y, int w, int h) : Fl_Group(x,y,w,h) {}; void draw() { draw_box(); - if (outline||box_bg) { + if (outline + box_bg) { // outline or box_bg or both Fl_Widget*const* a = array(); for (int i=children(); i--;) { Fl_Widget& o = **a++; @@ -69,7 +70,7 @@ class BoxGroup : public Fl_Group { } fl_color(FL_BLACK); } - } // outline || box_bg + } // outline or box_bg or both Fl_Group::draw_children(); } // draw() }; // class BoxGroup @@ -84,6 +85,10 @@ void bt(const char *name, Fl_Boxtype type, int square=0) { y = y*H+10; Fl_Box *b = new Fl_Box(type,x,y,square ? H-20 : W-20,H-20,name); b->labelsize(11); + if (inactive) { + b->color(FL_GREEN); + b->deactivate(); + } if (square) b->align(FL_ALIGN_RIGHT); } -- cgit v1.2.3