aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-17 00:43:22 (GMT)
committerfluxgen <fluxgen>2003-12-17 00:43:22 (GMT)
commit8294b04f5e044e1fa506cc1ce87f9c70e39d1ef4 (patch)
treef14a06a9428eceb09fac5d05ed4fdf6381a88037 /src/FbTk/Menu.hh
parent90ff80f89b990fcdf98d8c28b4d85a4420a8e213 (diff)
downloadfluxbox_pavel-8294b04f5e044e1fa506cc1ce87f9c70e39d1ef4.zip
fluxbox_pavel-8294b04f5e044e1fa506cc1ce87f9c70e39d1ef4.tar.bz2
using menu as observer, cleaning in menu theme
Diffstat (limited to 'src/FbTk/Menu.hh')
-rw-r--r--src/FbTk/Menu.hh18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index 600ecb6..d1c6c6e 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.27 2003/12/16 17:06:52 fluxgen Exp $ 25// $Id: Menu.hh,v 1.28 2003/12/17 00:43:22 fluxgen Exp $
26 26
27#ifndef FBTK_MENU_HH 27#ifndef FBTK_MENU_HH
28#define FBTK_MENU_HH 28#define FBTK_MENU_HH
@@ -48,7 +48,7 @@ class ImageControl;
48class Transparent; 48class Transparent;
49 49
50/// Base class for menus 50/// Base class for menus
51class Menu: public FbTk::EventHandler { 51class Menu: public FbTk::EventHandler, protected FbTk::Observer {
52public: 52public:
53 enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM }; 53 enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
54 enum { RIGHT = 1, LEFT }; 54 enum { RIGHT = 1, LEFT };
@@ -174,7 +174,10 @@ protected:
174 inline Menu *parent() { return m_parent; } 174 inline Menu *parent() { return m_parent; }
175 inline const Menu *parent() const { return m_parent; } 175 inline const Menu *parent() const { return m_parent; }
176 176
177 void update(FbTk::Subject *) { reconfigure(); }
178
177private: 179private:
180
178 void openSubmenu(); 181 void openSubmenu();
179 void closeMenu(); 182 void closeMenu();
180 void startHide(); 183 void startHide();
@@ -206,17 +209,6 @@ private:
206 bevel_h; 209 bevel_h;
207 } menu; 210 } menu;
208 211
209 class ThemeObserver:public Observer {
210 public:
211 ThemeObserver(FbTk::Menu &menu):m_menu(menu) { }
212 void update(FbTk::Subject *subj) {
213 m_menu.reconfigure();
214 }
215 private:
216 Menu &m_menu;
217 };
218
219 ThemeObserver m_themeobserver;
220 Drawable m_root_pm; 212 Drawable m_root_pm;
221 static Menu *s_focused; ///< holds current input focused menu, so one can determine if a menu is focused 213 static Menu *s_focused; ///< holds current input focused menu, so one can determine if a menu is focused
222 FbPixmap m_frame_pm; 214 FbPixmap m_frame_pm;