themes: Workaround for bug where a background color of RGB 0,0,0 in Black color schem...
[ntk.git] / src / Fl_Theme_Chooser.fl
blob4e858bea047b1987b4b011ee3504d8604222bec5
1 # data file for the Fltk User Interface Designer (fluid)
2 version 1.0300 
3 header_name {../FL/Fl_Theme_Chooser.H} 
4 code_name {.cxx}
5 decl {\#include "FL/Fl_Theme.H"} {public global
6
8 decl {\#include <FL/Fl_Button.H>} {public global
9
11 decl {\#include <FL/Fl_Color_Chooser.H>} {private local
12
14 decl {\#include <FL/Fl_Double_Window.H>} {private local
15
17 class Fl_Color_Button {open : {public Fl_Button}
18 } {
19   Function {Fl_Color_Button( int X, int Y, int W, int H, const char *L = 0 ) : Fl_Button( X, Y, W, H, L )} {open
20   } {
21     code {} {}
22   }
23   Function {handle( int m )} {open return_type int
24   } {
25     code {switch ( m )
27         case FL_PUSH:
28         {
29                 uchar r, g, b;
31                 Fl::get_color( color(), r, g, b );
33                 fl_color_chooser( label(), r, g, b );
35                 color( fl_rgb_color( r, g, b ) );
36                 
37                 do_callback();
38                         
39                 return 1;
40         }
43 return Fl_Button::handle( m );} {}
44   }
45
47 widget_class Fl_Theme_Chooser {
48   label Theme open
49   xywh {560 246 435 380} type Double
50   class Fl_Double_Window visible
51 } {
52   Fl_Choice theme_choice {
53     label {Theme:}
54     callback {Fl_Theme::set( o->mvalue()->label() );
56 redraw();} open
57     xywh {120 20 300 25} down_box BORDER_BOX
58   } {}
59   Fl_Choice color_scheme_choice {
60     label {Color Scheme:}
61     callback {Fl_Color_Scheme::set( o->mvalue()->label() );
63 redraw();} open
64     xywh {120 48 300 25} down_box BORDER_BOX
65   } {}
66   Fl_Return_Button {} {
67     label OK
68     callback {Fl_Theme::save(); Fl_Color_Scheme::save(); hide();} selected
69     xywh {355 345 75 25}
70   }
71   Fl_Group {} {
72     label Example open
73     xywh {5 215 425 120} box ENGRAVED_FRAME
74   } {
75     Fl_Scrollbar {} {
76       label {Scroll Bar}
77       xywh {155 240 265 25} type Horizontal align 1
78     }
79     Fl_Check_Button {} {
80       label {Check Button}
81       xywh {15 230 120 15} down_box DOWN_BOX
82     }
83     Fl_Dial {} {
84       label Dial
85       xywh {155 275 35 35}
86     }
87     Fl_Progress {} {
88       label Progress
89       xywh {240 300 185 30}
90       code0 {o->value( 0.50 );}
91     }
92     Fl_Light_Button {} {
93       label {Light Button}
94       xywh {15 285 120 35}
95     }
96   }
97   Fl_Button background_color_button {
98     label {Background 1:}
99     callback {uchar r,g,b;
101 Fl::get_color( o->color(), r,g,b );
103 Fl::background( r,g,b );
105 o->window()->redraw();
108     xywh {120 76 300 25} box BORDER_BOX align 4 when 6
109     code0 {\#include <FL/fl_ask.H>}
110     code1 {o->color( FL_BACKGROUND_COLOR );}
111     class Fl_Color_Button
112   }
113   Fl_Button background2_color_button {
114     label {Background 2:}
115     callback {uchar r,g,b;
117 Fl::get_color( o->color(), r,g,b );
119 Fl::background2( r,g,b );
121 o->window()->redraw();
123     xywh {120 104 300 25} box BORDER_BOX align 4
124     code1 {o->color( FL_BACKGROUND2_COLOR );}
125     class Fl_Color_Button
126   }
127   Fl_Button foreground_color_button {
128     label {Foreground:}
129     callback {uchar r,g,b;
131 Fl::get_color( o->color(), r,g,b );
133 Fl::foreground( r,g,b );
135 o->window()->redraw();
138     xywh {120 132 300 25} box BORDER_BOX align 4
139     code1 {o->color( FL_FOREGROUND_COLOR );}
140     class Fl_Color_Button
141   }
142   Fl_Button selection_color_button {
143     label {Selection:}
144     xywh {120 160 300 25} box BORDER_BOX align 4 hide
145     class Fl_Color_Button
146   }
147   code {{
148 Fl_Theme **ta = Fl_Theme::get();
150 for ( Fl_Theme **t = ta; *t; t++ )
151     theme_choice->add( (*t)->name() );
153 free( ta );
155 const Fl_Menu_Item *item = theme_choice->find_item( Fl_Theme::current()->name() );
157 theme_choice->value( item );
161 Fl_Color_Scheme **ta = Fl_Color_Scheme::get();
163 for ( Fl_Color_Scheme **t = ta; *t; t++ )
164     color_scheme_choice->add( (*t)->name() );
166 free( ta );
167 }} {}
170 Function {fl_theme_chooser()} {open C return_type void
171 } {
172   code {Fl_Window *w = new Fl_Theme_Chooser();
174 w->end();
175 w->show();
177 while( w->shown() )
178   Fl::wait();} {}