summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Menu.cxx14
-rw-r--r--src/Fl_get_system_colors.cxx8
-rw-r--r--src/fl_boxtype.cxx6
-rw-r--r--src/fl_plastic.cxx58
4 files changed, 71 insertions, 15 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index f16212ef9..ce2bb6d25 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.23 2003/01/30 21:42:05 easysw Exp $"
+// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.24 2003/05/18 22:12:20 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -341,8 +341,14 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) {
int hh = itemheight - LEADING;
if (eraseit && n != selected) {
- fl_color(button && !Fl::scheme() ? button->color() : FL_GRAY);
- fl_rectf(xx+1, yy-(LEADING-2)/2, ww-2, hh+(LEADING-2));
+ if (Fl::scheme()) {
+ fl_push_clip(xx+1, yy-(LEADING-2)/2, ww-2, hh+(LEADING-2));
+ draw_box(box(), 0, 0, w(), h(), color());
+ fl_pop_clip();
+ } else {
+ fl_color(button ? button->color() : FL_GRAY);
+ fl_rectf(xx+1, yy-(LEADING-2)/2, ww-2, hh+(LEADING-2));
+ }
}
m->draw(xx, yy, ww, hh, button, n==selected);
@@ -784,5 +790,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.23 2003/01/30 21:42:05 easysw Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.24 2003/05/18 22:12:20 easysw Exp $".
//
diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx
index 92fadc6f0..180d42cf7 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.18 2003/05/16 02:19:46 easysw Exp $"
+// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.19 2003/05/18 22:12:21 easysw Exp $"
//
// System color support for the Fast Light Tool Kit (FLTK).
//
@@ -283,8 +283,8 @@ int Fl::reload_scheme() {
set_boxtype(FL_UP_BOX, FL_PLASTIC_UP_BOX);
set_boxtype(FL_DOWN_BOX, FL_PLASTIC_DOWN_BOX);
- set_boxtype(FL_THIN_UP_BOX, FL_PLASTIC_UP_BOX);
- set_boxtype(FL_THIN_DOWN_BOX, FL_PLASTIC_DOWN_BOX);
+ set_boxtype(FL_THIN_UP_BOX, FL_PLASTIC_THIN_UP_BOX);
+ set_boxtype(FL_THIN_DOWN_BOX, FL_PLASTIC_THIN_DOWN_BOX);
set_boxtype(_FL_ROUND_UP_BOX, FL_PLASTIC_UP_BOX);
set_boxtype(_FL_ROUND_DOWN_BOX, FL_PLASTIC_UP_BOX);
} else {
@@ -320,5 +320,5 @@ int Fl::reload_scheme() {
//
-// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.18 2003/05/16 02:19:46 easysw Exp $".
+// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.19 2003/05/18 22:12:21 easysw Exp $".
//
diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx
index 8e26b00c3..2d7c2f27d 100644
--- a/src/fl_boxtype.cxx
+++ b/src/fl_boxtype.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_boxtype.cxx,v 1.8.2.4.2.12 2003/01/30 21:43:27 easysw Exp $"
+// "$Id: fl_boxtype.cxx,v 1.8.2.4.2.13 2003/05/18 22:12:24 easysw Exp $"
//
// Box drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -226,6 +226,8 @@ static struct {
{fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_BOX,
{fl_up_frame, 2,2,4,4,0}, // _FL_PLASTIC_UP_FRAME,
{fl_down_frame, 2,2,4,4,0}, // _FL_PLASTIC_DOWN_FRAME,
+ {fl_up_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_UP_BOX,
+ {fl_down_box, 2,2,4,4,0}, // _FL_PLASTIC_THIN_DOWN_BOX,
{fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+0
{fl_down_box, 3,3,6,6,0}, // FL_FREE_BOX+1
{fl_up_box, 3,3,6,6,0}, // FL_FREE_BOX+2
@@ -295,5 +297,5 @@ const {
}
//
-// End of "$Id: fl_boxtype.cxx,v 1.8.2.4.2.12 2003/01/30 21:43:27 easysw Exp $".
+// End of "$Id: fl_boxtype.cxx,v 1.8.2.4.2.13 2003/05/18 22:12:24 easysw Exp $".
//
diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx
index e8565a829..f073463e3 100644
--- a/src/fl_plastic.cxx
+++ b/src/fl_plastic.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_plastic.cxx,v 1.1.2.17 2003/05/16 18:33:03 easysw Exp $"
+// "$Id: fl_plastic.cxx,v 1.1.2.18 2003/05/18 22:12:24 easysw Exp $"
//
// "Plastic" drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -34,13 +34,48 @@
#include <FL/fl_draw.H>
#include "flstring.h"
+//
+// Uncomment the following line to restore the old plastic box type
+// appearance.
+//
+
+//#define USE_OLD_PLASTIC_BOX
extern uchar *fl_gray_ramp();
inline Fl_Color shade_color(uchar gc, Fl_Color bc) {
+#ifdef USE_OLD_PLASTIC_BOX
return fl_color_average((Fl_Color)gc, bc, 0.75f);
+#else
+ unsigned grgb = Fl::get_color((Fl_Color)gc),
+ brgb = Fl::get_color(bc);
+ int red, green, blue, gray;
+
+
+ gray = ((grgb >> 24) & 255);
+ red = gray * ((brgb >> 24) & 255) / 255 + gray * gray / 510;
+ gray = ((grgb >> 16) & 255);
+ green = gray * ((brgb >> 16) & 255) / 255 + gray * gray / 510;
+ gray = ((grgb >> 8) & 255);
+ blue = gray * ((brgb >> 8) & 255) / 255 + gray * gray / 510;
+
+ if (red > 255)
+ red = 255;
+
+ if (green > 255)
+ green = 255;
+
+ if (blue > 255)
+ blue = 255;
+
+ if (Fl::draw_box_active())
+ return fl_rgb_color(red, green, blue);
+ else
+ return fl_color_average(FL_GRAY, fl_rgb_color(red, green, blue), 0.75f);
+#endif // USE_OLD_PLASTIC_BOX
}
+
static void shade_frame(int x, int y, int w, int h, const char *c, Fl_Color bc) {
uchar *g = fl_gray_ramp();
int b = strlen(c) / 4 + 1;
@@ -141,13 +176,24 @@ static void up_frame(int x, int y, int w, int h, Fl_Color c) {
static void up_box(int x, int y, int w, int h, Fl_Color c) {
-#if 0 // OLD UP BOX
+#ifdef USE_OLD_PLASTIC_BOX
shade_rect(x + 2, y + 2, w - 4, h - 5, "RVQNOPQRSTUVWVQ", c);
up_frame(x, y, w, h, c);
-#else // NEW UP BOX
+#else
shade_rect(x + 1, y + 1, w - 2, h - 3, "RVQNOPQRSTUVWVQ", c);
shade_frame(x, y, w, h - 1, "IJLM", c);
-#endif // 0
+#endif // USE_OLD_PLASTIC_BOX
+}
+
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+#ifdef USE_OLD_PLASTIC_BOX
+ shade_rect(x + 2, y + 2, w - 4, h - 5, "RVQNOPQRSTUVWVQ", c);
+ up_frame(x, y, w, h, c);
+#else
+ shade_rect(x + 1, y + 1, w - 2, h - 3, "RQOQSUWQ", c);
+ shade_frame(x, y, w, h - 1, "IJLM", c);
+#endif // USE_OLD_PLASTIC_BOX
}
@@ -171,11 +217,13 @@ Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX() {
fl_internal_boxtype(_FL_PLASTIC_DOWN_BOX, down_box);
fl_internal_boxtype(_FL_PLASTIC_UP_FRAME, up_frame);
fl_internal_boxtype(_FL_PLASTIC_DOWN_FRAME, down_frame);
+ fl_internal_boxtype(_FL_PLASTIC_THIN_UP_BOX, thin_up_box);
+ fl_internal_boxtype(_FL_PLASTIC_THIN_DOWN_BOX, down_box);
return _FL_PLASTIC_UP_BOX;
}
//
-// End of "$Id: fl_plastic.cxx,v 1.1.2.17 2003/05/16 18:33:03 easysw Exp $".
+// End of "$Id: fl_plastic.cxx,v 1.1.2.18 2003/05/18 22:12:24 easysw Exp $".
//