diff options
author | simonb <simonb> | 2005-04-26 01:41:55 (GMT) |
---|---|---|
committer | simonb <simonb> | 2005-04-26 01:41:55 (GMT) |
commit | 1c2f92a3d2288b1cae9500110a72173506a18072 (patch) | |
tree | cdb695da16dcee74872790c772bb535def9f2895 /src/FbTk/Menu.hh | |
parent | b49432be05c6cf748e662e196778463e2190b4c3 (diff) | |
download | fluxbox-1c2f92a3d2288b1cae9500110a72173506a18072.zip fluxbox-1c2f92a3d2288b1cae9500110a72173506a18072.tar.bz2 |
extension of previous big patch. Move a bunch of menu things onto
background pixmap. Same for textbuttons.
Diffstat (limited to 'src/FbTk/Menu.hh')
-rw-r--r-- | src/FbTk/Menu.hh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index d079ba8..bec76ac 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -47,7 +47,7 @@ class MenuItem; | |||
47 | class ImageControl; | 47 | class ImageControl; |
48 | 48 | ||
49 | /// Base class for menus | 49 | /// Base class for menus |
50 | class Menu: public FbTk::EventHandler, protected FbTk::Observer { | 50 | class Menu: public FbTk::EventHandler, FbTk::FbWindowRenderer, protected FbTk::Observer { |
51 | public: | 51 | public: |
52 | enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM }; | 52 | enum Alignment{ ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM }; |
53 | enum { RIGHT = 1, LEFT }; | 53 | enum { RIGHT = 1, LEFT }; |
@@ -166,6 +166,8 @@ public: | |||
166 | inline Menu *parent() { return m_parent; } | 166 | inline Menu *parent() { return m_parent; } |
167 | inline const Menu *parent() const { return m_parent; } | 167 | inline const Menu *parent() const { return m_parent; } |
168 | 168 | ||
169 | void renderForeground(FbWindow &win, FbDrawable &drawable); | ||
170 | |||
169 | protected: | 171 | protected: |
170 | 172 | ||
171 | inline void setTitleVisibility(bool b) { | 173 | inline void setTitleVisibility(bool b) { |
@@ -177,12 +179,14 @@ protected: | |||
177 | } | 179 | } |
178 | 180 | ||
179 | virtual void itemSelected(int button, unsigned int index) { } | 181 | virtual void itemSelected(int button, unsigned int index) { } |
180 | virtual int drawItem(unsigned int index, | 182 | // renders item onto pm |
181 | bool clear = false, | 183 | int drawItem(FbDrawable &pm, unsigned int index, |
182 | int x= -1, int y= -1, | 184 | bool highlight = false, |
183 | unsigned int width= 0, unsigned int height= 0); | 185 | bool exclusive_drawable = false); |
184 | virtual void redrawTitle(); | 186 | void clearItem(int index, bool clear = true); |
185 | virtual void redrawFrame(); | 187 | void highlightItem(int index); |
188 | virtual void redrawTitle(FbDrawable &pm); | ||
189 | virtual void redrawFrame(FbDrawable &pm); | ||
186 | 190 | ||
187 | virtual void internal_hide(); | 191 | virtual void internal_hide(); |
188 | 192 | ||
@@ -197,7 +201,7 @@ private: | |||
197 | 201 | ||
198 | 202 | ||
199 | typedef std::vector<MenuItem *> Menuitems; | 203 | typedef std::vector<MenuItem *> Menuitems; |
200 | const MenuTheme &m_theme; | 204 | MenuTheme &m_theme; |
201 | Menu *m_parent; | 205 | Menu *m_parent; |
202 | ImageControl &m_image_ctrl; | 206 | ImageControl &m_image_ctrl; |
203 | Menuitems menuitems; | 207 | Menuitems menuitems; |
@@ -215,7 +219,7 @@ private: | |||
215 | Alignment m_alignment; | 219 | Alignment m_alignment; |
216 | 220 | ||
217 | struct _menu { | 221 | struct _menu { |
218 | Pixmap frame_pixmap, title_pixmap, hilite_pixmap, sel_pixmap; | 222 | Pixmap frame_pixmap, title_pixmap, hilite_pixmap; |
219 | FbTk::FbWindow window, frame, title; | 223 | FbTk::FbWindow window, frame, title; |
220 | 224 | ||
221 | std::string label; | 225 | std::string label; |