diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-30 15:34:58 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-30 15:34:58 +0000 |
| commit | 19b4d2fd1cb060a83ed75353f876dec3877059a5 (patch) | |
| tree | e44b2560e039efb795f87765f939c46160994e65 /src | |
| parent | 2779ff9099ed5b2805d1e8d247594d4b019eed05 (diff) | |
Fix radio button drawing for menubars and light buttons. Basically,
don't use system-supplied circle drawing functions, since they don't
do a good job with small circles.
Add !__CYGWIN__ for use of WIN32 mkdir() function in preferences...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Light_Button.cxx | 36 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 36 | ||||
| -rw-r--r-- | src/Fl_Preferences.cxx | 8 |
3 files changed, 58 insertions, 22 deletions
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 986cbe8d0..acf6cf658 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.15 2002/04/29 19:27:51 easysw Exp $" +// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.16 2002/04/30 15:34:57 easysw Exp $" // // Lighted button widget for the Fast Light Tool Kit (FLTK). // @@ -70,16 +70,34 @@ void Fl_Light_Button::draw() { draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(col); - int tW = W - Fl::box_dw(down_box()) - 3; + int tW = W - Fl::box_dw(down_box()) - 2; int tdx = dx + Fl::box_dx(down_box()) + 1; int tdy = dy + Fl::box_dy(down_box()) + 1; - if (tW > 4) { - fl_pie(x() + tdx, y() + tdy, tW, tW , 0.0, 360.0); - } else { - // Small circles don't draw well with some X servers... - fl_rectf(x() + tdx + 1, y() + tdy, 2, 4); - fl_rectf(x() + tdx, y() + tdy + 1, 4, 2); + switch (tW) { + // Larger circles draw fine... + default : + fl_pie(x() + tdx, y() + tdy, tW, tW, 0.0, 360.0); + break; + + // Small circles don't draw well on many systems... + case 6 : + fl_rectf(x() + tdx + 2, y() + tdy, tW - 4, tW); + fl_rectf(x() + tdx + 1, y() + tdy + 1, tW - 2, tW - 2); + fl_rectf(x() + tdx, y() + tdy + 2, tW, tW - 4); + break; + + case 5 : + case 4 : + case 3 : + fl_rectf(x() + tdx + 1, y() + tdy, tW - 2, tW); + fl_rectf(x() + tdx, y() + tdy + 1, tW, tW - 2); + break; + + case 2 : + case 1 : + fl_rectf(x() + tdx, y() + tdy, tW, tW); + break; } } break; @@ -123,5 +141,5 @@ Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.15 2002/04/29 19:27:51 easysw Exp $". +// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.16 2002/04/30 15:34:57 easysw Exp $". // diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index ef6192173..7643c8b4e 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.10 2002/04/29 19:27:51 easysw Exp $" +// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.11 2002/04/30 15:34:58 easysw Exp $" // // Menu code for the Fast Light Tool Kit (FLTK). // @@ -166,14 +166,32 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(labelcolor_); - int tW = W - Fl::box_dw(FL_ROUND_DOWN_BOX) - 3; + int tW = W - Fl::box_dw(FL_ROUND_DOWN_BOX) - 2; int td = Fl::box_dx(FL_ROUND_DOWN_BOX) + 1; - if (tW > 4) { - fl_pie(x+2 + td , y + d + td, tW, tW , 0.0, 360.0); - } else { - // Small circles don't draw well with some X servers... - fl_rectf(x + td + 3, y + d + td, 2, 4); - fl_rectf(x + td + 2, y + d + td + 1, 4, 2); + switch (tW) { + // Larger circles draw fine... + default : + fl_pie(x + td + 2, y + d + td, tW, tW, 0.0, 360.0); + break; + + // Small circles don't draw well on many systems... + case 6 : + fl_rectf(x + td + 4, y + d + td, tW - 4, tW); + fl_rectf(x + td + 3, y + d + td + 1, tW - 2, tW - 2); + fl_rectf(x + td + 2, y + d + td + 2, tW, tW - 4); + break; + + case 5 : + case 4 : + case 3 : + fl_rectf(x + td + 3, y + d + td, tW - 2, tW); + fl_rectf(x + td + 2, y + d + td + 1, tW, tW - 2); + break; + + case 2 : + case 1 : + fl_rectf(x + td + 2, y + d + td, tW, tW); + break; } } } else { @@ -756,5 +774,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { } // -// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.10 2002/04/29 19:27:51 easysw Exp $". +// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.11 2002/04/30 15:34:58 easysw Exp $". // diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 362a48209..d5ddb7224 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.cxx,v 1.1.2.5 2002/04/29 21:04:12 easysw Exp $" +// "$Id: Fl_Preferences.cxx,v 1.1.2.6 2002/04/30 15:34:58 easysw Exp $" // // Preferences methods for the Fast Light Tool Kit (FLTK). // @@ -447,11 +447,11 @@ static char makePath( const char *path ) p[len] = 0; makePath( p ); free( p ); -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) return ( mkdir( path ) == 0 ); #else return ( mkdir( path, 0777 ) == 0 ); -#endif +#endif // WIN32 && !__CYGWIN__ } return 1; } @@ -935,5 +935,5 @@ char Fl_Preferences::Node::remove() // -// End of "$Id: Fl_Preferences.cxx,v 1.1.2.5 2002/04/29 21:04:12 easysw Exp $". +// End of "$Id: Fl_Preferences.cxx,v 1.1.2.6 2002/04/30 15:34:58 easysw Exp $". // |
