summaryrefslogtreecommitdiff
path: root/src/fl_plastic.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2001-12-13 21:48:58 +0000
committerMatthias Melcher <fltk@matthiasm.com>2001-12-13 21:48:58 +0000
commit922a38629eac1a9c857f46a6170f8bcdab323790 (patch)
tree6d7ecccfdf25f24bfc6e61abf72633e7d8c8415f /src/fl_plastic.cxx
parent62c161126c98c1dc8e574bece3a70ac650a2e481 (diff)
Made plastic up and down box look good when large without wasting
too much resources. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1842 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_plastic.cxx')
-rw-r--r--src/fl_plastic.cxx42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx
index 76139c6b9..63a5a0626 100644
--- a/src/fl_plastic.cxx
+++ b/src/fl_plastic.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_plastic.cxx,v 1.1.2.4 2001/12/13 20:11:56 easysw Exp $"
+// "$Id: fl_plastic.cxx,v 1.1.2.5 2001/12/13 21:48:58 matthiaswm Exp $"
//
// "Plastic" drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -120,10 +120,22 @@ 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 (w > 30 && h > 30)
- {
- uchar *g = fl_gray_ramp();
- fl_color(shade_color(g['W'], c));
- fl_rectf(x + 2, y + 2, w - 4, h - 4);
+ {
+ uchar *g = fl_gray_ramp();
+ if ( h<(w*2) )
+ {
+ shade_rect(x + 2, y + 2, w - 4, 9, "VTR", c);
+ fl_color(shade_color(g['P'], c));
+ fl_rectf(x + 2, y + 11, w - 4, h - 25);
+ shade_rect(x + 2, y + h - 14, w - 4, 12, "RTVXX", c);
+ }
+ else
+ {
+ shade_rect(x + 2, y + 2, 9, h-4, "VTR", c);
+ fl_color(shade_color(g['P'], c));
+ fl_rectf(x + 11, y + 2, w - 25, h - 4);
+ shade_rect(x + w - 14, y + 2, 12, h-4, "RTVXX", c);
+ }
}
else
shade_rect(x + 2, y + 2, w - 4, h - 4, "VTRPPRTVXX", c);
@@ -140,9 +152,21 @@ static void down_frame(int x, int y, int w, int h, Fl_Color c) {
static void down_box(int x, int y, int w, int h, Fl_Color c) {
if (w > 30 && h > 30)
{
- uchar *g = fl_gray_ramp();
- fl_color(shade_color(g['T'], c));
- fl_rectf(x + 2, y + 2, w - 4, h - 4);
+ uchar *g = fl_gray_ramp();
+ if ( w>=h )
+ {
+ shade_rect(x + 2, y + 2, w - 4, 11, "STUV", c);
+ fl_color(shade_color(g['W'], c));
+ fl_rectf(x + 2, y + 13, w - 4, h - 21);
+ shade_rect(x + 2, y + h - 8, w - 4, 6, "VT", c);
+ }
+ else
+ {
+ shade_rect(x + 2, y + 2, 11, h-4, "STUV", c);
+ fl_color(shade_color(g['W'], c));
+ fl_rectf(x + 13, y + 2, w - 21, h - 4);
+ shade_rect(x + w - 8, y + 2, 6, h-4, "VT", c);
+ }
}
else
shade_rect(x + 2, y + 2, w - 4, h - 4, "STUVWWWWVT", c);
@@ -165,5 +189,5 @@ Fl_Boxtype define_FL_PLASTIC_UP_BOX() {
//
-// End of "$Id: fl_plastic.cxx,v 1.1.2.4 2001/12/13 20:11:56 easysw Exp $".
+// End of "$Id: fl_plastic.cxx,v 1.1.2.5 2001/12/13 21:48:58 matthiaswm Exp $".
//