From e85d7a87523b157b92a7a4d20029f80c4dccbec5 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 7 Jun 2004 19:23:12 +0000 Subject: 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 --- src/Fl_Menu_Bar.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Fl_Menu_Bar.cxx') 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 $". // -- cgit v1.2.3