Skip to content

Commit

Permalink
Made plastic up and down box look good when large without wasting
Browse files Browse the repository at this point in the history
too much resources.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1842 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Dec 13, 2001
1 parent 62c1611 commit 922a386
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions 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).
//
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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 $".
//

0 comments on commit 922a386

Please sign in to comment.