aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuItem.hh
diff options
context:
space:
mode:
authormarkt <markt>2007-03-03 19:35:34 (GMT)
committermarkt <markt>2007-03-03 19:35:34 (GMT)
commita233229bd854d2e925ca0f1e86846ff9fde46fcd (patch)
treea30fffa38994e8ee12096c31a256ba6b3fbfa2c6 /src/FbTk/MenuItem.hh
parentd6a7bd786fd657e16c1ebad5c515d60ba1368d8a (diff)
downloadfluxbox_pavel-a233229bd854d2e925ca0f1e86846ff9fde46fcd.zip
fluxbox_pavel-a233229bd854d2e925ca0f1e86846ff9fde46fcd.tar.bz2
added support for typeahead in menus
Diffstat (limited to 'src/FbTk/MenuItem.hh')
-rw-r--r--src/FbTk/MenuItem.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh
index d73c270..701b624 100644
--- a/src/FbTk/MenuItem.hh
+++ b/src/FbTk/MenuItem.hh
@@ -27,6 +27,7 @@
27#include "RefCount.hh" 27#include "RefCount.hh"
28#include "Command.hh" 28#include "Command.hh"
29#include "PixmapWithMask.hh" 29#include "PixmapWithMask.hh"
30#include "ITypeAheadable.hh"
30#include "FbString.hh" 31#include "FbString.hh"
31 32
32#include <string> 33#include <string>
@@ -39,7 +40,7 @@ class MenuTheme;
39class FbDrawable; 40class FbDrawable;
40 41
41/// An interface for a menu item in Menu 42/// An interface for a menu item in Menu
42class MenuItem { 43class MenuItem : public FbTk::ITypeAheadable {
43public: 44public:
44 MenuItem() 45 MenuItem()
45 : m_label(""), 46 : m_label(""),
@@ -105,6 +106,17 @@ public:
105 virtual bool isEnabled() const { return m_enabled; } 106 virtual bool isEnabled() const { return m_enabled; }
106 virtual bool isSelected() const { return m_selected; } 107 virtual bool isSelected() const { return m_selected; }
107 virtual bool isToggleItem() const { return m_toggle_item; } 108 virtual bool isToggleItem() const { return m_toggle_item; }
109
110 // iType functions
111 virtual inline void setIndex(int index) { m_index = index; }
112 virtual inline int getIndex() { return m_index; }
113 inline const std::string &iTypeString() const { return m_label; }
114 virtual void drawLine(FbDrawable &draw,
115 const MenuTheme &theme,
116 size_t size,
117 int text_x, int text_y,
118 unsigned int width) const;
119
108 virtual unsigned int width(const MenuTheme &theme) const; 120 virtual unsigned int width(const MenuTheme &theme) const;
109 virtual unsigned int height(const MenuTheme &theme) const; 121 virtual unsigned int height(const MenuTheme &theme) const;
110 virtual void draw(FbDrawable &drawable, 122 virtual void draw(FbDrawable &drawable,
@@ -137,6 +149,7 @@ private:
137 RefCount<Command> m_command; ///< command to be executed 149 RefCount<Command> m_command; ///< command to be executed
138 bool m_enabled, m_selected; 150 bool m_enabled, m_selected;
139 bool m_toggle_item; 151 bool m_toggle_item;
152 int m_index;
140 153
141 struct Icon { 154 struct Icon {
142 std::auto_ptr<PixmapWithMask> pixmap; 155 std::auto_ptr<PixmapWithMask> pixmap;