diff options
| -rw-r--r-- | CHANGES | 14 | ||||
| -rw-r--r-- | FL/Enumerations.H | 56 | ||||
| -rw-r--r-- | documentation/enumerations.html | 159 | ||||
| -rw-r--r-- | src/Fl_Browser_.cxx | 9 | ||||
| -rw-r--r-- | src/Fl_Choice.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Color_Chooser.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Counter.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Dial.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Help_View.cxx | 9 | ||||
| -rw-r--r-- | src/Fl_Input_.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Light_Button.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Progress.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Slider.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Text_Display.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_get_system_colors.cxx | 11 | ||||
| -rw-r--r-- | src/fl_color.cxx | 8 | ||||
| -rw-r--r-- | src/fl_set_gray.cxx | 12 |
18 files changed, 221 insertions, 135 deletions
@@ -1,3 +1,17 @@ +CHANGES IN FLTK 1.1.0 + + - Some source files still used the "false" and "true" + C++ keywords, even though several of our "supported" + C++ compilers don't support them. Using 0 and 1 until + FLTK 2.0 (which uses the bool type instead of int for + any boolean values...) + - Minor Fl_Color revamping, so that color constants map + to the color cube and FL_FOREGROUND_COLOR, + FL_BACKGROUND_COLOR, FL_BACKGROUND2_COLOR, + FL_INACTIVE_COLOR, and FL_SELECTION_COLOR map to the + user-defined colors. + + CHANGES IN FLTK 1.1.0b13 - Fixed a bug in the Xft support in Fl_Window::hide() diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 650ac4169..fe76d36d9 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -1,5 +1,5 @@ // -// "$Id: Enumerations.H,v 1.18.2.14.2.21 2002/03/25 21:08:41 easysw Exp $" +// "$Id: Enumerations.H,v 1.18.2.14.2.22 2002/04/11 10:46:19 easysw Exp $" // // Enumerations for the Fast Light Tool Kit (FLTK). // @@ -272,48 +272,58 @@ enum Fl_Font { // standard fonts extern FL_EXPORT int FL_NORMAL_SIZE; enum Fl_Color { // standard colors - FL_BLACK = 0, - FL_RED = 1, - FL_GREEN = 2, - FL_YELLOW = 3, - FL_BLUE = 4, - FL_MAGENTA = 5, - FL_CYAN = 6, - FL_WHITE = 7, + // These are used as default colors in widgets and altered as necessary + FL_FOREGROUND_COLOR = 0, + FL_BACKGROUND2_COLOR = 7, FL_INACTIVE_COLOR = 8, FL_SELECTION_COLOR = 15, - FL_FREE_COLOR = 16, - FL_NUM_FREE_COLOR = 16, - - FL_GRAY_RAMP = 32, - - // boxtypes limit themselves to these colors so whole ramp is not allocated: + // boxtypes generally limit themselves to these colors so + // the whole ramp is not allocated: FL_GRAY0 = 32, // 'A' FL_DARK3 = 39, // 'H' FL_DARK2 = 45, // 'N' FL_DARK1 = 47, // 'P' - FL_GRAY = 49, // 'R' default color + FL_BACKGROUND_COLOR = 49, // 'R' default background color FL_LIGHT1 = 50, // 'S' FL_LIGHT2 = 52, // 'U' FL_LIGHT3 = 54, // 'W' - FL_COLOR_CUBE = 56 + // FLTK provides a 5x8x5 color cube that is used with colormap visuals + FL_BLACK = 56, + FL_RED = 88, + FL_GREEN = 63, + FL_YELLOW = 95, + FL_BLUE = 216, + FL_MAGENTA = 248, + FL_CYAN = 223, + FL_WHITE = 255 }; +#define FL_FREE_COLOR (Fl_Color)16 +#define FL_NUM_FREE_COLOR 16 +#define FL_GRAY_RAMP (Fl_Color)32 +#define FL_NUM_GRAY 24 +#define FL_GRAY FL_BACKGROUND_COLOR +#define FL_COLOR_CUBE (Fl_Color)56 +#define FL_NUM_RED 5 +#define FL_NUM_GREEN 8 +#define FL_NUM_BLUE 5 + FL_EXPORT Fl_Color fl_inactive(Fl_Color c); FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg); FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight); inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); } inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); } inline Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) { - return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8); + if (!r && !g && !b) return FL_BLACK; + else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8); +} +inline Fl_Color fl_rgb_color(uchar g) { + if (!g) return FL_BLACK; + else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8); } -#define FL_NUM_GRAY 24 inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);} -#define FL_NUM_RED 5 -#define FL_NUM_GREEN 8 -#define FL_NUM_BLUE 5 inline Fl_Color fl_color_cube(int r, int g, int b) { return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);} @@ -378,5 +388,5 @@ enum Fl_Damage { #endif // -// End of "$Id: Enumerations.H,v 1.18.2.14.2.21 2002/03/25 21:08:41 easysw Exp $". +// End of "$Id: Enumerations.H,v 1.18.2.14.2.22 2002/04/11 10:46:19 easysw Exp $". // diff --git a/documentation/enumerations.html b/documentation/enumerations.html index 9651a9e22..8c6c98951 100644 --- a/documentation/enumerations.html +++ b/documentation/enumerations.html @@ -1,9 +1,11 @@ <HTML><BODY> <H1 ALIGN=RIGHT><A NAME=Enumerations>C - FLTK Enumerations</A></H1> - This appendix lists the enumerations provided in the <TT> -<FL/Enumerations.H></TT> header file, organized by section. -Constants whose value is zero are marked with "(0)", this is often -useful to know when programming. + +<P>This appendix lists the enumerations provided in the +<TT><FL/Enumerations.H></TT> header file, organized by +section. Constants whose value is zero are marked with "(0)", +this is often useful to know when programming. + <H2>Version Numbers</H2> The FLTK version number is stored in a number of compile-time constants: @@ -177,42 +179,93 @@ bold-oblique. </LI> </ul> <H2><a name=colors>Colors</A></H2> - The following color constants can be used to access the colors in the -FLTK standard color palette: + +<P>The <TT>Fl_Color</TT> enumeration type holds a FLTK color value. +Colors are either 8-bit indexes into a virtual colormap or 24-bit RGB +color values. Color indices occupy the lower 8 bits of the value, while +RGB colors occupy the upper 24 bits, for a byte organization of RGBI. + +<H3>Color Constants</H3> + +<P>Constants are defined for the user-defined foreground and background +colors, as well as specific colors and the start of the grayscale ramp +and color cube in the virtual colormap. Inline functions are provided to +retrieve specific grayscale, color cube, or RGB color values. + +<P>The following color constants can be used to access the user-defined +colors: + +<UL> + + <LI><TT>FL_BACKGROUND_COLOR</TT> - the default + background color</LI> + + <LI><TT>FL_BACKGROUND2_COLOR</TT> - the default + background color for text, list, and valuator widgets</LI> + + <LI><TT>FL_FOREGROUND_COLOR</TT> - the default + foreground color (0) used for labels and text</LI> + + <LI><TT>FL_INACTIVE_COLOR</TT> - the inactive foreground + color</LI> + + <LI><TT>FL_SELECTION_COLOR</TT> - the default selection/highlight + color</LI> + +</UL> + +<P>The following color constants can be used to access the colors from the +FLTK standard color cube: + <UL> -<LI><TT>FL_BLACK</TT> - the default label color (0)</LI> -<LI><TT>FL_RED</TT></LI> -<LI><TT>FL_GREEN</TT></LI> -<LI><TT>FL_YELLOW</TT></LI> -<LI><TT>FL_BLUE</TT></LI> -<LI><TT>FL_MAGENTA</TT></LI> -<LI><TT>FL_CYAN</TT></LI> -<LI><TT>FL_WHITE</TT> - the default background for text</LI> -<LI><TT>FL_SELECTION_COLOR</TT> - change to dark blue for Windows style</LI> -<LI><TT>FL_GRAY</TT> - the default color.</LI> + + <LI><TT>FL_BLACK</TT></LI> + <LI><TT>FL_RED</TT></LI> + <LI><TT>FL_GREEN</TT></LI> + <LI><TT>FL_YELLOW</TT></LI> + <LI><TT>FL_BLUE</TT></LI> + <LI><TT>FL_MAGENTA</TT></LI> + <LI><TT>FL_CYAN</TT></LI> + <LI><TT>FL_WHITE</TT></LI> + </UL> -In addition there are two inline functions to allow you to select -grays or colors from the FLTK colormap: +<P>The inline methods for getting a grayscale, color cube, or RGB color +value are described next. + +<H3>Color Functions</H3> + +<H4>Fl_Color fl_gray_ramp(int i)</H4> + +<P>Returns a gray color value from black (<TT>i == 0</TT>) to +white (<TT>i == FL_NUM_GRAY - 1</TT>). <TT>FL_NUM_GRAY</TT> is +defined to be 24 in the current FLTK release. To get the closest +FLTK gray value to an 8-bit grayscale color 'I' use: -<p><b>Fl_Color fl_gray_ramp(int i)</b> -<br>Returns a gray color. Returns black for zero, returns white for -<tt>FL_NUM_GRAY</tt> (which is 24) minus 1. To get the closest to an -8-bit gray value 'I' use -<tt>fl_gray_ramp(I*FL_NUM_GRAY/256)</tt> +<UL><PRE> +fl_gray_ramp(I * (FL_NUM_GRAY - 1) / 255) +</PRE></UL> -<p><b>Fl_Color fl_color_cube(int r, int g, int b)</b> -<br>Returns a color out of the color cube. +<H4>Fl_Color fl_color_cube(int r, int g, int b)</H4> +<P>Returns a color out of the color cube. <tt>r</tt> must be in the range 0 to FL_NUM_RED (5) minus 1. <tt>g</tt> must be in the range 0 to FL_NUM_GREEN (8) minus 1. <tt>b</tt> must be in the range 0 to FL_NUM_BLUE (5) minus 1. -To get the closest color to a 8-bit set of R,G,B values use -<tt>fl_color_cube(R*FL_NUM_RED/256, G*FL_NUM_GREEN/256, -B*FL_NUM_BLUE/256);</tt> +<P>To get the closest color to a 8-bit set of R,G,B values use: -<p><a name="fl_rgb_color"><b>Fl_Color fl_rgb_color(uchar r, uchar g, uchar b)</b></a> +<UL><PRE> +fl_color_cube(R * (FL_NUM_RED - 1) / 255, + G * (FL_NUM_GREEN - 1) / 255, + B * (FL_NUM_BLUE - 1) / 255); +</PRE></UL> + +<H4><a name="fl_rgb_color">Fl_Color fl_rgb_color(uchar r, uchar g, uchar b)<BR> +Fl_Color fl_rgb_color(uchar g)</a></H4> + +<P>Returns the 24-bit RGB color value for the specified 8-bit +RGB or grayscale values. <H2><a name=cursor>Cursors</A></H2> @@ -220,30 +273,40 @@ B*FL_NUM_BLUE/256);</tt> FLTK. The double-headed arrows are bitmaps provided by FLTK on X, the others are provided by system-defined cursors.</P> + <UL> -<LI><TT>FL_CURSOR_DEFAULT</TT> - the default cursor, usually an arrow (0)</LI> -<LI><TT>FL_CURSOR_ARROW</TT> - an arrow pointer </LI> -<LI><TT>FL_CURSOR_CROSS</TT> - crosshair </LI> -<LI><TT>FL_CURSOR_WAIT</TT> - watch or hourglass </LI> -<LI><TT>FL_CURSOR_INSERT</TT> - I-beam </LI> -<LI><TT>FL_CURSOR_HAND</TT> - hand (uparrow on MSWindows) </LI> -<LI><TT>FL_CURSOR_HELP</TT> - question mark </LI> -<LI><TT>FL_CURSOR_MOVE</TT> - 4-pointed arrow </LI> -<LI><TT>FL_CURSOR_NS</TT> - up/down arrow </LI> -<LI><TT>FL_CURSOR_WE</TT> - left/right arrow </LI> -<LI><TT>FL_CURSOR_NWSE</TT> - diagonal arrow </LI> -<LI><TT>FL_CURSOR_NESW</TT> - diagonal arrow </LI> -<LI><TT>FL_CURSOR_NONE</TT> - invisible </LI> + + <LI><TT>FL_CURSOR_DEFAULT</TT> - the default cursor, usually an arrow (0)</LI> + <LI><TT>FL_CURSOR_ARROW</TT> - an arrow pointer </LI> + <LI><TT>FL_CURSOR_CROSS</TT> - crosshair </LI> + <LI><TT>FL_CURSOR_WAIT</TT> - watch or hourglass </LI> + <LI><TT>FL_CURSOR_INSERT</TT> - I-beam </LI> + <LI><TT>FL_CURSOR_HAND</TT> - hand (uparrow on MSWindows) </LI> + <LI><TT>FL_CURSOR_HELP</TT> - question mark </LI> + <LI><TT>FL_CURSOR_MOVE</TT> - 4-pointed arrow </LI> + <LI><TT>FL_CURSOR_NS</TT> - up/down arrow </LI> + <LI><TT>FL_CURSOR_WE</TT> - left/right arrow </LI> + <LI><TT>FL_CURSOR_NWSE</TT> - diagonal arrow </LI> + <LI><TT>FL_CURSOR_NESW</TT> - diagonal arrow </LI> + <LI><TT>FL_CURSOR_NONE</TT> - invisible </LI> + </UL> + <H2>FD "When" Conditions</H2> + <UL> -<LI><TT>FL_READ</TT> - Call the callback when there is data to be - read. </LI> -<LI><TT>FL_WRITE</TT> - Call the callback when data can be written - without blocking. </LI> -<LI><TT>FL_EXCEPT</TT> - Call the callback if an exception occurs on - the file. </LI> + + <LI><TT>FL_READ</TT> - Call the callback when there is data to be + read.</LI> + + <LI><TT>FL_WRITE</TT> - Call the callback when data can be written + without blocking.</LI> + + <LI><TT>FL_EXCEPT</TT> - Call the callback if an exception occurs on + the file.</LI> + </UL> + <H2><a name=damage>Damage Masks</A></H2> The following damage mask bits are used by the standard FLTK widgets: <UL> diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx index 19a6afde4..0741ea11e 100644 --- a/src/Fl_Browser_.cxx +++ b/src/Fl_Browser_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.10 2002/01/01 15:11:30 easysw Exp $" +// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.11 2002/04/11 10:46:19 easysw Exp $" // // Base Browser widget class for the Fast Light Tool Kit (FLTK). // @@ -671,15 +671,14 @@ Fl_Browser_::Fl_Browser_(int x, int y, int w, int h, const char* l) top_ = 0; when(FL_WHEN_RELEASE_ALWAYS); selection_ = 0; - color(FL_WHITE); - selection_color(FL_SELECTION_COLOR); + color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR); scrollbar.callback(scrollbar_callback); //scrollbar.align(FL_ALIGN_LEFT|FL_ALIGN_BOTTOM); // back compatability? hscrollbar.callback(hscrollbar_callback); hscrollbar.type(FL_HORIZONTAL); textfont_ = FL_HELVETICA; textsize_ = FL_NORMAL_SIZE; - textcolor_ = FL_BLACK; + textcolor_ = FL_FOREGROUND_COLOR; has_scrollbar_ = BOTH; max_width = 0; max_width_item = 0; @@ -713,5 +712,5 @@ void Fl_Browser_::item_select(void*, int) {} int Fl_Browser_::item_selected(void* l) const {return l==selection_;} // -// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.10 2002/01/01 15:11:30 easysw Exp $". +// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.11 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx index e593e9adc..3ed71d97c 100644 --- a/src/Fl_Choice.cxx +++ b/src/Fl_Choice.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.8 2002/03/26 00:50:16 easysw Exp $" +// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $" // // Choice widget for the Fast Light Tool Kit (FLTK). // @@ -81,7 +81,7 @@ Fl_Choice::Fl_Choice(int x,int y,int w,int h, const char *l) textfont(FL_HELVETICA); box(FL_FLAT_BOX); down_box(FL_BORDER_BOX); - color(FL_WHITE); + color(FL_BACKGROUND2_COLOR); } int Fl_Choice::value(int v) { @@ -128,5 +128,5 @@ int Fl_Choice::handle(int e) { } // -// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.8 2002/03/26 00:50:16 easysw Exp $". +// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Color_Chooser.cxx b/src/Fl_Color_Chooser.cxx index bee62ef66..f2b6777f0 100644 --- a/src/Fl_Color_Chooser.cxx +++ b/src/Fl_Color_Chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.3 2002/01/01 15:11:30 easysw Exp $" +// "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.4 2002/04/11 10:46:19 easysw Exp $" // // Color chooser for the Fast Light Tool Kit (FLTK). // @@ -289,7 +289,7 @@ void Flcc_HueBox::draw() { if (X < 0) X = 0; else if (X > w1-6) X = w1-6; if (Y < 0) Y = 0; else if (Y > h1-6) Y = h1-6; // fl_color(c->value()>.75 ? FL_BLACK : FL_WHITE); - draw_box(FL_UP_BOX,x1+X,y1+Y,6,6,Fl::focus() == this ? FL_BLACK : FL_GRAY); + draw_box(FL_UP_BOX,x1+X,y1+Y,6,6,Fl::focus() == this ? FL_FOREGROUND_COLOR : FL_GRAY); px = X; py = Y; } @@ -350,7 +350,7 @@ void Flcc_ValueBox::draw() { if (damage() == FL_DAMAGE_EXPOSE) fl_pop_clip(); int Y = int((1-c->value()) * (h1-6)); if (Y < 0) Y = 0; else if (Y > h1-6) Y = h1-6; - draw_box(FL_UP_BOX,x1,y1+Y,w1,6,Fl::focus() == this ? FL_BLACK : FL_GRAY); + draw_box(FL_UP_BOX,x1,y1+Y,w1,6,Fl::focus() == this ? FL_FOREGROUND_COLOR : FL_GRAY); py = Y; } @@ -521,5 +521,5 @@ int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) { } // -// End of "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.3 2002/01/01 15:11:30 easysw Exp $". +// End of "$Id: Fl_Color_Chooser.cxx,v 1.7.2.4.2.4 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index 1872fb34a..a531cec50 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Counter.cxx,v 1.8.2.3.2.7 2002/03/25 21:08:41 easysw Exp $" +// "$Id: Fl_Counter.cxx,v 1.8.2.3.2.8 2002/04/11 10:46:19 easysw Exp $" // // Counter widget for the Fast Light Tool Kit (FLTK). // @@ -54,7 +54,7 @@ void Fl_Counter::draw() { xx[3] = x()+w()-1*W; ww[3] = W; } - draw_box(boxtype[0], xx[0], y(), ww[0], h(), FL_WHITE); + draw_box(boxtype[0], xx[0], y(), ww[0], h(), FL_BACKGROUND2_COLOR); fl_font(textfont(), textsize()); fl_color(active_r() ? textcolor() : fl_inactive(textcolor())); char str[128]; format(str); @@ -184,9 +184,9 @@ Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char* l) mouseobj = 0; textfont_ = FL_HELVETICA; textsize_ = FL_NORMAL_SIZE; - textcolor_ = FL_BLACK; + textcolor_ = FL_FOREGROUND_COLOR; } // -// End of "$Id: Fl_Counter.cxx,v 1.8.2.3.2.7 2002/03/25 21:08:41 easysw Exp $". +// End of "$Id: Fl_Counter.cxx,v 1.8.2.3.2.8 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index fcc26fd0b..3a09af7a6 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Dial.cxx,v 1.12.2.3.2.1 2002/01/01 15:11:30 easysw Exp $" +// "$Id: Fl_Dial.cxx,v 1.12.2.3.2.2 2002/04/11 10:46:19 easysw Exp $" // // Circular dial widget for the Fast Light Tool Kit (FLTK). // @@ -47,7 +47,7 @@ void Fl_Dial::draw(int x, int y, int w, int h) { fl_color(selection_color()); fl_pie(x, y, w-1, h-1, 270-angle, 270-a1); if (foo) { - fl_color(FL_BLACK); + fl_color(FL_FOREGROUND_COLOR); fl_arc(x, y, w, h, 0, 360); } return; @@ -68,7 +68,7 @@ void Fl_Dial::draw(int x, int y, int w, int h) { fl_vertex(-0.25, 0.25); fl_vertex(0.0, 0.04); fl_end_polygon(); - fl_color(FL_BLACK); + fl_color(FL_FOREGROUND_COLOR); fl_begin_loop(); fl_vertex(0.0, 0.0); fl_vertex(-0.04, 0.0); @@ -77,7 +77,7 @@ void Fl_Dial::draw(int x, int y, int w, int h) { fl_end_loop(); } else { fl_begin_polygon(); fl_circle(-0.20, 0.20, 0.07); fl_end_polygon(); - fl_color(FL_BLACK); + fl_color(FL_FOREGROUND_COLOR); fl_begin_loop(); fl_circle(-0.20, 0.20, 0.07); fl_end_loop(); } fl_pop_matrix(); @@ -131,5 +131,5 @@ Fl_Dial::Fl_Dial(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Dial.cxx,v 1.12.2.3.2.1 2002/01/01 15:11:30 easysw Exp $". +// End of "$Id: Fl_Dial.cxx,v 1.12.2.3.2.2 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 900187262..be6696017 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Help_View.cxx,v 1.1.2.29 2002/03/05 11:26:41 easysw Exp $" +// "$Id: Fl_Help_View.cxx,v 1.1.2.30 2002/04/11 10:46:19 easysw Exp $" // // Fl_Help_View widget routines. // @@ -2230,9 +2230,8 @@ Fl_Help_View::Fl_Help_View(int xx, // I - Left position leftline_ = 0; size_ = 0; - color(FL_WHITE); - textcolor(FL_BLACK); - selection_color(FL_BLUE); + color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR); + textcolor(FL_FOREGROUND_COLOR); scrollbar_.value(0, hh, 0, 1); scrollbar_.step(8.0); @@ -2624,5 +2623,5 @@ hscrollbar_callback(Fl_Widget *s, void *) // -// End of "$Id: Fl_Help_View.cxx,v 1.1.2.29 2002/03/05 11:26:41 easysw Exp $". +// End of "$Id: Fl_Help_View.cxx,v 1.1.2.30 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index ed40d1d48..b60fce213 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.8 2002/04/08 18:32:16 easysw Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.9 2002/04/11 10:46:19 easysw Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -768,12 +768,12 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { Fl_Input_::Fl_Input_(int x, int y, int w, int h, const char* l) : Fl_Widget(x, y, w, h, l) { box(FL_DOWN_BOX); - color(FL_WHITE, FL_SELECTION_COLOR); + color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR); align(FL_ALIGN_LEFT); textsize_ = FL_NORMAL_SIZE; textfont_ = FL_HELVETICA; - textcolor_ = FL_BLACK; - cursor_color_ = FL_BLACK; // was FL_BLUE + textcolor_ = FL_FOREGROUND_COLOR; + cursor_color_ = FL_FOREGROUND_COLOR; // was FL_BLUE mark_ = position_ = size_ = 0; bufsize = 0; buffer = 0; @@ -864,5 +864,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.8 2002/04/08 18:32:16 easysw Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.9 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 499dd470d..8a9ad003f 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.12 2002/03/25 21:08:41 easysw Exp $" +// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.13 2002/04/11 10:46:19 easysw Exp $" // // Lighted button widget for the Fast Light Tool Kit (FLTK). // @@ -53,7 +53,7 @@ void Fl_Light_Button::draw() { case _FL_PLASTIC_DOWN_BOX : case _FL_PLASTIC_UP_BOX : // Check box... - draw_box(down_box(), x()+dx, y()+dy, W, W, FL_WHITE); + draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(col); fl_line_style(FL_SOLID, 2); @@ -66,7 +66,7 @@ void Fl_Light_Button::draw() { case _FL_ROUND_DOWN_BOX : case _FL_ROUND_UP_BOX : // Radio button... - draw_box(down_box(), x()+dx, y()+dy+1, W, W, FL_WHITE); + draw_box(down_box(), x()+dx, y()+dy+1, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(col); int tW = W - Fl::box_dw(down_box()) - 3; @@ -116,5 +116,5 @@ Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.12 2002/03/25 21:08:41 easysw Exp $". +// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.13 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index b6d33ed24..465d01dff 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.8 2002/03/25 22:11:52 easysw Exp $" +// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.9 2002/04/11 10:46:19 easysw Exp $" // // Menu code for the Fast Light Tool Kit (FLTK). // @@ -163,7 +163,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, int W = h - 2 * d; if (flags & FL_MENU_RADIO) { - fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d+1, W, W, FL_WHITE); + fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d+1, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(labelcolor_); int tW = W - Fl::box_dw(FL_ROUND_DOWN_BOX) - 3; @@ -177,7 +177,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, } } } else { - fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_WHITE); + fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(labelcolor_); fl_line_style(FL_SOLID, 2); @@ -756,5 +756,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { } // -// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.8 2002/03/25 22:11:52 easysw Exp $". +// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.9 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index a3d58567f..0bd79f6ef 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Progress.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $" +// "$Id: Fl_Progress.cxx,v 1.1.2.5 2002/04/11 10:46:19 easysw Exp $" // // Progress bar widget routines. // @@ -97,7 +97,7 @@ Fl_Progress::Fl_Progress(int x, int y, int w, int h, const char* l) { align(FL_ALIGN_INSIDE); box(FL_DOWN_BOX); - color(FL_WHITE, FL_YELLOW); + color(FL_BACKGROUND2_COLOR, FL_YELLOW); minimum(0.0f); maximum(100.0f); value(0.0f); @@ -105,5 +105,5 @@ Fl_Progress::Fl_Progress(int x, int y, int w, int h, const char* l) // -// End of "$Id: Fl_Progress.cxx,v 1.1.2.4 2002/01/01 15:11:31 easysw Exp $". +// End of "$Id: Fl_Progress.cxx,v 1.1.2.5 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index b0c66b86e..4330f6d9f 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.5 2002/01/01 15:11:31 easysw Exp $" +// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.6 2002/04/11 10:46:19 easysw Exp $" // // Slider widget for the Fast Light Tool Kit (FLTK). // @@ -86,7 +86,7 @@ void Fl_Slider::draw_bg(int x, int y, int w, int h) { if (!(damage()&FL_DAMAGE_ALL)) { // not a complete redraw draw_box(); } - Fl_Color black = active_r() ? FL_BLACK : FL_INACTIVE_COLOR; + Fl_Color black = active_r() ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR; if (type() == FL_VERT_NICE_SLIDER) { draw_box(FL_THIN_DOWN_BOX, x+w/2-2, y, 4, h, black); } else if (type() == FL_HOR_NICE_SLIDER) { @@ -291,5 +291,5 @@ int Fl_Slider::handle(int event) { } // -// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.5 2002/01/01 15:11:31 easysw Exp $". +// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.6 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index c1299f970..1b34a27b6 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.cxx,v 1.12.2.11 2002/03/07 19:22:56 spitzak Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.12 2002/04/11 10:46:19 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -72,10 +72,10 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) dragPos = dragType = dragging = 0; display_insert_position_hint = 0; - color(FL_WHITE, FL_SELECTION_COLOR); + color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR); box(FL_DOWN_FRAME); textsize(FL_NORMAL_SIZE); - textcolor(FL_BLACK); + textcolor(FL_FOREGROUND_COLOR); textfont(FL_HELVETICA); text_area.x = 0; @@ -1958,5 +1958,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.11 2002/03/07 19:22:56 spitzak Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.12 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index 5c0ce8329..8f216af88 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.6 2002/01/07 18:47:27 easysw Exp $" +// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.7 2002/04/11 10:46:19 easysw Exp $" // // System color support for the Fast Light Tool Kit (FLTK). // @@ -53,12 +53,13 @@ void Fl::background(uchar r, uchar g, uchar b) { } void Fl::foreground(uchar r, uchar g, uchar b) { - Fl::set_color(FL_BLACK,r,g,b); + Fl::set_color(FL_FOREGROUND_COLOR,r,g,b); } void Fl::background2(uchar r, uchar g, uchar b) { - Fl::set_color(FL_WHITE,r,g,b); - Fl::set_color(FL_BLACK,get_color(fl_contrast(FL_BLACK,FL_WHITE))); + Fl::set_color(FL_BACKGROUND2_COLOR,r,g,b); + Fl::set_color(FL_FOREGROUND_COLOR, + get_color(fl_contrast(FL_FOREGROUND_COLOR,FL_BACKGROUND2_COLOR))); } // these are set by Fl::args() and override any system colors: @@ -304,5 +305,5 @@ int Fl::reload_scheme() { // -// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.6 2002/01/07 18:47:27 easysw Exp $". +// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.7 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/fl_color.cxx b/src/fl_color.cxx index cb4101239..0d2fbc683 100644 --- a/src/fl_color.cxx +++ b/src/fl_color.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_color.cxx,v 1.12.2.5.2.5 2002/01/01 15:11:32 easysw Exp $" +// "$Id: fl_color.cxx,v 1.12.2.5.2.6 2002/04/11 10:46:19 easysw Exp $" // // Color functions for the Fast Light Tool Kit (FLTK). // @@ -366,11 +366,11 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) { if ((c1^c2)&0x80800000) return fg; else if (c2&0x80800000) - return FL_GRAY_RAMP; // black from gray ramp + return FL_BLACK; else - return (Fl_Color)(FL_COLOR_CUBE-1); // white from gray ramp + return FL_WHITE; } // -// End of "$Id: fl_color.cxx,v 1.12.2.5.2.5 2002/01/01 15:11:32 easysw Exp $". +// End of "$Id: fl_color.cxx,v 1.12.2.5.2.6 2002/04/11 10:46:19 easysw Exp $". // diff --git a/src/fl_set_gray.cxx b/src/fl_set_gray.cxx index a41671d80..f68cb8cab 100644 --- a/src/fl_set_gray.cxx +++ b/src/fl_set_gray.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_set_gray.cxx,v 1.5.2.3.2.1 2002/01/01 15:11:32 easysw Exp $" +// "$Id: fl_set_gray.cxx,v 1.5.2.3.2.2 2002/04/11 10:46:19 easysw Exp $" // // Background (gray) color routines for the Fast Light Tool Kit (FLTK). // @@ -41,22 +41,22 @@ void Fl::background(uchar r, uchar g, uchar b) { } static void set_others() { - uchar r,g,b; Fl::get_color(FL_BLACK,r,g,b); - uchar r1,g1,b1; Fl::get_color(FL_WHITE,r1,g1,b1); + uchar r,g,b; Fl::get_color(FL_FOREGROUND_COLOR,r,g,b); + uchar r1,g1,b1; Fl::get_color(FL_BACKGROUND2_COLOR,r1,g1,b1); Fl::set_color(FL_INACTIVE_COLOR,(2*r+r1)/3, (2*g+g1)/3, (2*b+b1)/3); Fl::set_color(FL_SELECTION_COLOR,(2*r1+r)/3, (2*g1+g)/3, (2*b1+b)/3); } void Fl::foreground(uchar r, uchar g, uchar b) { - Fl::set_color(FL_BLACK,r,g,b); + Fl::set_color(FL_FOREGROUND_COLOR,r,g,b); set_others(); } void Fl::background2(uchar r, uchar g, uchar b) { - Fl::set_color(FL_WHITE,r,g,b); + Fl::set_color(FL_BACKGROUND2_COLOR,r,g,b); set_others(); } // -// End of "$Id: fl_set_gray.cxx,v 1.5.2.3.2.1 2002/01/01 15:11:32 easysw Exp $". +// End of "$Id: fl_set_gray.cxx,v 1.5.2.3.2.2 2002/04/11 10:46:19 easysw Exp $". // |
