aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Menu.hh')
-rw-r--r--src/FbTk/Menu.hh14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index 49893c1..27d5b12 100644
--- a/src/FbTk/Menu.hh
+++ b/src/FbTk/Menu.hh
@@ -45,6 +45,12 @@ template <typename T> class RefCount;
45/// Base class for menus 45/// Base class for menus
46class Menu: public FbTk::EventHandler, FbTk::FbWindowRenderer { 46class Menu: public FbTk::EventHandler, FbTk::FbWindowRenderer {
47public: 47public:
48
49 static Menu* shownMenu();
50 static Menu* focused();
51 static void hideShownMenu();
52
53
48 enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM }; 54 enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
49 enum { RIGHT = 1, LEFT }; 55 enum { RIGHT = 1, LEFT };
50 56
@@ -134,11 +140,13 @@ public:
134 FbTk::ThemeProxy<MenuTheme> &theme() { return m_theme; } 140 FbTk::ThemeProxy<MenuTheme> &theme() { return m_theme; }
135 const FbTk::ThemeProxy<MenuTheme> &theme() const { return m_theme; } 141 const FbTk::ThemeProxy<MenuTheme> &theme() const { return m_theme; }
136 unsigned char alpha() const { return theme()->alpha(); } 142 unsigned char alpha() const { return theme()->alpha(); }
137 static Menu* shownMenu();
138 static Menu* focused();
139 static void hideShownMenu();
140 const MenuItem *find(size_t i) const { return m_items[i]; } 143 const MenuItem *find(size_t i) const { return m_items[i]; }
141 MenuItem *find(size_t i) { return m_items[i]; } 144 MenuItem *find(size_t i) { return m_items[i]; }
145
146 // returns index of 'submenu', it it is in the top most list of
147 // menu items. -1 if no match is found
148 int findSubmenuIndex(const Menu* submenu) const;
149
142 //@} 150 //@}
143 /// @return true if index is valid 151 /// @return true if index is valid
144 bool validIndex(int index) const { return (index < static_cast<int>(numberOfItems()) && index >= 0); } 152 bool validIndex(int index) const { return (index < static_cast<int>(numberOfItems()) && index >= 0); }