summaryrefslogtreecommitdiff
path: root/src/Fl_Menu_Bar.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2004-06-07 19:23:12 +0000
committerMatthias Melcher <fltk@matthiasm.com>2004-06-07 19:23:12 +0000
commite85d7a87523b157b92a7a4d20029f80c4dccbec5 (patch)
tree03e36456ee997b771320934b1ff797616b96d13a /src/Fl_Menu_Bar.cxx
parent8b298e1b9ba706f7fa3c281698c14ad55037da90 (diff)
The first menuitem in a menulist would not honor teh MENU_INVISIBLE flag.
I added the function Fl_Menu_Item::first() whi returns the first visible menuitem, just like ::next() returns the next visible item, and added the ::first() call in the Menu code. first() is an inline function that calls next(0). I updated next() to correctly handle list where the current item is invisible. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3448 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu_Bar.cxx')
-rw-r--r--src/Fl_Menu_Bar.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx
index 7161dca25..d2d38bcf1 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.4 2004/04/11 04:38:58 easysw Exp $"
+// "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.5 2004/06/07 19:23:12 matthiaswm Exp $"
//
// Menu bar widget for the Fast Light Tool Kit (FLTK).
//
@@ -32,7 +32,7 @@ void Fl_Menu_Bar::draw() {
if (!menu() || !menu()->text) return;
const Fl_Menu_Item* m;
int X = x()+6;
- for (m=menu(); m->text; m = m->next()) {
+ for (m=menu()->first(); m->text; m = m->next()) {
int W = m->measure(0,this) + 16;
m->draw(X, y(), W, h(), this);
X += W;
@@ -72,5 +72,5 @@ int Fl_Menu_Bar::handle(int event) {
}
//
-// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.4 2004/04/11 04:38:58 easysw Exp $".
+// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.6.2.5 2004/06/07 19:23:12 matthiaswm Exp $".
//