diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-06 18:12:35 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-06 18:12:35 +0000 |
| commit | 9c758380115f01878036f2985f7f02146e3d860f (patch) | |
| tree | 37de01750a1ddcbdcec5b08a4fa7092276b870ca /src | |
| parent | ab896c6d5faa206ca23df371fc1c17b8a1666007 (diff) | |
Use FL_NO_BOX for check button and round button.
Clip Fl_Tiled_Image to the bounding box.
Draw Fl_Progress using the box.
Draw plastic box types right for narrow (but horizontal buttons)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1814 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Check_Button.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_Progress.cxx | 29 | ||||
| -rw-r--r-- | src/Fl_Round_Button.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Tiled_Image.cxx | 8 | ||||
| -rw-r--r-- | src/fl_plastic.cxx | 10 |
5 files changed, 32 insertions, 25 deletions
diff --git a/src/Fl_Check_Button.cxx b/src/Fl_Check_Button.cxx index 5afafec40..e6e4e6006 100644 --- a/src/Fl_Check_Button.cxx +++ b/src/Fl_Check_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Check_Button.cxx,v 1.4.2.3.2.1 2001/08/04 16:43:31 easysw Exp $" +// "$Id: Fl_Check_Button.cxx,v 1.4.2.3.2.2 2001/12/06 18:12:35 easysw Exp $" // // Check button widget for the Fast Light Tool Kit (FLTK). // @@ -32,7 +32,7 @@ Fl_Check_Button::Fl_Check_Button(int x, int y, int w, int h, const char *l) : Fl_Light_Button(x, y, w, h, l) { - box(FL_FLAT_BOX); + box(FL_NO_BOX); down_box(FL_DOWN_BOX); selection_color(FL_BLACK); } diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index 30300b70c..6672d218f 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Progress.cxx,v 1.1.2.2 2001/10/29 03:44:32 easysw Exp $" +// "$Id: Fl_Progress.cxx,v 1.1.2.3 2001/12/06 18:12:35 easysw Exp $" // // Progress bar widget routines. // @@ -51,6 +51,7 @@ void Fl_Progress::draw() { int progress; // Size of progress bar... int bx, by, bw, bh; // Box areas... + int tx, tw; // Temporary X + width // Get the box borders... @@ -59,31 +60,31 @@ void Fl_Progress::draw() bw = Fl::box_dw(box()); bh = Fl::box_dh(box()); - // Draw the box... - draw_box(box(), x(), y(), w(), h(), color()); + tx = x() + bx; + tw = w() - bw; // Draw the progress bar... if (maximum_ > minimum_) - progress = (int)((w() - bw) * (value_ - minimum_) / - (maximum_ - minimum_) + 0.5f); + progress = (int)(tw * (value_ - minimum_) / (maximum_ - minimum_) + 0.5f); else progress = 0; + // Draw the box... if (progress > 0) { - fl_clip(x() + bx, y() + by, w() - bw, h() - bh); - - 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, - x() + 1 + progress + h() / 4, y() + by); + fl_clip(x(), y(), progress + bx, h()); + draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2())); + fl_pop_clip(); + fl_clip(tx + progress, y(), w() - progress, h()); + draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color())); fl_pop_clip(); } + else + draw_box(box(), x(), y(), w(), h(), color()); // Finally, the label... - draw_label(x() + bx, y() + by, w() - bw, h() - bh); + draw_label(tx, y() + by, tw, h() - bh); } @@ -104,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.2 2001/10/29 03:44:32 easysw Exp $". +// End of "$Id: Fl_Progress.cxx,v 1.1.2.3 2001/12/06 18:12:35 easysw Exp $". // diff --git a/src/Fl_Round_Button.cxx b/src/Fl_Round_Button.cxx index 6eef6b91e..1f83b3726 100644 --- a/src/Fl_Round_Button.cxx +++ b/src/Fl_Round_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.1 2001/08/04 16:43:31 easysw Exp $" +// "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.2 2001/12/06 18:12:35 easysw Exp $" // // Round button for the Fast Light Tool Kit (FLTK). // @@ -32,11 +32,11 @@ Fl_Round_Button::Fl_Round_Button(int x,int y,int w,int h, const char *l) : Fl_Light_Button(x,y,w,h,l) { - box(FL_FLAT_BOX); + box(FL_NO_BOX); down_box(FL_ROUND_DOWN_BOX); selection_color(FL_BLACK); } // -// End of "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.1 2001/08/04 16:43:31 easysw Exp $". +// End of "$Id: Fl_Round_Button.cxx,v 1.4.2.3.2.2 2001/12/06 18:12:35 easysw Exp $". // diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx index fc652ca43..22cb2b86c 100644 --- a/src/Fl_Tiled_Image.cxx +++ b/src/Fl_Tiled_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tiled_Image.cxx,v 1.1.2.1 2001/11/24 18:07:57 easysw Exp $" +// "$Id: Fl_Tiled_Image.cxx,v 1.1.2.2 2001/12/06 18:12:35 easysw Exp $" // // Tiled image code for the Fast Light Tool Kit (FLTK). // @@ -113,6 +113,8 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position if (W == 0) W = Fl::w(); if (H == 0) H = Fl::h(); + fl_clip(X, Y, W, H); + X += cx; Y += cy; @@ -125,9 +127,11 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position for (int yy = Y; yy < H; yy += image_->h()) for (int xx = X; xx < W; xx += image_->w()) image_->draw(xx, yy); + + fl_pop_clip(); } // -// End of "$Id: Fl_Tiled_Image.cxx,v 1.1.2.1 2001/11/24 18:07:57 easysw Exp $". +// End of "$Id: Fl_Tiled_Image.cxx,v 1.1.2.2 2001/12/06 18:12:35 easysw Exp $". // diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx index ed9eebb24..8d1b9cf84 100644 --- a/src/fl_plastic.cxx +++ b/src/fl_plastic.cxx @@ -1,9 +1,11 @@ // -// "$Id: fl_plastic.cxx,v 1.1.2.2 2001/12/01 13:59:50 easysw Exp $" +// "$Id: fl_plastic.cxx,v 1.1.2.3 2001/12/06 18:12:35 easysw Exp $" // // "Plastic" drawing routines for the Fast Light Tool Kit (FLTK). // -// These box types provide a +// These box types provide a cross between Aqua and KDE buttons; kindof +// like translucent plastic buttons... +// // Copyright 2001 by Michael Sweet. // // This library is free software; you can redistribute it and/or @@ -64,7 +66,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) int clen = strlen(c); - if (w >= h) + if (h < (w * 2)) { h ++; cmod = clen % h; @@ -163,5 +165,5 @@ Fl_Boxtype define_FL_PLASTIC_UP_BOX() { // -// End of "$Id: fl_plastic.cxx,v 1.1.2.2 2001/12/01 13:59:50 easysw Exp $". +// End of "$Id: fl_plastic.cxx,v 1.1.2.3 2001/12/06 18:12:35 easysw Exp $". // |
