diff options
author | markt <markt> | 2007-03-03 19:35:34 (GMT) |
---|---|---|
committer | markt <markt> | 2007-03-03 19:35:34 (GMT) |
commit | a233229bd854d2e925ca0f1e86846ff9fde46fcd (patch) | |
tree | a30fffa38994e8ee12096c31a256ba6b3fbfa2c6 /src/FbTk/Menu.hh | |
parent | d6a7bd786fd657e16c1ebad5c515d60ba1368d8a (diff) | |
download | fluxbox-a233229bd854d2e925ca0f1e86846ff9fde46fcd.zip fluxbox-a233229bd854d2e925ca0f1e86846ff9fde46fcd.tar.bz2 |
added support for typeahead in menus
Diffstat (limited to 'src/FbTk/Menu.hh')
-rw-r--r-- | src/FbTk/Menu.hh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 43b77a1..c77b0c0 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -41,6 +41,7 @@ | |||
41 | #include "MenuTheme.hh" | 41 | #include "MenuTheme.hh" |
42 | #include "Timer.hh" | 42 | #include "Timer.hh" |
43 | #include "FbString.hh" | 43 | #include "FbString.hh" |
44 | #include "TypeAhead.hh" | ||
44 | 45 | ||
45 | namespace FbTk { | 46 | namespace FbTk { |
46 | 47 | ||
@@ -87,10 +88,8 @@ public: | |||
87 | virtual void raise(); | 88 | virtual void raise(); |
88 | /// lower this window | 89 | /// lower this window |
89 | virtual void lower(); | 90 | virtual void lower(); |
90 | /// select next item | 91 | /// cycle through menuitems |
91 | void nextItem(int failsafe = -1); | 92 | void cycleItems(bool reverse); |
92 | /// select previous item | ||
93 | void prevItem(int failsafe = -1); | ||
94 | void enterSubmenu(); | 93 | void enterSubmenu(); |
95 | void enterParent(); | 94 | void enterParent(); |
96 | 95 | ||
@@ -186,7 +185,7 @@ protected: | |||
186 | int drawItem(FbDrawable &pm, unsigned int index, | 185 | int drawItem(FbDrawable &pm, unsigned int index, |
187 | bool highlight = false, | 186 | bool highlight = false, |
188 | bool exclusive_drawable = false); | 187 | bool exclusive_drawable = false); |
189 | void clearItem(int index, bool clear = true); | 188 | void clearItem(int index, bool clear = true, int search_index = -1); |
190 | void highlightItem(int index); | 189 | void highlightItem(int index); |
191 | virtual void redrawTitle(FbDrawable &pm); | 190 | virtual void redrawTitle(FbDrawable &pm); |
192 | virtual void redrawFrame(FbDrawable &pm); | 191 | virtual void redrawFrame(FbDrawable &pm); |
@@ -209,6 +208,14 @@ private: | |||
209 | ImageControl &m_image_ctrl; | 208 | ImageControl &m_image_ctrl; |
210 | Menuitems menuitems; | 209 | Menuitems menuitems; |
211 | 210 | ||
211 | TypeAhead<Menuitems, MenuItem *> m_type_ahead; | ||
212 | Menuitems m_matches; | ||
213 | |||
214 | void resetTypeAhead(); | ||
215 | void drawTypeAheadItems(); | ||
216 | void drawLine(int index, int size); | ||
217 | void fixMenuItemIndices(); | ||
218 | |||
212 | int m_screen_x, m_screen_y; | 219 | int m_screen_x, m_screen_y; |
213 | unsigned int m_screen_width, m_screen_height; | 220 | unsigned int m_screen_width, m_screen_height; |
214 | bool m_moving; ///< if we're moving/draging or not | 221 | bool m_moving; ///< if we're moving/draging or not |