From 079082ef7c67377f8e24fcec6cadaa4c49e3af2b Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 29 Oct 2001 03:44:33 +0000 Subject: 32-bit color (RGB0 or 000I), a la FLTK 2.0, including fl_rgb_color() function to generate an RGB Fl_Color value. Sort button names in FLUID. Fix focus and scroll problems in Fl_Text_Display/Editor. Fix radio/button demo. Removed D2 menubar.H header... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1663 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 13 ++++ FL/Enumerations.H | 10 +-- FL/Fl_Browser_.H | 9 +-- FL/Fl_Button.H | 6 +- FL/Fl_Chart.H | 17 ++--- FL/Fl_Counter.H | 9 +-- FL/Fl_File_Icon.H | 19 ++++-- FL/Fl_Help_View.H | 10 +-- FL/Fl_Input_.H | 14 ++-- FL/Fl_Menu_.H | 12 ++-- FL/Fl_Menu_Item.H | 8 +-- FL/Fl_Text_Display.H | 8 +-- FL/Fl_Tooltip.H | 10 +-- FL/Fl_Value_Input.H | 8 +-- FL/Fl_Value_Output.H | 9 +-- FL/Fl_Value_Slider.H | 9 +-- FL/Fl_Widget.H | 22 +++--- FL/forms.H | 12 ++-- FL/menubar.h | 64 ------------------ fluid/Fl_Type.cxx | 6 +- fluid/Fl_Widget_Type.cxx | 12 ++-- fluid/factory.cxx | 6 +- src/Fl_Adjuster.cxx | 6 +- src/Fl_Browser.cxx | 8 +-- src/Fl_Browser_.cxx | 6 +- src/Fl_Chart.cxx | 10 +-- src/Fl_Check_Browser.cxx | 6 +- src/Fl_Counter.cxx | 8 +-- src/Fl_File_Browser.cxx | 8 +-- src/Fl_File_Icon.cxx | 155 ++++++++++++++++++++++--------------------- src/Fl_Input_.cxx | 8 +-- src/Fl_Menu.cxx | 12 ++-- src/Fl_Progress.cxx | 6 +- src/Fl_Scrollbar.cxx | 6 +- src/Fl_Text_Display.cxx | 6 +- src/Fl_Tooltip.cxx | 6 +- src/Fl_Value_Output.cxx | 6 +- src/Fl_Value_Slider.cxx | 6 +- src/Fl_get_system_colors.cxx | 6 +- src/fl_color.cxx | 53 +++++++++------ src/fl_color_win32.cxx | 31 +++++---- src/fl_labeltype.cxx | 6 +- test/input.cxx | 10 +-- test/radio.fl | 68 ++++++++++--------- 44 files changed, 361 insertions(+), 369 deletions(-) delete mode 100644 FL/menubar.h diff --git a/CHANGES b/CHANGES index de915855f..12f31547a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,13 @@ CHANGES IN FLTK 1.1.0b5 + **** NOTE: DUE TO CHANGES IN THE WIDGET CLASSES, **** + **** YOU MUST RECOMPILE ALL SOURCE FILES **** + **** THAT USE FLTK!!! **** + + - All FLTK color values are now 32-bits and support + both the legacy 8-bit color values as well as 24-bit + RGB values (0xRRGGBB00 for 24-bit RGB, 0x000000II + for indexed color). - Fl::set_boxtype() and fl_internal_boxtype() now keep track of when a boxtype is changed; this allows you to override the "special" boxtypes without references to @@ -7,6 +15,11 @@ CHANGES IN FLTK 1.1.0b5 - Fl_Help_Func now takes a Fl_Widget pointer as well as a pathname. - Added code to support FL_KEYUP events. + - Focus did not return to the Fl_Text_Display and Editor + widgets when scrolling and then clicking inside the + editor window. + - Now set the line size of the vertical scrollbar in the + text editor to 1. - The symbols demo didn't show the strings needed to show the corresponding symbol (the label string was not quoted...) diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 83db4a5e3..93c15afa9 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -1,5 +1,5 @@ // -// "$Id: Enumerations.H,v 1.18.2.14.2.5 2001/08/06 03:17:43 easysw Exp $" +// "$Id: Enumerations.H,v 1.18.2.14.2.6 2001/10/29 03:44:31 easysw Exp $" // // Enumerations for the Fast Light Tool Kit (FLTK). // @@ -288,14 +288,14 @@ enum Fl_Color { // standard colors FL_COLOR_CUBE = 56 }; -#define inactive fl_inactive FL_EXPORT Fl_Color fl_inactive(Fl_Color c); -#define contrast fl_contrast 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); +} #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 @@ -364,5 +364,5 @@ enum Fl_Damage { #endif // -// End of "$Id: Enumerations.H,v 1.18.2.14.2.5 2001/08/06 03:17:43 easysw Exp $". +// End of "$Id: Enumerations.H,v 1.18.2.14.2.6 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index 61aa17c53..1e169530c 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser_.H,v 1.6.2.4 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Browser_.H,v 1.6.2.4.2.1 2001/10/29 03:44:31 easysw Exp $" // // Common browser header file for the Fast Light Tool Kit (FLTK). // @@ -50,8 +50,9 @@ class Fl_Browser_ : public Fl_Group { int real_hposition_; // the current horizontal scrolling position int offset_; // how far down top_ item the real_position is int max_width; // widest object seen so far - uchar textfont_, textsize_, textcolor_; uchar has_scrollbar_; // which scrollbars are enabled + uchar textfont_, textsize_; + unsigned textcolor_; void* top_; // which item scrolling position is in void* selection_; // which is selected (except for FL_MULTI_BROWSER) void *redraw1,*redraw2; // minimal update pointers @@ -132,7 +133,7 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar n) {textcolor_ = n;} + void textcolor(unsigned n) {textcolor_ = n;} static void scrollbar_width(int b) {scrollbar_width_ = b;} static int scrollbar_width() {return scrollbar_width_;} @@ -146,5 +147,5 @@ public: #endif // -// End of "$Id: Fl_Browser_.H,v 1.6.2.4 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Browser_.H,v 1.6.2.4.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Button.H b/FL/Fl_Button.H index 32a361099..d16e3e2d2 100644 --- a/FL/Fl_Button.H +++ b/FL/Fl_Button.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Button.H,v 1.5.2.3 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Button.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Button header file for the Fast Light Tool Kit (FLTK). // @@ -65,11 +65,11 @@ public: // back compatability: void shortcut(const char *s) {shortcut(fl_old_shortcut(s));} Fl_Color down_color() const {return selection_color();} - void down_color(uchar c) {selection_color(c);} + void down_color(unsigned c) {selection_color(c);} }; #endif // -// End of "$Id: Fl_Button.H,v 1.5.2.3 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Button.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Chart.H b/FL/Fl_Chart.H index 4ae92d0c9..54f3c3c56 100644 --- a/FL/Fl_Chart.H +++ b/FL/Fl_Chart.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Chart.H,v 1.6.2.3 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Chart.H,v 1.6.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Forms chart header file for the Fast Light Tool Kit (FLTK). // @@ -46,7 +46,7 @@ struct FL_CHART_ENTRY { float val; - uchar col; + unsigned col; char str[FL_CHART_LABEL_MAX+1]; }; @@ -57,15 +57,16 @@ class Fl_Chart : public Fl_Widget { FL_CHART_ENTRY *entries; double min,max; uchar autosize_; - uchar textfont_,textsize_,textcolor_; + uchar textfont_,textsize_; + unsigned textcolor_; protected: FL_EXPORT void draw(); public: FL_EXPORT Fl_Chart(int,int,int,int,const char * = 0); FL_EXPORT void clear(); - FL_EXPORT void add(double, const char * =0, uchar=0); - FL_EXPORT void insert(int, double, const char * =0, uchar=0); - FL_EXPORT void replace(int, double, const char * =0, uchar=0); + FL_EXPORT void add(double, const char * =0, unsigned=0); + FL_EXPORT void insert(int, double, const char * =0, unsigned=0); + FL_EXPORT void replace(int, double, const char * =0, unsigned=0); void bounds(double *a,double *b) const {*a = min; *b = max;} FL_EXPORT void bounds(double a,double b); int size() const {return numb;} @@ -76,7 +77,7 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar n) {textcolor_ = n;} + void textcolor(unsigned n) {textcolor_ = n;} uchar autosize() const {return autosize_;} void autosize(uchar n) {autosize_ = n;} }; @@ -84,5 +85,5 @@ public: #endif // -// End of "$Id: Fl_Chart.H,v 1.6.2.3 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Chart.H,v 1.6.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Counter.H b/FL/Fl_Counter.H index 4453c9f1c..f209f3f22 100644 --- a/FL/Fl_Counter.H +++ b/FL/Fl_Counter.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Counter.H,v 1.5.2.3 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Counter.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Counter header file for the Fast Light Tool Kit (FLTK). // @@ -38,7 +38,8 @@ class Fl_Counter : public Fl_Valuator { - uchar textfont_, textsize_, textcolor_; + uchar textfont_, textsize_; + unsigned textcolor_; double lstep_; uchar mouseobj; static FL_EXPORT void repeat_callback(void *); @@ -62,12 +63,12 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar s) {textcolor_ = s;} + void textcolor(unsigned s) {textcolor_ = s;} }; #endif // -// End of "$Id: Fl_Counter.H,v 1.5.2.3 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Counter.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_File_Icon.H b/FL/Fl_File_Icon.H index 0bdbe7870..6838e4e31 100644 --- a/FL/Fl_File_Icon.H +++ b/FL/Fl_File_Icon.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Icon.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $" +// "$Id: Fl_File_Icon.H,v 1.1.2.2 2001/10/29 03:44:31 easysw Exp $" // // Fl_File_Icon definitions. // @@ -33,6 +33,13 @@ # include "Fl.H" +// +// Special color value for the icon color. +// + +# define FL_ICON_COLOR (Fl_Color)0xffffffff + + // // Fl_File_Icon class... // @@ -62,11 +69,11 @@ class Fl_File_Icon //// Icon data enum // Data opcodes { END, // End of primitive/icon - COLOR, // Followed by color index + COLOR, // Followed by color value (2 shorts) LINE, // Start of line CLOSEDLINE, // Start of closed line POLYGON, // Start of polygon - OUTLINEPOLYGON, // Followed by outline color + OUTLINEPOLYGON, // Followed by outline color (2 shorts) VERTEX // Followed by scaled X,Y }; @@ -74,8 +81,8 @@ class Fl_File_Icon //// Icon data FL_EXPORT ~Fl_File_Icon(); FL_EXPORT short *add(short d); - short *add_color(short c) - { short *d = add(COLOR); add(c); return (d); } + short *add_color(Fl_Color c) + { short *d = add(COLOR); add(c >> 16); add(c); return (d); } short *add_vertex(int x, int y) { short *d = add(VERTEX); add(x); add(y); return (d); } short *add_vertex(float x, float y) @@ -101,5 +108,5 @@ class Fl_File_Icon //// Icon data #endif // !_Fl_Fl_File_Icon_H_ // -// End of "$Id: Fl_File_Icon.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $". +// End of "$Id: Fl_File_Icon.H,v 1.1.2.2 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index 3098535f2..c81bb059c 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -1,10 +1,10 @@ // -// "$Id: Fl_Help_View.H,v 1.1.2.2 2001/10/27 03:29:25 easysw Exp $" +// "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $" // -// Help Viewer widget definitions. +// Help Viewer widget definitions. // -// Copyright 1997-2001 by Easy Software Products. -// Image support donated by Matthias Melcher, Copyright 2000. +// Copyright 1997-2001 by Easy Software Products. +// Image support donated by Matthias Melcher, Copyright 2000. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -210,5 +210,5 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget #endif // !_Fl_Help_View_H_ // -// End of "$Id: Fl_Help_View.H,v 1.1.2.2 2001/10/27 03:29:25 easysw Exp $". +// End of "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H index d44a3f8e3..d8146348a 100644 --- a/FL/Fl_Input_.H +++ b/FL/Fl_Input_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.H,v 1.6.2.4 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Input_.H,v 1.6.2.4.2.1 2001/10/29 03:44:31 easysw Exp $" // // Input base class header file for the Fast Light Tool Kit (FLTK). // @@ -50,11 +50,11 @@ class Fl_Input_ : public Fl_Widget { int mu_p; int maximum_size_; + uchar erase_cursor_only; uchar textfont_; uchar textsize_; - uchar textcolor_; - uchar cursor_color_; - uchar erase_cursor_only; + unsigned textcolor_; + unsigned cursor_color_; FL_EXPORT const char* expand(const char*, char*) const; FL_EXPORT double expandpos(const char*, const char*, const char*, int*) const; @@ -114,13 +114,13 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar n) {textcolor_ = n;} + void textcolor(unsigned n) {textcolor_ = n;} Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;} - void cursor_color(uchar n) {cursor_color_ = n;} + void cursor_color(unsigned n) {cursor_color_ = n;} }; #endif // -// End of "$Id: Fl_Input_.H,v 1.6.2.4 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Input_.H,v 1.6.2.4.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index 5850e9421..37bd88f9c 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_.H,v 1.7.2.4 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Menu_.H,v 1.7.2.4.2.1 2001/10/29 03:44:31 easysw Exp $" // // Menu base class header file for the Fast Light Tool Kit (FLTK). // @@ -38,11 +38,11 @@ class Fl_Menu_ : public Fl_Widget { protected: + uchar alloc; uchar down_box_; uchar textfont_; uchar textsize_; - uchar textcolor_; - uchar alloc; + unsigned textcolor_; public: FL_EXPORT const Fl_Menu_Item* picked(const Fl_Menu_Item*); @@ -80,18 +80,18 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar c) {textsize_=c;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar c) {textcolor_=c;} + void textcolor(unsigned c) {textcolor_=c;} Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;} void down_box(Fl_Boxtype b) {down_box_ = b;} // back compatability: Fl_Color down_color() const {return selection_color();} - void down_color(uchar c) {selection_color(c);} + void down_color(unsigned c) {selection_color(c);} }; #endif // -// End of "$Id: Fl_Menu_.H,v 1.7.2.4 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Menu_.H,v 1.7.2.4.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index 2f4e2cb8d..de4e58740 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Item.H,v 1.5.2.4 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.1 2001/10/29 03:44:31 easysw Exp $" // // Menu item header file for the Fast Light Tool Kit (FLTK). // @@ -56,7 +56,7 @@ struct Fl_Menu_Item { uchar labeltype_; uchar labelfont_; uchar labelsize_; - uchar labelcolor_; + unsigned labelcolor_; // advance N items, skipping submenus: FL_EXPORT const Fl_Menu_Item *next(int=1) const; @@ -70,7 +70,7 @@ struct Fl_Menu_Item { Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;} void labeltype(Fl_Labeltype a) {labeltype_ = a;} Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;} - void labelcolor(uchar a) {labelcolor_ = a;} + void labelcolor(unsigned a) {labelcolor_ = a;} Fl_Font labelfont() const {return (Fl_Font)labelfont_;} void labelfont(uchar a) {labelfont_ = a;} uchar labelsize() const {return labelsize_;} @@ -153,5 +153,5 @@ enum { // back-compatability enum: #endif // -// End of "$Id: Fl_Menu_Item.H,v 1.5.2.4 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index bd6654d9e..880eab64a 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.H,v 1.4.2.2 2001/08/06 23:51:39 easysw Exp $" +// "$Id: Fl_Text_Display.H,v 1.4.2.3 2001/10/29 03:44:31 easysw Exp $" // // Header file for Fl_Text_Display class. // @@ -106,7 +106,7 @@ class Fl_Text_Display: public Fl_Group { uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar n) {textcolor_ = n;} + void textcolor(unsigned n) {textcolor_ = n;} protected: // Most (all?) of this stuff should only be called from resize() or @@ -219,11 +219,11 @@ class Fl_Text_Display: public Fl_Group { uchar textfont_; uchar textsize_; - uchar textcolor_; + unsigned textcolor_; }; #endif // -// End of "$Id: Fl_Text_Display.H,v 1.4.2.2 2001/08/06 23:51:39 easysw Exp $". +// End of "$Id: Fl_Text_Display.H,v 1.4.2.3 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H index 19dba0cf7..4d29a0834 100644 --- a/FL/Fl_Tooltip.H +++ b/FL/Fl_Tooltip.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.H,v 1.16.2.3 2001/08/03 02:28:32 easysw Exp $" +// "$Id: Fl_Tooltip.H,v 1.16.2.4 2001/10/29 03:44:31 easysw Exp $" // // Tooltip header file for the Fast Light Tool Kit (FLTK). // @@ -43,7 +43,7 @@ class FL_EXPORT Fl_Tooltip { static Fl_Menu_Window *window; static Fl_Widget *widget; static int shown; - static uchar color_; + static unsigned color_; static int font_; static int size_; @@ -62,8 +62,8 @@ public: static int size() { return size_; } static void font(int i) { font_ = i; } static void size(int s) { size_ = s; } - static void color(uchar c) { color_ = c; } - static uchar color() { return color_; } + static void color(unsigned c) { color_ = c; } + static Fl_Color color() { return (Fl_Color)color_; } static void enter(Fl_Widget *w); static void exit(Fl_Widget *w); @@ -76,5 +76,5 @@ public: #endif // -// End of "$Id: Fl_Tooltip.H,v 1.16.2.3 2001/08/03 02:28:32 easysw Exp $". +// End of "$Id: Fl_Tooltip.H,v 1.16.2.4 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Value_Input.H b/FL/Fl_Value_Input.H index 7a079bb85..c9ac2e02c 100644 --- a/FL/Fl_Value_Input.H +++ b/FL/Fl_Value_Input.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Input.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $" +// "$Id: Fl_Value_Input.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Value input header file for the Fast Light Tool Kit (FLTK). // @@ -50,14 +50,14 @@ public: uchar textsize() const {return input.textsize();} void textsize(uchar s) {input.textsize(s);} Fl_Color textcolor() const {return input.textcolor();} - void textcolor(uchar n) {input.textcolor(n);} + void textcolor(unsigned n) {input.textcolor(n);} Fl_Color cursor_color() const {return input.cursor_color();} - void cursor_color(uchar n) {input.cursor_color(n);} + void cursor_color(unsigned n) {input.cursor_color(n);} }; #endif // -// End of "$Id: Fl_Value_Input.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $". +// End of "$Id: Fl_Value_Input.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Value_Output.H b/FL/Fl_Value_Output.H index 29dc108b0..1a4f4530a 100644 --- a/FL/Fl_Value_Output.H +++ b/FL/Fl_Value_Output.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Output.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $" +// "$Id: Fl_Value_Output.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Value output header file for the Fast Light Tool Kit (FLTK). // @@ -31,7 +31,8 @@ #endif class Fl_Value_Output : public Fl_Valuator { - uchar textfont_, textsize_, textcolor_, soft_; + uchar textfont_, textsize_, soft_; + unsigned textcolor_; public: FL_EXPORT int handle(int); FL_EXPORT void draw(); @@ -45,11 +46,11 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar s) {textcolor_ = s;} + void textcolor(unsigned s) {textcolor_ = s;} }; #endif // -// End of "$Id: Fl_Value_Output.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $". +// End of "$Id: Fl_Value_Output.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Value_Slider.H b/FL/Fl_Value_Slider.H index 49a38ddbf..9875dfe08 100644 --- a/FL/Fl_Value_Slider.H +++ b/FL/Fl_Value_Slider.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Slider.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $" +// "$Id: Fl_Value_Slider.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $" // // Value slider header file for the Fast Light Tool Kit (FLTK). // @@ -29,7 +29,8 @@ #include "Fl_Slider.H" class Fl_Value_Slider : public Fl_Slider { - uchar textfont_, textsize_, textcolor_; + uchar textfont_, textsize_; + unsigned textcolor_; public: FL_EXPORT void draw(); FL_EXPORT int handle(int); @@ -39,11 +40,11 @@ public: uchar textsize() const {return textsize_;} void textsize(uchar s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} - void textcolor(uchar s) {textcolor_ = s;} + void textcolor(unsigned s) {textcolor_ = s;} }; #endif // -// End of "$Id: Fl_Value_Slider.H,v 1.5.2.3 2001/01/22 15:13:38 easysw Exp $". +// End of "$Id: Fl_Value_Slider.H,v 1.5.2.3.2.1 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index 68fb8c599..6281d133c 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget.H,v 1.6.2.4.2.8 2001/10/22 21:15:11 easysw Exp $" +// "$Id: Fl_Widget.H,v 1.6.2.4.2.9 2001/10/29 03:44:31 easysw Exp $" // // Widget header file for the Fast Light Tool Kit (FLTK). // @@ -45,7 +45,7 @@ struct Fl_Label { uchar type; uchar font; uchar size; - uchar color; + unsigned color; FL_EXPORT void draw(int,int,int,int, Fl_Align) const ; FL_EXPORT void measure(int&, int&) const ; }; @@ -58,12 +58,12 @@ class Fl_Widget { void* user_data_; short x_,y_,w_,h_; Fl_Label label_; - uchar type_; int flags_; + unsigned color_; + unsigned color2_; + uchar type_; uchar damage_; uchar box_; - uchar color_; - uchar color2_; uchar align_; uchar when_; @@ -121,17 +121,17 @@ public: Fl_Boxtype box() const {return (Fl_Boxtype)box_;} void box(Fl_Boxtype a) {box_ = a;} Fl_Color color() const {return (Fl_Color)color_;} - void color(uchar a) {color_ = a;} + void color(unsigned a) {color_ = a;} Fl_Color selection_color() const {return (Fl_Color)color2_;} - void selection_color(uchar a) {color2_ = a;} - void color(uchar a, uchar b) {color_=a; color2_=b;} + void selection_color(unsigned a) {color2_ = a;} + void color(unsigned a, unsigned b) {color_=a; color2_=b;} const char* label() const {return label_.value;} void label(const char* a) {label_.value=a;} void label(Fl_Labeltype a,const char* b) {label_.type = a; label_.value = b;} Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;} void labeltype(Fl_Labeltype a) {label_.type = a;} Fl_Color labelcolor() const {return (Fl_Color)label_.color;} - void labelcolor(uchar a) {label_.color=a;} + void labelcolor(unsigned a) {label_.color=a;} Fl_Font labelfont() const {return (Fl_Font)label_.font;} void labelfont(uchar a) {label_.font=a;} uchar labelsize() const {return label_.size;} @@ -196,7 +196,7 @@ public: // back compatability only: Fl_Color color2() const {return (Fl_Color)color2_;} - void color2(uchar a) {color2_ = a;} + void color2(unsigned a) {color2_ = a;} }; // reserved type numbers (necessary for my cheapo RTTI) start here. @@ -207,5 +207,5 @@ public: #endif // -// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.8 2001/10/22 21:15:11 easysw Exp $". +// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.9 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/forms.H b/FL/forms.H index 5c26c4fd8..8f11b13dc 100644 --- a/FL/forms.H +++ b/FL/forms.H @@ -1,5 +1,5 @@ // -// "$Id: forms.H,v 1.7.2.7.2.1 2001/09/30 17:37:06 easysw Exp $" +// "$Id: forms.H,v 1.7.2.7.2.2 2001/10/29 03:44:31 easysw Exp $" // // Forms emulation header file for the Fast Light Tool Kit (FLTK). // @@ -208,11 +208,11 @@ inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);} inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->labelsize(s);} inline void fl_set_object_lstyle(Fl_Widget* o,int a) { o->labelfont((uchar)a); o->labeltype((Fl_Labeltype)(a>>8));} -inline void fl_set_object_lcol(Fl_Widget* o, uchar a) {o->labelcolor(a);} +inline void fl_set_object_lcol(Fl_Widget* o, unsigned a) {o->labelcolor(a);} #define fl_set_object_lcolor fl_set_object_lcol inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) {o->align(a);} #define fl_set_object_align fl_set_object_lalign -inline void fl_set_object_color(Fl_Widget* o,uchar a,uchar b) {o->color(a,b);} +inline void fl_set_object_color(Fl_Widget* o,unsigned a,unsigned b) {o->color(a,b);} inline void fl_set_object_label(Fl_Widget* o, const char* a) {o->label(a); o->redraw();} inline void fl_set_object_position(Fl_Widget*o,int x,int y) {o->position(x,y);} inline void fl_set_object_size(Fl_Widget* o, int w, int h) {o->size(w,h);} @@ -528,7 +528,7 @@ inline void fl_set_chart_lstyle(Fl_Widget* o, Fl_Font v) { ((Fl_Chart*)o)->textfont(v);} inline void fl_set_chart_lsize(Fl_Widget* o, int v) { ((Fl_Chart*)o)->textsize(v);} -inline void fl_set_chart_lcolor(Fl_Widget* o, uchar v) { +inline void fl_set_chart_lcolor(Fl_Widget* o, unsigned v) { ((Fl_Chart*)o)->textcolor(v);} #define fl_set_chart_lcol fl_set_chart_lcolor @@ -684,7 +684,7 @@ inline void fl_set_input(Fl_Widget* o, const char* v) { ((Fl_Input*)o)->value(v);} inline void fl_set_input_return(Fl_Widget* o, int x) { ((Fl_Input*)o)->when((Fl_When)(x | FL_WHEN_RELEASE));} -inline void fl_set_input_color(Fl_Widget* o, uchar a, uchar b) { +inline void fl_set_input_color(Fl_Widget* o, unsigned a, unsigned b) { ((Fl_Input*)o)->textcolor(a); ((Fl_Input*)o)->cursor_color(b); } @@ -838,5 +838,5 @@ inline void fl_draw() {Fl::flush();} #endif /* define __FORMS_H__ */ // -// End of "$Id: forms.H,v 1.7.2.7.2.1 2001/09/30 17:37:06 easysw Exp $". +// End of "$Id: forms.H,v 1.7.2.7.2.2 2001/10/29 03:44:31 easysw Exp $". // diff --git a/FL/menubar.h b/FL/menubar.h deleted file mode 100644 index 1dc7cc8bd..000000000 --- a/FL/menubar.h +++ /dev/null @@ -1,64 +0,0 @@ -// This is an additional header file for "DDForms", which was our internal -// enhancement of Forms. This defines the precursor of the Fl_Menu class. -// -// Unfortunately it defined the callbacks as taking a long rather -// than a void* argument, requiring some dubious casts to emulate it: - -#include "Fl_Menu_Bar.H" - -struct MenuEntry { - const char *text; /*initial character indicates "type", 0 = end of menu*/ - ulong bind; /* key binding in forms format (#x, etc) */ - void (*cb)(Fl_Widget *,long); /* callback */ - long data; /* value for callback */ - int flags; /* see below for flags */ - uchar labeltype; - uchar labelfont; - uchar labelsize; - uchar labelcolor; -}; - -#define CHECKED FL_MENU_CHECK -#define UNCHECKED FL_MENU_BOX -#define DISABLED FL_MENU_INACTIVE - -/* Turn a box into a menu bar: */ -inline void MenuBar(Fl_Widget *o,MenuEntry *m) { - Fl_Menu_Bar *mb = new Fl_Menu_Bar(o->x(),o->y(),o->w(),o->h()); - mb->menu((Fl_Menu_Item*)m); - mb->box(0); - Fl_Group *g = (Fl_Group *)(o->parent()); - int i = g->find(*o); - g->insert(*mb, ichildren()-1 ? g->child(i+1) : 0); -} - -/* advance to the Nth item in menu, skipping submenus: */ -inline MenuEntry *MenuGetEntry(MenuEntry *m,int i) { - return (MenuEntry*)(((Fl_Menu_Item*)m)->next(i)); -} - -/* Init the shortcuts for a widget with a popup menu: */ -inline void MenuSetShortcuts(Fl_Widget *, MenuEntry *) {} - -inline void MenuAdd( - MenuEntry m[], - int, /* number of entries in menutable, ignored here */ - const char *text, - const char *bind, - void (*cb)(Fl_Widget *,long), - long data, - int flags) { - ((Fl_Menu_Item*)m)->add(text,bind,(Fl_Callback*)cb,(void *)data,flags); -} - -inline MenuEntry *MenuPopup(Fl_Widget *o,const char *title,MenuEntry *m,double x,double y) { - const Fl_Menu_Item* v = ((Fl_Menu_Item*)m)->popup(x,y,title); - if (v && v->callback_) v->do_callback(o); - return (MenuEntry *)v; -} - -inline MenuEntry *MenuHandleShortcut(Fl_Widget *o,MenuEntry *m,char) { - const Fl_Menu_Item* v = ((Fl_Menu_Item*)m)->test_shortcut(); - if (v && v->callback_) v->do_callback(o); - return (MenuEntry *)v; -} diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index d7f400ed5..1afc5782d 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Type.cxx,v 1.6.2.6 2001/01/22 15:13:38 easysw Exp $" +// "$Id: Fl_Type.cxx,v 1.6.2.6.2.1 2001/10/29 03:44:32 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -130,7 +130,7 @@ extern const char* subclassname(Fl_Type*); void Widget_Browser::item_draw(void *v, int x, int y, int, int) const { Fl_Type *l = (Fl_Type *)v; x += 3 + l->level * 10; - if (l->new_selected) fl_color(contrast(FL_BLACK,FL_SELECTION_COLOR)); + if (l->new_selected) fl_color(fl_contrast(FL_BLACK,FL_SELECTION_COLOR)); else fl_color(FL_BLACK); if (l->is_parent()) { if (!l->next || l->next->level <= l->level) { @@ -667,5 +667,5 @@ void Fl_Type::read_property(const char *c) { int Fl_Type::read_fdesign(const char*, const char*) {return 0;} // -// End of "$Id: Fl_Type.cxx,v 1.6.2.6 2001/01/22 15:13:38 easysw Exp $". +// End of "$Id: Fl_Type.cxx,v 1.6.2.6.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index aff78506e..5e9caa775 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.5 2001/10/01 19:38:28 easysw Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.6 2001/10/29 03:44:32 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -846,7 +846,7 @@ void color_cb(Fl_Button* i, void *v) { q->o->color(c); q->o->redraw(); } } - i->color(c); i->labelcolor(contrast(FL_BLACK,c)); i->redraw(); + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); } void color2_cb(Fl_Button* i, void *v) { @@ -863,7 +863,7 @@ void color2_cb(Fl_Button* i, void *v) { q->o->selection_color(c); q->o->redraw(); } } - i->color(c); i->labelcolor(contrast(FL_BLACK,c)); i->redraw(); + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); } void labelcolor_cb(Fl_Button* i, void *v) { @@ -878,7 +878,7 @@ void labelcolor_cb(Fl_Button* i, void *v) { q->o->labelcolor(c); q->redraw(); } } - i->color(c); i->labelcolor(contrast(FL_BLACK,c)); i->redraw(); + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); } static Fl_Button* relative(Fl_Widget* o, int i) { @@ -1078,7 +1078,7 @@ void textcolor_cb(Fl_Button* i, void* v) { q->textstuff(3,n,s,c); q->o->redraw(); } } - i->color(c); i->labelcolor(contrast(FL_BLACK,c)); i->redraw(); + i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw(); } //////////////////////////////////////////////////////////////// @@ -1957,5 +1957,5 @@ int Fl_Widget_Type::read_fdesign(const char* name, const char* value) { } // -// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.5 2001/10/01 19:38:28 easysw Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.6 2001/10/29 03:44:32 easysw Exp $". // diff --git a/fluid/factory.cxx b/fluid/factory.cxx index 181a626d4..0e8269c72 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -1,5 +1,5 @@ // -// "$Id: factory.cxx,v 1.4.2.11.2.2 2001/09/29 14:38:59 easysw Exp $" +// "$Id: factory.cxx,v 1.4.2.11.2.3 2001/10/29 03:44:32 easysw Exp $" // // Widget factory code for the Fast Light Tool Kit (FLTK). // @@ -681,8 +681,8 @@ Fl_Menu_Item New_Menu[] = { {0,0,cb,(void*)&Fl_Return_Button_type}, {0,0,cb,(void*)&Fl_Light_Button_type}, {0,0,cb,(void*)&Fl_Check_Button_type}, - {0,0,cb,(void*)&Fl_Round_Button_type}, {0,0,cb,(void*)&Fl_Repeat_Button_type}, + {0,0,cb,(void*)&Fl_Round_Button_type}, {0}, {"valuators",0,0,0,FL_SUBMENU}, {0,0,cb,(void*)&Fl_Slider_type}, @@ -887,5 +887,5 @@ int lookup_symbol(const char *name, int &v, int numberok) { } // -// End of "$Id: factory.cxx,v 1.4.2.11.2.2 2001/09/29 14:38:59 easysw Exp $". +// End of "$Id: factory.cxx,v 1.4.2.11.2.3 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Adjuster.cxx b/src/Fl_Adjuster.cxx index b591ed0c3..0abc9916f 100644 --- a/src/Fl_Adjuster.cxx +++ b/src/Fl_Adjuster.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Adjuster.cxx,v 1.5.2.3.2.1 2001/08/05 14:00:15 easysw Exp $" +// "$Id: Fl_Adjuster.cxx,v 1.5.2.3.2.2 2001/10/29 03:44:32 easysw Exp $" // // Adjuster widget for the Fast Light Tool Kit (FLTK). // @@ -54,7 +54,7 @@ void Fl_Adjuster::draw() { if (active_r()) fl_color(selection_color()); else - fl_color(inactive(selection_color())); + fl_color(fl_inactive(selection_color())); fastarrow.draw(x()+(W-fastarrow_width)/2, y()+2*dy+(H-fastarrow_height)/2, W, H); mediumarrow.draw(x()+dx+(W-mediumarrow_width)/2, @@ -158,5 +158,5 @@ Fl_Adjuster::Fl_Adjuster(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Adjuster.cxx,v 1.5.2.3.2.1 2001/08/05 14:00:15 easysw Exp $". +// End of "$Id: Fl_Adjuster.cxx,v 1.5.2.3.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 35fd98aaf..78a7d716f 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser.cxx,v 1.9.2.12 2001/01/22 15:13:39 easysw Exp $" +// "$Id: Fl_Browser.cxx,v 1.9.2.12.2.1 2001/10/29 03:44:32 easysw Exp $" // // Browser widget for the Fast Light Tool Kit (FLTK). // @@ -370,8 +370,8 @@ void Fl_Browser::item_draw(void* v, int x, int y, int w, int h) const { BREAK: fl_font(font, size); if (((FL_BLINE*)v)->flags & SELECTED) - lcol = contrast(lcol, selection_color()); - if (!active_r()) lcol = inactive(lcol); + lcol = fl_contrast(lcol, selection_color()); + if (!active_r()) lcol = fl_inactive(lcol); fl_color(lcol); fl_draw(str, x+3, y, w1-6, h, e ? Fl_Align(align|FL_ALIGN_CLIP) : align); if (!e) break; // no more fields... @@ -493,5 +493,5 @@ int Fl_Browser::value() const { } // -// End of "$Id: Fl_Browser.cxx,v 1.9.2.12 2001/01/22 15:13:39 easysw Exp $". +// End of "$Id: Fl_Browser.cxx,v 1.9.2.12.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx index df69a9963..6bb40fab9 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.6 2001/09/29 22:59:45 easysw Exp $" +// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.7 2001/10/29 03:44:32 easysw Exp $" // // Base Browser widget class for the Fast Light Tool Kit (FLTK). // @@ -309,7 +309,7 @@ J1: if (hh <= 0) continue; if ((damage()&(FL_DAMAGE_SCROLL|FL_DAMAGE_ALL)) || l == redraw1 || l == redraw2) { if (item_selected(l)) { - fl_color(active_r() ? selection_color() : inactive(selection_color())); + fl_color(active_r() ? selection_color() : fl_inactive(selection_color())); fl_rectf(X, yy+Y, W, hh); } else if (!(damage()&FL_DAMAGE_ALL)) { fl_color(color()); @@ -713,5 +713,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.6 2001/09/29 22:59:45 easysw Exp $". +// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.7 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Chart.cxx b/src/Fl_Chart.cxx index 916ca698d..daa5a2645 100644 --- a/src/Fl_Chart.cxx +++ b/src/Fl_Chart.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Chart.cxx,v 1.5.2.6 2001/01/22 15:13:39 easysw Exp $" +// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.1 2001/10/29 03:44:32 easysw Exp $" // // Forms-compatible chart widget for the Fast Light Tool Kit (FLTK). // @@ -298,7 +298,7 @@ void Fl_Chart::clear() { redraw(); } -void Fl_Chart::add(double val, const char *str, uchar col) { +void Fl_Chart::add(double val, const char *str, unsigned col) { /* Allocate more entries if required */ if (numb >= sizenumb) { sizenumb += FL_CHART_MAX; @@ -321,7 +321,7 @@ void Fl_Chart::add(double val, const char *str, uchar col) { redraw(); } -void Fl_Chart::insert(int index, double val, const char *str, uchar col) { +void Fl_Chart::insert(int index, double val, const char *str, unsigned col) { int i; if (index < 1 || index > numb+1) return; /* Allocate more entries if required */ @@ -344,7 +344,7 @@ void Fl_Chart::insert(int index, double val, const char *str, uchar col) { redraw(); } -void Fl_Chart::replace(int index,double val, const char *str, uchar col) { +void Fl_Chart::replace(int index,double val, const char *str, unsigned col) { if (index < 1 || index > numb) return; entries[index-1].val = float(val); entries[index-1].col = col; @@ -378,5 +378,5 @@ void Fl_Chart::maxsize(int m) { } // -// End of "$Id: Fl_Chart.cxx,v 1.5.2.6 2001/01/22 15:13:39 easysw Exp $". +// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Check_Browser.cxx b/src/Fl_Check_Browser.cxx index ffc5ec55f..d785fbbb2 100644 --- a/src/Fl_Check_Browser.cxx +++ b/src/Fl_Check_Browser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Check_Browser.cxx,v 1.1.2.1 2001/08/18 23:42:36 easysw Exp $" +// "$Id: Fl_Check_Browser.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $" // // Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK). // @@ -131,7 +131,7 @@ void Fl_Check_Browser::item_draw(void *v, int x, int y, int, int) const { } fl_font(textfont(), size); if (i->selected) { - col = contrast(col, selection_color()); + col = fl_contrast(col, selection_color()); } fl_color(col); fl_draw(s, x + CHECK_SIZE + 8, y + size - 1); @@ -259,5 +259,5 @@ void Fl_Check_Browser::check_none() { // -// End of "$Id: Fl_Check_Browser.cxx,v 1.1.2.1 2001/08/18 23:42:36 easysw Exp $". +// End of "$Id: Fl_Check_Browser.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index 7be74038b..08a40cf24 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.2 2001/10/18 23:41:04 easysw Exp $" +// "$Id: Fl_Counter.cxx,v 1.8.2.3.2.3 2001/10/29 03:44:32 easysw Exp $" // // Counter widget for the Fast Light Tool Kit (FLTK). // @@ -56,7 +56,7 @@ void Fl_Counter::draw() { draw_box(boxtype[0], xx[0], y(), ww[0], h(), FL_WHITE); fl_font(textfont(), textsize()); - fl_color(active_r() ? textcolor() : inactive(textcolor())); + fl_color(active_r() ? textcolor() : fl_inactive(textcolor())); char str[128]; format(str); fl_draw(str, xx[0], y(), ww[0], h(), FL_ALIGN_CENTER); if (Fl::focus() == this) draw_focus(boxtype[0], xx[0], y(), ww[0], h()); @@ -65,7 +65,7 @@ void Fl_Counter::draw() { if (active_r()) selcolor = labelcolor(); else - selcolor = inactive(labelcolor()); + selcolor = fl_inactive(labelcolor()); if (type() == FL_NORMAL_COUNTER) { draw_box(boxtype[1], xx[1], y(), ww[1], h(), color()); @@ -186,5 +186,5 @@ Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Counter.cxx,v 1.8.2.3.2.2 2001/10/18 23:41:04 easysw Exp $". +// End of "$Id: Fl_Counter.cxx,v 1.8.2.3.2.3 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx index d1a5af82f..0fc8c54a0 100644 --- a/src/Fl_File_Browser.cxx +++ b/src/Fl_File_Browser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Browser.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" +// "$Id: Fl_File_Browser.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $" // // Fl_File_Browser routines. // @@ -273,7 +273,7 @@ Fl_File_Browser::item_draw(void *p, // I - List item data fl_font(textfont(), textsize()); if (line->flags & SELECTED) - c = contrast(textcolor(), selection_color()); + c = fl_contrast(textcolor(), selection_color()); else c = textcolor(); @@ -316,7 +316,7 @@ Fl_File_Browser::item_draw(void *p, // I - List item data if (active_r()) fl_color(c); else - fl_color(inactive(c)); + fl_color(fl_inactive(c)); for (text = line->txt, ptr = fragment; *text != '\0'; text ++) if (*text == '\n') @@ -566,5 +566,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string // -// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". +// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx index 5c711235a..92426ba4f 100644 --- a/src/Fl_File_Icon.cxx +++ b/src/Fl_File_Icon.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Icon.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" +// "$Id: Fl_File_Icon.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $" // // Fl_File_Icon routines. // @@ -104,9 +104,9 @@ static char *get_kde_val(char *str, const char *key); // Fl_File_Icon::Fl_File_Icon(const char *p, /* I - Filename pattern */ - int t, /* I - File type */ - int nd, /* I - Number of data values */ - short *d) /* I - Data values */ + int t, /* I - File type */ + int nd, /* I - Number of data values */ + short *d) /* I - Data values */ { // Initialize the pattern and type... pattern_ = p; @@ -166,10 +166,10 @@ Fl_File_Icon::~Fl_File_Icon() // 'Fl_File_Icon::add()' - Add data to an icon. // -short * // O - Pointer to new data value +short * // O - Pointer to new data value Fl_File_Icon::add(short d) // I - Data to add { - short *dptr; // Pointer to new data value + short *dptr; // Pointer to new data value // Allocate/reallocate memory as needed @@ -201,8 +201,8 @@ Fl_File_Icon::add(short d) // I - Data to add // Fl_File_Icon * // O - Matching file icon or NULL -Fl_File_Icon::find(const char *filename, // I - Name of file */ - int filetype) // I - Enumerated file type +Fl_File_Icon::find(const char *filename,// I - Name of file */ + int filetype) // I - Enumerated file type { Fl_File_Icon *current; // Current file in list struct stat fileinfo; // Information on file @@ -247,14 +247,15 @@ Fl_File_Icon::find(const char *filename, // I - Name of file */ // void -Fl_File_Icon::draw(int x, // I - Upper-lefthand X - int y, // I - Upper-lefthand Y - int w, // I - Width of bounding box - int h, // I - Height of bounding box - Fl_Color ic, // I - Icon color... - int active) // I - Active or inactive? +Fl_File_Icon::draw(int x, // I - Upper-lefthand X + int y, // I - Upper-lefthand Y + int w, // I - Width of bounding box + int h, // I - Height of bounding box + Fl_Color ic, // I - Icon color... + int active) // I - Active or inactive? { - Fl_Color c; // Current color + Fl_Color c, // Current color + oc; // Outline color short *d; // Pointer to data short *prim; // Pointer to start of primitive... double scale; // Scale of icon @@ -280,7 +281,7 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X if (active) fl_color(c); else - fl_color(inactive(c)); + fl_color(fl_inactive(c)); while (*d != END || prim) switch (*d) @@ -303,24 +304,26 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X case OUTLINEPOLYGON : fl_end_polygon(); + oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | + ((unsigned short *)prim)[2]); if (active) { - if (prim[1] == 256) + if (oc == FL_ICON_COLOR) fl_color(ic); else - fl_color((Fl_Color)prim[1]); + fl_color(oc); } else { - if (prim[1] == 256) - fl_color(inactive(ic)); + if (oc == FL_ICON_COLOR) + fl_color(fl_inactive(ic)); else - fl_color(inactive((Fl_Color)prim[1])); + fl_color(fl_inactive(oc)); } fl_begin_loop(); - prim += 2; + prim += 3; while (*prim == VERTEX) { fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); @@ -337,16 +340,17 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X break; case COLOR : - if (d[1] == 256) + c = (Fl_Color)((((unsigned short *)d)[1] << 16) | + ((unsigned short *)d)[2]); + + if (c == FL_ICON_COLOR) c = ic; - else - c = (Fl_Color)d[1]; if (!active) - c = inactive(c); + c = fl_inactive(c); fl_color(c); - d += 2; + d += 3; break; case LINE : @@ -399,24 +403,26 @@ Fl_File_Icon::draw(int x, // I - Upper-lefthand X case OUTLINEPOLYGON : fl_end_polygon(); + oc = (Fl_Color)((((unsigned short *)prim)[1] << 16) | + ((unsigned short *)prim)[2]); if (active) { - if (prim[1] == 256) + if (oc == FL_ICON_COLOR) fl_color(ic); else - fl_color((Fl_Color)prim[1]); + fl_color(oc); } else { - if (prim[1] == 256) - fl_color(inactive(ic)); + if (oc == FL_ICON_COLOR) + fl_color(fl_inactive(ic)); else - fl_color(inactive((Fl_Color)prim[1])); + fl_color(fl_inactive(oc)); } fl_begin_loop(); - prim += 2; + prim += 3; while (*prim == VERTEX) { fl_vertex(prim[1] * 0.0001, prim[2] * 0.0001); @@ -451,11 +457,11 @@ Fl_File_Icon::label(Fl_Widget *w) // I - Widget to label void Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data - int x, // I - X position of label - int y, // I - Y position of label - int w, // I - Width of label - int h, // I - Height of label - Fl_Align a) // I - Label alignment (not used) + int x, // I - X position of label + int y, // I - Y position of label + int w, // I - Width of label + int h, // I - Height of label + Fl_Align a) // I - Label alignment (not used) { Fl_File_Icon *icon; // Pointer to icon data @@ -475,7 +481,7 @@ Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data void Fl_File_Icon::load(const char *f) // I - File to read from { - const char *ext; // File extension + const char *ext; // File extension if ((ext = filename_ext(f)) == NULL) @@ -488,10 +494,8 @@ Fl_File_Icon::load(const char *f) // I - File to read from load_fti(f); else if (strcmp(ext, ".xpm") == 0) load_xpm(f); -#if 0 - else if (strcmp(ext, ".png") == 0) - load_png(f); -#endif /* 0 */ +// else if (strcmp(ext, ".png") == 0) +// load_png(f); else { fprintf(stderr, "Fl_File_Icon::load(): Unknown file type for \"%s\".\n", f); @@ -613,18 +617,19 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from // // name FLTK color // ------------- ---------- - // iconcolor 256; mapped to the icon color in Fl_File_Icon::draw() + // iconcolor FL_ICON_COLOR; mapped to the icon color in + // Fl_File_Icon::draw() // shadowcolor FL_DARK3 // outlinecolor FL_BLACK if (strcmp(params, "iconcolor") == 0) - add_color(256); + add_color(FL_ICON_COLOR); else if (strcmp(params, "shadowcolor") == 0) add_color(FL_DARK3); else if (strcmp(params, "outlinecolor") == 0) add_color(FL_BLACK); else { - short c = atoi(params); // Color value + int c = atoi(params); // Color value if (c < 0) @@ -635,7 +640,7 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from (Fl_Color)(c & 15), 0.5)); } else - add_color(c); + add_color((Fl_Color)c); } } else if (strcmp(command, "bgnline") == 0) @@ -648,31 +653,38 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from { add(OUTLINEPOLYGON); outline = add(0) - data_; + add(0); } else if (strcmp(command, "endoutlinepolygon") == 0 && outline) { + unsigned cval; // Color value + // Set the outline color; see above for valid values... if (strcmp(params, "iconcolor") == 0) - data_[outline] = 256; + cval = FL_ICON_COLOR; else if (strcmp(params, "shadowcolor") == 0) - data_[outline] = FL_DARK3; + cval = FL_DARK3; else if (strcmp(params, "outlinecolor") == 0) - data_[outline] = FL_BLACK; + cval = FL_BLACK; else { - short c = atoi(params); // Color value + int c = atoi(params); // Color value if (c < 0) { // Composite color; compute average... c = -c; - data_[outline] = fl_color_average((Fl_Color)(c >> 4), (Fl_Color)(c & 15), 0.5); + cval = fl_color_average((Fl_Color)(c >> 4), (Fl_Color)(c & 15), 0.5); } else - data_[outline] = c; + cval = c; } + // Store outline color... + data_[outline] = cval >> 16; + data_[outline + 1] = cval; + outline = 0; add(END); } @@ -725,7 +737,7 @@ Fl_File_Icon::load_xpm(const char *xpm) // I - File to read from int startx; // Starting X coord int width, height; // Width and height of image int ncolors; // Number of colors - short colors[256]; // Colors + Fl_Color colors[256]; // Colors int red, green, blue; // Red, green, and blue values @@ -828,12 +840,7 @@ Fl_File_Icon::load_xpm(const char *xpm) // I - File to read from break; } - if (red == green && green == blue) - colors[ch] = FL_GRAY_RAMP + (FL_NUM_GRAY - 1) * red / 255; - else - colors[ch] = fl_color_cube((FL_NUM_RED - 1) * red / 255, - (FL_NUM_GREEN - 1) * green / 255, - (FL_NUM_BLUE - 1) * blue / 255); + colors[ch] = fl_rgb_color(red, green, blue); } else { @@ -921,13 +928,13 @@ Fl_File_Icon::load_system_icons(void) static int init = 0; // Have the icons been initialized? static short plain[] = // Plain file icon { - COLOR, 256, OUTLINEPOLYGON, FL_GRAY, + COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, VERTEX, 2000, 1000, VERTEX, 2000, 9000, VERTEX, 6000, 9000, VERTEX, 8000, 7000, - VERTEX, 8000, 1000, END, OUTLINEPOLYGON, FL_GRAY, + VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, VERTEX, 6000, 9000, VERTEX, 6000, 7000, VERTEX, 8000, 7000, END, - COLOR, FL_BLACK, LINE, VERTEX, 6000, 7000, + COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, VERTEX, 8000, 7000, VERTEX, 8000, 1000, VERTEX, 2000, 1000, END, LINE, VERTEX, 3000, 7000, VERTEX, 5000, 7000, END, LINE, VERTEX, 3000, 6000, @@ -940,26 +947,26 @@ Fl_File_Icon::load_system_icons(void) }; static short image[] = // Image file icon { - COLOR, 256, OUTLINEPOLYGON, FL_GRAY, + COLOR, -1, -1, OUTLINEPOLYGON, 0, FL_GRAY, VERTEX, 2000, 1000, VERTEX, 2000, 9000, VERTEX, 6000, 9000, VERTEX, 8000, 7000, - VERTEX, 8000, 1000, END, OUTLINEPOLYGON, FL_GRAY, + VERTEX, 8000, 1000, END, OUTLINEPOLYGON, 0, FL_GRAY, VERTEX, 6000, 9000, VERTEX, 6000, 7000, VERTEX, 8000, 7000, END, - COLOR, FL_BLACK, LINE, VERTEX, 6000, 7000, + COLOR, 0, FL_BLACK, LINE, VERTEX, 6000, 7000, VERTEX, 8000, 7000, VERTEX, 8000, 1000, VERTEX, 2000, 1000, END, - COLOR, FL_RED, POLYGON, VERTEX, 3500, 2500, + COLOR, 0, FL_RED, POLYGON, VERTEX, 3500, 2500, VERTEX, 3000, 3000, VERTEX, 3000, 4000, VERTEX, 3500, 4500, VERTEX, 4500, 4500, VERTEX, 5000, 4000, VERTEX, 5000, 3000, VERTEX, 4500, 2500, END, - COLOR, FL_GREEN, POLYGON, VERTEX, 5500, 2500, + COLOR, 0, FL_GREEN, POLYGON, VERTEX, 5500, 2500, VERTEX, 5000, 3000, VERTEX, 5000, 4000, VERTEX, 5500, 4500, VERTEX, 6500, 4500, VERTEX, 7000, 4000, VERTEX, 7000, 3000, VERTEX, 6500, 2500, END, - COLOR, FL_BLUE, POLYGON, VERTEX, 4500, 3500, + COLOR, 0, FL_BLUE, POLYGON, VERTEX, 4500, 3500, VERTEX, 4000, 4000, VERTEX, 4000, 5000, VERTEX, 4500, 5500, VERTEX, 5500, 5500, VERTEX, 6000, 5000, VERTEX, 6000, 4000, @@ -968,16 +975,16 @@ Fl_File_Icon::load_system_icons(void) }; static short dir[] = // Directory icon { - COLOR, 256, POLYGON, VERTEX, 1000, 1000, + COLOR, -1, -1, POLYGON, VERTEX, 1000, 1000, VERTEX, 1000, 7500, VERTEX, 9000, 7500, VERTEX, 9000, 1000, END, POLYGON, VERTEX, 1000, 7500, VERTEX, 2500, 9000, VERTEX, 5000, 9000, VERTEX, 6500, 7500, END, - COLOR, FL_WHITE, LINE, VERTEX, 1500, 1500, + COLOR, 0, FL_WHITE, LINE, VERTEX, 1500, 1500, VERTEX, 1500, 7000, VERTEX, 9000, 7000, END, - COLOR, FL_BLACK, LINE, VERTEX, 9000, 7500, + COLOR, 0, FL_BLACK, LINE, VERTEX, 9000, 7500, VERTEX, 9000, 1000, VERTEX, 1000, 1000, END, - COLOR, FL_GRAY, LINE, VERTEX, 1000, 1000, + COLOR, 0, FL_GRAY, LINE, VERTEX, 1000, 1000, VERTEX, 1000, 7500, VERTEX, 2500, 9000, VERTEX, 5000, 9000, VERTEX, 6500, 7500, VERTEX, 9000, 7500, END, @@ -1221,5 +1228,5 @@ get_kde_val(char *str, // -// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". +// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index f3fa112f2..25ba45a18 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.1 2001/09/29 22:59:45 easysw Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.2 2001/10/29 03:44:32 easysw Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -231,7 +231,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { } fl_clip(X, Y, W, H); - Fl_Color color = active_r() ? textcolor() : inactive(textcolor()); + Fl_Color color = active_r() ? textcolor() : fl_inactive(textcolor()); p = value(); // visit each line and draw it: @@ -276,7 +276,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { else offset2 = strlen(buf); fl_color(selection_color()); fl_rectf(X+int(x1+.5), Y+ypos, int(x2-x1), height); - fl_color(contrast(textcolor(), selection_color())); + fl_color(fl_contrast(textcolor(), selection_color())); fl_draw(buf+offset1, offset2-offset1, X+x1, Y+ypos+desc); if (pp < e) { fl_color(color); @@ -821,5 +821,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.1 2001/09/29 22:59:45 easysw Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 000e7d706..511c13bda 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.3 2001/09/04 13:13:29 easysw Exp $" +// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.4 2001/10/29 03:44:32 easysw Exp $" // // Menu code for the Fast Light Tool Kit (FLTK). // @@ -132,21 +132,21 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA); l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE; l.color = labelcolor_ ? labelcolor_ : m ? m->textcolor() : int(FL_BLACK); - if (!active()) l.color = inactive((Fl_Color)l.color); + if (!active()) l.color = fl_inactive((Fl_Color)l.color); Fl_Color color = m ? m->color() : FL_GRAY; if (selected) { Fl_Color r = m ? m->selection_color() : FL_SELECTION_COLOR; Fl_Boxtype b = m && m->down_box() ? m->down_box() : FL_FLAT_BOX; - if (contrast(r,color)!=r) { // back compatability boxtypes + if (fl_contrast(r,color)!=r) { // back compatability boxtypes if (selected == 2) { // menu title r = color; b = m ? m->box() : FL_UP_BOX; } else { r = (Fl_Color)(FL_COLOR_CUBE-1); // white - l.color = contrast((Fl_Color)labelcolor_, r); + l.color = fl_contrast((Fl_Color)labelcolor_, r); } } else { - l.color = contrast((Fl_Color)labelcolor_, r); + l.color = fl_contrast((Fl_Color)labelcolor_, r); } if (selected == 2) { // menu title fl_draw_box(b, x, y, w, h, r); @@ -752,5 +752,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { } // -// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $". +// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.4 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index d8406aff7..30300b70c 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Progress.cxx,v 1.1.2.1 2001/08/11 14:49:51 easysw Exp $" +// "$Id: Fl_Progress.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $" // // Progress bar widget routines. // @@ -73,7 +73,7 @@ void Fl_Progress::draw() { fl_clip(x() + bx, y() + by, w() - bw, h() - bh); - fl_color(active_r() ? color2() : inactive(color2())); + fl_color(active_r() ? color2() : fl_inactive(color2())); fl_polygon(x() + bx, y() + by, x() + bx, y() + h() - by, x() + 3 + progress - h() / 4, y() + h() - by, @@ -104,5 +104,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.1 2001/08/11 14:49:51 easysw Exp $". +// End of "$Id: Fl_Progress.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx index c252dc2b7..29272853d 100644 --- a/src/Fl_Scrollbar.cxx +++ b/src/Fl_Scrollbar.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.2 2001/08/05 14:00:15 easysw Exp $" +// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.3 2001/10/29 03:44:32 easysw Exp $" // // Scroll bar widget for the Fast Light Tool Kit (FLTK). // @@ -202,7 +202,7 @@ void Fl_Scrollbar::draw() { if (active_r()) fl_color(labelcolor()); else - fl_color(inactive(labelcolor())); + fl_color(fl_inactive(labelcolor())); int w1 = (H-4)/3; if (w1 < 1) w1 = 1; int x1 = X+(H-w1-1)/2; int y1 = Y+(H-2*w1-1)/2; @@ -244,5 +244,5 @@ Fl_Scrollbar::Fl_Scrollbar(int X, int Y, int W, int H, const char* L) } // -// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.2 2001/08/05 14:00:15 easysw Exp $". +// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.3 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index fb9242be5..efa519c41 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.2 2001/08/06 23:51:39 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.3 2001/10/29 03:44:32 easysw Exp $" // // Copyright Mark Edel. Permission to distribute under the LGPL for // the FLTK library granted by Mark Edel. @@ -1591,6 +1591,7 @@ void Fl_Text_Display::update_v_scrollbar() { bar maximum value is chosen to generally represent the size of the whole buffer, with minor adjustments to keep the scroll bar widget happy */ mVScrollBar->value(mTopLineNum, mNVisibleLines, 1, mNBufferLines+2); + mVScrollBar->linesize(1); } /* @@ -1877,6 +1878,7 @@ int Fl_Text_Display::handle(int event) { switch (event) { case FL_PUSH: { + Fl::focus(this); // Take focus from any child widgets... if (Fl::event_state()&FL_SHIFT) return handle(FL_DRAG); dragging = 1; int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS); @@ -1948,5 +1950,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.2 2001/08/06 23:51:39 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.3 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 5baabf8da..7248a4a3b 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.cxx,v 1.38.2.3 2001/10/18 18:53:20 easysw Exp $" +// "$Id: Fl_Tooltip.cxx,v 1.38.2.4 2001/10/29 03:44:32 easysw Exp $" // // Tooltip source file for the Fast Light Tool Kit (FLTK). // @@ -42,7 +42,7 @@ Fl_TooltipBox *Fl_Tooltip::box = 0; Fl_Menu_Window *Fl_Tooltip::window = 0; Fl_Widget *Fl_Tooltip::widget = 0; int Fl_Tooltip::shown = 0; -uchar Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1, +unsigned Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1, FL_NUM_GREEN - 1, FL_NUM_BLUE - 2); int Fl_Tooltip::font_ = FL_HELVETICA; @@ -189,5 +189,5 @@ Fl_Tooltip::tooltip_timeout(void *v) { // -// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.3 2001/10/18 18:53:20 easysw Exp $". +// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.4 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Value_Output.cxx b/src/Fl_Value_Output.cxx index 5d4b64a6a..4f8e6d635 100644 --- a/src/Fl_Value_Output.cxx +++ b/src/Fl_Value_Output.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Output.cxx,v 1.6.2.3 2001/01/22 15:13:40 easysw Exp $" +// "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.1 2001/10/29 03:44:32 easysw Exp $" // // Value output widget for the Fast Light Tool Kit (FLTK). // @@ -45,7 +45,7 @@ void Fl_Value_Output::draw() { } char buf[128]; format(buf); - fl_color(active_r() ? textcolor() : inactive(textcolor())); + fl_color(active_r() ? textcolor() : fl_inactive(textcolor())); fl_font(textfont(), textsize()); fl_draw(buf,X+3,Y,W-6,H,FL_ALIGN_LEFT); } @@ -94,5 +94,5 @@ Fl_Value_Output::Fl_Value_Output(int x,int y,int w,int h,const char *l) } // -// End of "$Id: Fl_Value_Output.cxx,v 1.6.2.3 2001/01/22 15:13:40 easysw Exp $". +// End of "$Id: Fl_Value_Output.cxx,v 1.6.2.3.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_Value_Slider.cxx b/src/Fl_Value_Slider.cxx index 9185f7ed6..23105658f 100644 --- a/src/Fl_Value_Slider.cxx +++ b/src/Fl_Value_Slider.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Slider.cxx,v 1.5.2.4 2001/01/22 15:13:40 easysw Exp $" +// "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.1 2001/10/29 03:44:32 easysw Exp $" // // Value slider widget for the Fast Light Tool Kit (FLTK). // @@ -53,7 +53,7 @@ void Fl_Value_Slider::draw() { char buf[128]; format(buf); fl_font(textfont(), textsize()); - fl_color(active_r() ? textcolor() : inactive(textcolor())); + fl_color(active_r() ? textcolor() : fl_inactive(textcolor())); fl_draw(buf, bxx, byy, bww, bhh, FL_ALIGN_CLIP); } @@ -72,5 +72,5 @@ int Fl_Value_Slider::handle(int event) { } // -// End of "$Id: Fl_Value_Slider.cxx,v 1.5.2.4 2001/01/22 15:13:40 easysw Exp $". +// End of "$Id: Fl_Value_Slider.cxx,v 1.5.2.4.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index 5904d84d0..7fde64290 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 2001/03/20 18:02:52 spitzak Exp $" +// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.1 2001/10/29 03:44:32 easysw Exp $" // // System color support for the Fast Light Tool Kit (FLTK). // @@ -50,7 +50,7 @@ void Fl::foreground(uchar r, uchar g, uchar 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(contrast(FL_BLACK,FL_WHITE))); + Fl::set_color(FL_BLACK,get_color(fl_contrast(FL_BLACK,FL_WHITE))); } // these are set by Fl::args() and override any system colors: @@ -150,5 +150,5 @@ void Fl::get_system_colors() #endif // -// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7 2001/03/20 18:02:52 spitzak Exp $". +// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.1 2001/10/29 03:44:32 easysw Exp $". // diff --git a/src/fl_color.cxx b/src/fl_color.cxx index 8aefae0f9..0915159ed 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.1 2001/08/04 12:21:33 easysw Exp $" +// "$Id: fl_color.cxx,v 1.12.2.5.2.2 2001/10/29 03:44:33 easysw Exp $" // // Color functions for the Fast Light Tool Kit (FLTK). // @@ -269,8 +269,13 @@ ulong fl_xpixel(Fl_Color i) { Fl_Color fl_color_; void fl_color(Fl_Color i) { - fl_color_ = i; - XSetForeground(fl_display, fl_gc, fl_xpixel(i)); + if (i & 0xffffff00) { + unsigned rgb = (unsigned)i; + fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8)); + } else { + fl_color_ = i; + XSetForeground(fl_display, fl_gc, fl_xpixel(i)); + } } void Fl::free_color(Fl_Color i, int overlay) { @@ -305,38 +310,42 @@ void Fl::set_color(Fl_Color i, unsigned c) { #endif // end of X-specific code unsigned Fl::get_color(Fl_Color i) { - return fl_cmap[i]; + if (i & 0xffffff00) return (i); + else return fl_cmap[i]; } void Fl::set_color(Fl_Color i, uchar red, uchar green, uchar blue) { - Fl::set_color(i, + Fl::set_color((Fl_Color)(i & 255), ((unsigned)red<<24)+((unsigned)green<<16)+((unsigned)blue<<8)); } void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) { - unsigned c = fl_cmap[i]; + unsigned c; + + if (i & 0xffffff00) c = (unsigned)i; + else c = fl_cmap[i]; + red = uchar(c>>24); green = uchar(c>>16); blue = uchar(c>>8); } Fl_Color fl_color_average(Fl_Color color1, Fl_Color color2, float weight) { - Fl_Color avg; - unsigned rgb1 = fl_cmap[color1]; - unsigned rgb2 = fl_cmap[color2]; + unsigned rgb1; + unsigned rgb2; uchar r, g, b; + if (color1 & 0xffffff00) rgb1 = color1; + else rgb1 = fl_cmap[color1 & 255]; + + if (color2 & 0xffffff00) rgb2 = color2; + else rgb2 = fl_cmap[color2 & 255]; + r = (uchar)(((uchar)(rgb1>>24))*weight + ((uchar)(rgb2>>24))*(1-weight)); g = (uchar)(((uchar)(rgb1>>16))*weight + ((uchar)(rgb2>>16))*(1-weight)); b = (uchar)(((uchar)(rgb1>>8))*weight + ((uchar)(rgb2>>8))*(1-weight)); - if (r == g && r == b) { // get it out of gray ramp - avg = fl_gray_ramp(r*FL_NUM_GRAY/256); - } else { // get it out of color cube: - avg = fl_color_cube(r*FL_NUM_RED/256,g*FL_NUM_GREEN/256,b*FL_NUM_BLUE/256); - } - - return avg; + return fl_rgb_color(r, g, b); } Fl_Color fl_inactive(Fl_Color c) { @@ -344,8 +353,14 @@ Fl_Color fl_inactive(Fl_Color c) { } Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) { - int c1 = int(fl_cmap[fg]); - int c2 = int(fl_cmap[bg]); + unsigned c1, c2; + + if (fg & 0xffffff00) c1 = (unsigned)fg; + else c1 = fl_cmap[fg]; + + if (bg & 0xffffff00) c2 = (unsigned)bg; + else c2 = fl_cmap[bg]; + if ((c1^c2)&0x80800000) return fg; else if (c2&0x80800000) @@ -355,5 +370,5 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) { } // -// End of "$Id: fl_color.cxx,v 1.12.2.5.2.1 2001/08/04 12:21:33 easysw Exp $". +// End of "$Id: fl_color.cxx,v 1.12.2.5.2.2 2001/10/29 03:44:33 easysw Exp $". // diff --git a/src/fl_color_win32.cxx b/src/fl_color_win32.cxx index b0549e91a..d13a9eab8 100644 --- a/src/fl_color_win32.cxx +++ b/src/fl_color_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_color_win32.cxx,v 1.14.2.3.2.1 2001/09/30 12:42:33 easysw Exp $" +// "$Id: fl_color_win32.cxx,v 1.14.2.3.2.2 2001/10/29 03:44:33 easysw Exp $" // // WIN32 color functions for the Fast Light Tool Kit (FLTK). // @@ -83,22 +83,27 @@ static void set_xmap(Fl_XMap& xmap, COLORREF c) { Fl_Color fl_color_; void fl_color(Fl_Color i) { - fl_color_ = i; - Fl_XMap &xmap = fl_xmap[i]; - if (!xmap.pen) { + if (i & 0xffffff00) { + unsigned rgb = (unsigned)i; + fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8)); + } else { + fl_color_ = i; + Fl_XMap &xmap = fl_xmap[i]; + if (!xmap.pen) { #if USE_COLORMAP - if (fl_palette) { - set_xmap(xmap, PALETTEINDEX(i)); - } else { + if (fl_palette) { + set_xmap(xmap, PALETTEINDEX(i)); + } else { #endif - unsigned c = fl_cmap[i]; - set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8))); + unsigned c = fl_cmap[i]; + set_xmap(xmap, RGB(uchar(c>>24), uchar(c>>16), uchar(c>>8))); #if USE_COLORMAP - } + } #endif + } + fl_current_xmap = ⟼ + SelectObject(fl_gc, (HGDIOBJ)(xmap.pen)); } - fl_current_xmap = ⟼ - SelectObject(fl_gc, (HGDIOBJ)(xmap.pen)); } void fl_color(uchar r, uchar g, uchar b) { @@ -216,5 +221,5 @@ fl_select_palette(void) #endif // -// End of "$Id: fl_color_win32.cxx,v 1.14.2.3.2.1 2001/09/30 12:42:33 easysw Exp $". +// End of "$Id: fl_color_win32.cxx,v 1.14.2.3.2.2 2001/10/29 03:44:33 easysw Exp $". // diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx index 3783c97d6..657bf40b3 100644 --- a/src/fl_labeltype.cxx +++ b/src/fl_labeltype.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_labeltype.cxx,v 1.6.2.3.2.3 2001/09/02 11:23:27 easysw Exp $" +// "$Id: fl_labeltype.cxx,v 1.6.2.3.2.4 2001/10/29 03:44:33 easysw Exp $" // // Label drawing routines for the Fast Light Tool Kit (FLTK). // @@ -124,7 +124,7 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const { if (flags()&SHORTCUT_LABEL) fl_draw_shortcut = 1; Fl_Label l1 = label_; if (!active_r()) { - l1.color = inactive((Fl_Color)l1.color); + l1.color = fl_inactive((Fl_Color)l1.color); if (l1.deimage) l1.image = l1.deimage; } l1.draw(X,Y,W,H,a); @@ -136,5 +136,5 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const { #include // -// End of "$Id: fl_labeltype.cxx,v 1.6.2.3.2.3 2001/09/02 11:23:27 easysw Exp $". +// End of "$Id: fl_labeltype.cxx,v 1.6.2.3.2.4 2001/10/29 03:44:33 easysw Exp $". // diff --git a/test/input.cxx b/test/input.cxx index db65bfba5..2a1e5255c 100644 --- a/test/input.cxx +++ b/test/input.cxx @@ -1,5 +1,5 @@ // -// "$Id: input.cxx,v 1.5.2.4 2001/05/05 23:39:01 spitzak Exp $" +// "$Id: input.cxx,v 1.5.2.4.2.1 2001/10/29 03:44:33 easysw Exp $" // // Input field test program for the Fast Light Tool Kit (FLTK). // @@ -67,7 +67,7 @@ void color_cb(Fl_Widget* button, void* v) { uchar r,g,b; Fl::get_color(c, r,g,b); if (fl_color_chooser(0,r,g,b)) { Fl::set_color(c,r,g,b); Fl::redraw(); - button->labelcolor(contrast(FL_BLACK,c)); + button->labelcolor(fl_contrast(FL_BLACK,c)); button->redraw(); } } @@ -107,10 +107,10 @@ int main(int argc, char **argv) { b->color(input[0]->color()); b->callback(color_cb, (void*)0); b = new Fl_Button(220,y1,100,25,"selection_color"); y1 += 25; b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1); - b->labelcolor(contrast(FL_BLACK,b->color())); + b->labelcolor(fl_contrast(FL_BLACK,b->color())); b = new Fl_Button(220,y1,100,25,"textcolor"); y1 += 25; b->color(input[0]->textcolor()); b->callback(color_cb, (void*)2); - b->labelcolor(contrast(FL_BLACK,b->color())); + b->labelcolor(fl_contrast(FL_BLACK,b->color())); window->end(); window->show(argc,argv); @@ -118,5 +118,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: input.cxx,v 1.5.2.4 2001/05/05 23:39:01 spitzak Exp $". +// End of "$Id: input.cxx,v 1.5.2.4.2.1 2001/10/29 03:44:33 easysw Exp $". // diff --git a/test/radio.fl b/test/radio.fl index 360ed58fc..680636857 100644 --- a/test/radio.fl +++ b/test/radio.fl @@ -1,71 +1,73 @@ -# data file for FL User Interface Designer (fluid) -version 0.99 +# data file for the Fltk User Interface Designer (fluid) +version 1.0100 +header_name {.h} +code_name {.cxx} gridx 10 gridy 5 snap 3 Function {} {open } { - Fl_Window {} {open selected - xywh {447 255 462 453} + Fl_Window {} {open + xywh {447 255 369 214} visible } { Fl_Button {} { - label Fl_Button open + label Fl_Button xywh {20 10 160 30} } Fl_Return_Button {} { - label Fl_Return_Button open + label Fl_Return_Button xywh {20 50 160 30} } Fl_Light_Button {} { - label Fl_Light_Button open + label Fl_Light_Button xywh {20 90 160 30} } Fl_Check_Button {} { - label Fl_Check_Button open - xywh {20 130 160 30} box 2 + label Fl_Check_Button + xywh {20 130 160 30} down_box DOWN_BOX } Fl_Round_Button {} { - label Fl_Round_Button open - xywh {20 170 160 30} box 2 + label Fl_Round_Button selected + xywh {20 170 160 30} down_box ROUND_DOWN_BOX } Fl_Group {} { - xywh {190 10 70 120} box 8 + xywh {190 10 70 120} box THIN_UP_FRAME } { - Fl_Check_Button {} { - label radio open - xywh {190 10 70 30} type 102 + Fl_Round_Button {} { + label radio + xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX } - Fl_Check_Button {} { - label radio open - xywh {190 40 70 30} type 102 + Fl_Round_Button {} { + label radio + xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX } - Fl_Check_Button {} { - label radio open - xywh {190 70 70 30} type 102 + Fl_Round_Button {} { + label radio + xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX } - Fl_Check_Button {} { - label radio open - xywh {190 100 70 30} type 102 + Fl_Round_Button {} { + label radio + xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX } } Fl_Group {} {open - xywh {270 10 90 115} box 6 + xywh {270 10 90 115} box THIN_UP_BOX } { Fl_Button {} { - label radio open - xywh {280 20 20 20} type 102 color {47 1} align 8 + label radio + xywh {280 20 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { - label radio open - xywh {280 45 20 20} type 102 color {47 1} align 8 + label radio + xywh {280 45 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { - label radio open - xywh {280 70 20 20} type 102 color {47 1} align 8 + label radio + xywh {280 70 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { - label radio open - xywh {280 95 20 20} type 102 color {47 1} align 8 + label radio + xywh {280 95 20 20} type Radio selection_color 1 align 8 } } } -- cgit v1.2.3