diff options
Diffstat (limited to 'src/FbTk/MenuItem.hh')
-rw-r--r-- | src/FbTk/MenuItem.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh index cc24228..227488f 100644 --- a/src/FbTk/MenuItem.hh +++ b/src/FbTk/MenuItem.hh | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef FBTK_MENUITEM_HH | 22 | #ifndef FBTK_MENUITEM_HH |
23 | #define FBTK_MENUITEM_HH | 23 | #define FBTK_MENUITEM_HH |
24 | 24 | ||
25 | #include "Menu.hh" | ||
25 | #include "RefCount.hh" | 26 | #include "RefCount.hh" |
26 | #include "Command.hh" | 27 | #include "Command.hh" |
27 | #include "PixmapWithMask.hh" | 28 | #include "PixmapWithMask.hh" |
@@ -32,7 +33,6 @@ | |||
32 | 33 | ||
33 | namespace FbTk { | 34 | namespace FbTk { |
34 | 35 | ||
35 | class Menu; | ||
36 | class MenuTheme; | 36 | class MenuTheme; |
37 | class FbDrawable; | 37 | class FbDrawable; |
38 | template <class T> class ThemeProxy; | 38 | template <class T> class ThemeProxy; |
@@ -80,7 +80,7 @@ public: | |||
80 | m_toggle_item(false) | 80 | m_toggle_item(false) |
81 | { } | 81 | { } |
82 | 82 | ||
83 | MenuItem(const BiDiString &label, Menu *submenu, Menu *host_menu = 0) | 83 | MenuItem(const BiDiString &label, const RefCount<Menu> &submenu, Menu *host_menu = 0) |
84 | : m_label(label), | 84 | : m_label(label), |
85 | m_menu(host_menu), | 85 | m_menu(host_menu), |
86 | m_submenu(submenu), | 86 | m_submenu(submenu), |
@@ -98,7 +98,7 @@ public: | |||
98 | virtual void setToggleItem(bool val) { m_toggle_item = val; } | 98 | virtual void setToggleItem(bool val) { m_toggle_item = val; } |
99 | void setCloseOnClick(bool val) { m_close_on_click = val; } | 99 | void setCloseOnClick(bool val) { m_close_on_click = val; } |
100 | void setIcon(const std::string &filename, int screen_num); | 100 | void setIcon(const std::string &filename, int screen_num); |
101 | virtual Menu *submenu() { return m_submenu; } | 101 | virtual const RefCount<Menu>& submenu() { return m_submenu; } |
102 | /** | 102 | /** |
103 | @name accessors | 103 | @name accessors |
104 | */ | 104 | */ |
@@ -107,7 +107,7 @@ public: | |||
107 | virtual const PixmapWithMask *icon() const { | 107 | virtual const PixmapWithMask *icon() const { |
108 | return m_icon.get() ? m_icon->pixmap.get() : 0; | 108 | return m_icon.get() ? m_icon->pixmap.get() : 0; |
109 | } | 109 | } |
110 | virtual const Menu *submenu() const { return m_submenu; } | 110 | virtual RefCount<const Menu> submenu() const { return m_submenu; } |
111 | virtual bool isEnabled() const { return m_enabled; } | 111 | virtual bool isEnabled() const { return m_enabled; } |
112 | virtual bool isSelected() const { return m_selected; } | 112 | virtual bool isSelected() const { return m_selected; } |
113 | virtual bool isToggleItem() const { return m_toggle_item; } | 113 | virtual bool isToggleItem() const { return m_toggle_item; } |
@@ -150,7 +150,7 @@ public: | |||
150 | private: | 150 | private: |
151 | BiDiString m_label; ///< label of this item | 151 | BiDiString m_label; ///< label of this item |
152 | Menu *m_menu; ///< the menu we live in | 152 | Menu *m_menu; ///< the menu we live in |
153 | Menu *m_submenu; ///< a submenu, 0 if we don't have one | 153 | RefCount<Menu> m_submenu; ///< a submenu, 0 if we don't have one |
154 | RefCount<Command<void> > m_command; ///< command to be executed | 154 | RefCount<Command<void> > m_command; ///< command to be executed |
155 | bool m_enabled, m_selected; | 155 | bool m_enabled, m_selected; |
156 | bool m_close_on_click, m_toggle_item; | 156 | bool m_close_on_click, m_toggle_item; |