aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/Menu.hh27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh
index 29c79ea..7108045 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.2 2003/01/07 02:09:43 fluxgen Exp $ 25// $Id: Menu.hh,v 1.3 2003/01/09 16:43:54 fluxgen Exp $
26 26
27#ifndef FBTK_MENU_HH 27#ifndef FBTK_MENU_HH
28#define FBTK_MENU_HH 28#define FBTK_MENU_HH
@@ -64,8 +64,8 @@ public:
64 //@{ 64 //@{
65 /// add a menu item with a label and a command 65 /// add a menu item with a label and a command
66 int insert(const char *label, RefCount<Command> &cmd, int pos=-1); 66 int insert(const char *label, RefCount<Command> &cmd, int pos=-1);
67 /// note: obsolete 67 /// add empty menu item
68 int insert(const char *label, int function= 0, const char *exec = 0, int pos = -1); 68 int insert(const char *label, int pos=-1);
69 /// add submenu 69 /// add submenu
70 int insert(const char *label, Menu *submenu, int pos= -1); 70 int insert(const char *label, Menu *submenu, int pos= -1);
71 /// remove an item 71 /// remove an item
@@ -183,22 +183,17 @@ private:
183class MenuItem { 183class MenuItem {
184public: 184public:
185 MenuItem( 185 MenuItem(
186 const char *label, 186 const char *label)
187 int function, 187 : m_label(label ? label : ""),
188 const char *exec = (const char *) 0) 188 m_submenu(0),
189 : m_label(label ? label : "") 189 m_enabled(true),
190 , m_exec(exec ? exec : "") 190 m_selected(false)
191 , m_submenu(0)
192 , m_function(function)
193 , m_enabled(true)
194 , m_selected(false)
195 { } 191 { }
196 /// create a menu item with a specific command to be executed on click 192 /// create a menu item with a specific command to be executed on click
197 MenuItem(const char *label, RefCount<Command> &cmd): 193 MenuItem(const char *label, RefCount<Command> &cmd):
198 m_label(label ? label : ""), 194 m_label(label ? label : ""),
199 m_submenu(0), 195 m_submenu(0),
200 m_command(cmd), 196 m_command(cmd),
201 m_function(0),
202 m_enabled(true), 197 m_enabled(true),
203 m_selected(false) { 198 m_selected(false) {
204 199
@@ -206,9 +201,7 @@ public:
206 201
207 MenuItem(const char *label, Menu *submenu) 202 MenuItem(const char *label, Menu *submenu)
208 : m_label(label ? label : "") 203 : m_label(label ? label : "")
209 , m_exec("")
210 , m_submenu(submenu) 204 , m_submenu(submenu)
211 , m_function(0)
212 , m_enabled(true) 205 , m_enabled(true)
213 , m_selected(false) 206 , m_selected(false)
214 { } 207 { }
@@ -220,9 +213,7 @@ public:
220 @name accessors 213 @name accessors
221 */ 214 */
222 //@{ 215 //@{
223 const std::string &exec() const { return m_exec; }
224 const std::string &label() const { return m_label; } 216 const std::string &label() const { return m_label; }
225 int function() const { return m_function; }
226 const Menu *submenu() const { return m_submenu; } 217 const Menu *submenu() const { return m_submenu; }
227 bool isEnabled() const { return m_enabled; } 218 bool isEnabled() const { return m_enabled; }
228 bool isSelected() const { return m_selected; } 219 bool isSelected() const { return m_selected; }
@@ -232,10 +223,8 @@ public:
232 223
233private: 224private:
234 std::string m_label; ///< label of this item 225 std::string m_label; ///< label of this item
235 std::string m_exec; ///< command string to execute
236 Menu *m_submenu; ///< a submenu, 0 if we don't have one 226 Menu *m_submenu; ///< a submenu, 0 if we don't have one
237 RefCount<Command> m_command; ///< command to be executed 227 RefCount<Command> m_command; ///< command to be executed
238 int m_function;
239 bool m_enabled, m_selected; 228 bool m_enabled, m_selected;
240 229
241 friend class Menu; 230 friend class Menu;