summaryrefslogtreecommitdiff
path: root/FL
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 /FL
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 'FL')
-rw-r--r--FL/Fl_Menu_Item.H6
1 files changed, 4 insertions, 2 deletions
diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H
index 0b301dd94..6317b5a57 100644
--- a/FL/Fl_Menu_Item.H
+++ b/FL/Fl_Menu_Item.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.8 2004/04/11 04:38:54 easysw Exp $"
+// "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.9 2004/06/07 19:22:45 matthiaswm Exp $"
//
// Menu item header file for the Fast Light Tool Kit (FLTK).
//
@@ -64,6 +64,8 @@ struct FL_EXPORT Fl_Menu_Item {
const Fl_Menu_Item *next(int=1) const;
Fl_Menu_Item *next(int i=1) {
return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));}
+ const Fl_Menu_Item *first() const { return next(0); }
+ Fl_Menu_Item *first() { return next(0); }
// methods on menu items:
const char* label() const {return text;}
@@ -159,5 +161,5 @@ enum { // back-compatability enum:
#endif
//
-// End of "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.8 2004/04/11 04:38:54 easysw Exp $".
+// End of "$Id: Fl_Menu_Item.H,v 1.5.2.4.2.9 2004/06/07 19:22:45 matthiaswm Exp $".
//