summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-11-19 18:34:48 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-11-19 18:34:48 +0000
commit7a636272e2ed78c3a1ab2a151fb81a1e0e6a1579 (patch)
tree39eee97940dca94d82959dbb9c5bdfb274259101
parent631870551273060737c18d86af165d982490d2bb (diff)
Support vertical dividers in menu bars.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2849 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Menu_Bar.cxx15
2 files changed, 15 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 75e97b92b..7e1d8e495 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.2
+ - Fl_Menu_Bar now supports drawing vertical dividers
+ between menu items and submenus in the menu bar.
- Fl_File_Chooser::value() didn't return NULL when the
user clicked Cancel while selecting a directory. This
bug also affected fl_dir_chooser().
diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx
index 1643032f5..4c8fa26a8 100644
--- a/src/Fl_Menu_Bar.cxx
+++ b/src/Fl_Menu_Bar.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.1 2002/01/01 15:11:30 easysw Exp $"
+// "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.2 2002/11/19 18:34:48 easysw Exp $"
//
// Menu bar widget for the Fast Light Tool Kit (FLTK).
//
@@ -25,6 +25,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Menu_Bar.H>
+#include <FL/fl_draw.H>
void Fl_Menu_Bar::draw() {
draw_box();
@@ -35,6 +36,16 @@ void Fl_Menu_Bar::draw() {
int W = m->measure(0,this) + 16;
m->draw(X, y(), W, h(), this);
X += W;
+ if (m->flags & FL_MENU_DIVIDER) {
+ int y1 = y() + Fl::box_dy(box());
+ int y2 = y1 + h() - Fl::box_dh(box()) - 1;
+
+ // Draw a vertical divider between menus...
+ fl_color(FL_DARK3);
+ fl_yxline(X - 6, y1, y2);
+ fl_color(FL_LIGHT3);
+ fl_yxline(X - 5, y1, y2);
+ }
}
}
@@ -61,5 +72,5 @@ int Fl_Menu_Bar::handle(int event) {
}
//
-// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.1 2002/01/01 15:11:30 easysw Exp $".
+// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.2 2002/11/19 18:34:48 easysw Exp $".
//