summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
commit9a528400f083b3761e0d54565ea1002604f5472a (patch)
tree789a2d8e0283ad5715026bba5dcd4ce805a067f5 /src/Fl_Menu.cxx
parentbc3de1ec15062a9016150c124d6a4d6c14d87720 (diff)
Doco updates.
Add directory-only support to Fl_FileBrowser. Update button and menu drawing code for check and radio buttons. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu.cxx')
-rw-r--r--src/Fl_Menu.cxx53
1 files changed, 31 insertions, 22 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 2e958dab9..000e7d706 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.2 2001/08/06 03:17:43 easysw Exp $"
+// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -108,11 +108,13 @@ extern char fl_draw_shortcut;
// width of label, including effect of & characters:
int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const {
Fl_Label l;
- l.value = text;
- l.type = labeltype_;
- l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
- l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
- l.color = FL_BLACK; // this makes no difference?
+ l.value = text;
+ l.image = 0;
+ l.deimage = 0;
+ l.type = labeltype_;
+ l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
+ l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
+ l.color = FL_BLACK; // this makes no difference?
fl_draw_shortcut = 1;
int w = 0; int h = 0; l.measure(w, hp ? *hp : h);
fl_draw_shortcut = 0;
@@ -156,26 +158,33 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
}
if (flags & (FL_MENU_TOGGLE|FL_MENU_RADIO)) {
- int y1 = y+(h-14)/2;
- fl_color(FL_DARK3);
+ int size = 12;
+ int y1 = y + (h - size) / 2;
+ int x1 = x + 2;
+
if (flags & FL_MENU_RADIO) {
- fl_line(x+2, y1+7, x+8, y1+1, x+14, y1+7);
- if (selected) {
- fl_color(color);
- fl_polygon(x+3, y1+7, x+8, y1+2, x+13, y1+7, x+8, y1+12);
- }
- fl_color(FL_LIGHT3); fl_line(x+14, y1+7, x+8, y1+13, x+2, y1+7);
+ fl_color(FL_DARK3);
+ fl_arc(x1, y1, size, size, 45.0, 225.0);
+ fl_color(FL_LIGHT3);
+ fl_arc(x1, y1, size, size, 225.0, 405.0);
+
if (value()) {
- fl_color(FL_BLACK);
- fl_polygon(x+4, y1+7, x+8, y1+3, x+12, y1+7, x+8, y1+11);
+ fl_color(FL_BLACK);
+ fl_pie(x1 + 3, y1 + 3, size - 7, size - 7, 0.0, 360.0);
}
} else {
- fl_yxline(x+3, y1+11, y1+2, x+12);
- if (selected) {fl_color(color); fl_rectf(x+4, y1+3, 9, 9);}
- fl_color(FL_LIGHT3); fl_xyline(x+4, y1+12, x+13, y1+3);
- if (value()) {fl_color(FL_BLACK); fl_rectf(x+5, y1+4, 7, 7);}
+ fl_draw_box(FL_THIN_DOWN_FRAME, x1, y1, size, size, color);
+ if (value()) {
+ fl_color(FL_BLACK);
+ fl_line_style(FL_SOLID, 2);
+ fl_line(x1 + size - 3, y1 + 2,
+ x1 + size / 2 - 1, y1 + size - 4,
+ x1 + 3, y1 + size / 2);
+ fl_line_style(FL_SOLID);
+ }
}
- x += 14; w -= 14;
+ x += size + 3;
+ w -= size + 3;
}
if (!fl_draw_shortcut) fl_draw_shortcut = 1;
@@ -743,5 +752,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $".
//