diff options
Diffstat (limited to 'src/FbTk/Menu.hh')
-rw-r--r-- | src/FbTk/Menu.hh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 5dd0eb8..1803241 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Menu.hh,v 1.15 2003/05/13 00:24:00 fluxgen Exp $ | 25 | // $Id: Menu.hh,v 1.16 2003/07/02 05:26:45 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef FBTK_MENU_HH | 27 | #ifndef FBTK_MENU_HH |
28 | #define FBTK_MENU_HH | 28 | #define FBTK_MENU_HH |
@@ -85,6 +85,10 @@ public: | |||
85 | virtual void raise(); | 85 | virtual void raise(); |
86 | /// lower this window | 86 | /// lower this window |
87 | virtual void lower(); | 87 | virtual void lower(); |
88 | /// select next item | ||
89 | void nextItem(); | ||
90 | /// select previous item | ||
91 | void prevItem(); | ||
88 | 92 | ||
89 | void disableTitle(); | 93 | void disableTitle(); |
90 | void enableTitle(); | 94 | void enableTitle(); |
@@ -95,14 +99,17 @@ public: | |||
95 | @name event handlers | 99 | @name event handlers |
96 | */ | 100 | */ |
97 | //@{ | 101 | //@{ |
102 | void handleEvent(XEvent &event); | ||
98 | void buttonPressEvent(XButtonEvent &bp); | 103 | void buttonPressEvent(XButtonEvent &bp); |
99 | void buttonReleaseEvent(XButtonEvent &br); | 104 | void buttonReleaseEvent(XButtonEvent &br); |
100 | void motionNotifyEvent(XMotionEvent &mn); | 105 | void motionNotifyEvent(XMotionEvent &mn); |
101 | void enterNotifyEvent(XCrossingEvent &en); | 106 | void enterNotifyEvent(XCrossingEvent &en); |
102 | void leaveNotifyEvent(XCrossingEvent &ce); | 107 | void leaveNotifyEvent(XCrossingEvent &ce); |
103 | void exposeEvent(XExposeEvent &ee); | 108 | void exposeEvent(XExposeEvent &ee); |
109 | void keyPressEvent(XKeyEvent &ke); | ||
104 | //@} | 110 | //@} |
105 | 111 | /// get input focus | |
112 | void grabInputFocus(); | ||
106 | void reconfigure(); | 113 | void reconfigure(); |
107 | /// set label string | 114 | /// set label string |
108 | void setLabel(const char *labelstr); | 115 | void setLabel(const char *labelstr); |
@@ -142,6 +149,7 @@ public: | |||
142 | bool isItemSelected(unsigned int index) const; | 149 | bool isItemSelected(unsigned int index) const; |
143 | bool isItemEnabled(unsigned int index) const; | 150 | bool isItemEnabled(unsigned int index) const; |
144 | static unsigned char alpha() { return s_alpha; } | 151 | static unsigned char alpha() { return s_alpha; } |
152 | static Menu *focused() { return s_focused; } | ||
145 | /// @return menuitem at index | 153 | /// @return menuitem at index |
146 | inline const MenuItem *find(unsigned int index) const { return menuitems[index]; } | 154 | inline const MenuItem *find(unsigned int index) const { return menuitems[index]; } |
147 | inline MenuItem *find(unsigned int index) { return menuitems[index]; } | 155 | inline MenuItem *find(unsigned int index) { return menuitems[index]; } |
@@ -170,6 +178,7 @@ private: | |||
170 | const MenuTheme &m_theme; | 178 | const MenuTheme &m_theme; |
171 | Display *m_display; | 179 | Display *m_display; |
172 | const int m_screen_num; | 180 | const int m_screen_num; |
181 | Window m_prev_focused_window; | ||
173 | Menu *m_parent; | 182 | Menu *m_parent; |
174 | ImageControl &m_image_ctrl; | 183 | ImageControl &m_image_ctrl; |
175 | Menuitems menuitems; | 184 | Menuitems menuitems; |
@@ -206,6 +215,7 @@ private: | |||
206 | std::auto_ptr<Transparent> m_trans; | 215 | std::auto_ptr<Transparent> m_trans; |
207 | Drawable m_root_pm; | 216 | Drawable m_root_pm; |
208 | static unsigned char s_alpha; | 217 | static unsigned char s_alpha; |
218 | static Menu *s_focused; ///< holds current input focused menu, so one can determine if a menu is focused | ||
209 | FbPixmap m_frame_pm; | 219 | FbPixmap m_frame_pm; |
210 | bool m_need_update; | 220 | bool m_need_update; |
211 | }; | 221 | }; |