aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuItem.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/MenuItem.hh')
-rw-r--r--src/FbTk/MenuItem.hh21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh
index 0bf66be..94f0775 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 "FbString.hh"
30 31
31#include <string> 32#include <string>
32#include <memory> 33#include <memory>
@@ -49,8 +50,8 @@ public:
49 m_toggle_item(false) 50 m_toggle_item(false)
50 { } 51 { }
51 explicit MenuItem( 52 explicit MenuItem(
52 const char *label) 53 const FbString &label)
53 : m_label(label ? label : ""), 54 : m_label(label),
54 m_menu(0), 55 m_menu(0),
55 m_submenu(0), 56 m_submenu(0),
56 m_enabled(true), 57 m_enabled(true),
@@ -58,8 +59,8 @@ public:
58 m_toggle_item(false) 59 m_toggle_item(false)
59 { } 60 { }
60 61
61 MenuItem(const char *label, Menu &host_menu) 62 MenuItem(const FbString &label, Menu &host_menu)
62 : m_label(label ? label : ""), 63 : m_label(label),
63 m_menu(&host_menu), 64 m_menu(&host_menu),
64 m_submenu(0), 65 m_submenu(0),
65 m_enabled(true), 66 m_enabled(true),
@@ -67,8 +68,8 @@ public:
67 m_toggle_item(false) 68 m_toggle_item(false)
68 { } 69 { }
69 /// create a menu item with a specific command to be executed on click 70 /// create a menu item with a specific command to be executed on click
70 MenuItem(const char *label, RefCount<Command> &cmd, Menu *menu = 0): 71 MenuItem(const FbString &label, RefCount<Command> &cmd, Menu *menu = 0):
71 m_label(label ? label : ""), 72 m_label(label),
72 m_menu(menu), 73 m_menu(menu),
73 m_submenu(0), 74 m_submenu(0),
74 m_command(cmd), 75 m_command(cmd),
@@ -78,8 +79,8 @@ public:
78 79
79 } 80 }
80 81
81 MenuItem(const char *label, Menu *submenu, Menu *host_menu = 0) 82 MenuItem(const FbString &label, Menu *submenu, Menu *host_menu = 0)
82 : m_label(label ? label : "") 83 : m_label(label)
83 , m_menu(host_menu) 84 , m_menu(host_menu)
84 , m_submenu(submenu) 85 , m_submenu(submenu)
85 , m_enabled(true) 86 , m_enabled(true)
@@ -91,7 +92,7 @@ public:
91 inline void setCommand(RefCount<Command> &cmd) { m_command = cmd; } 92 inline void setCommand(RefCount<Command> &cmd) { m_command = cmd; }
92 virtual inline void setSelected(bool selected) { m_selected = selected; } 93 virtual inline void setSelected(bool selected) { m_selected = selected; }
93 virtual inline void setEnabled(bool enabled) { m_enabled = enabled; } 94 virtual inline void setEnabled(bool enabled) { m_enabled = enabled; }
94 virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); } 95 virtual inline void setLabel(const FbString &label) { m_label = label; }
95 virtual inline void setToggleItem(bool val) { m_toggle_item = val; } 96 virtual inline void setToggleItem(bool val) { m_toggle_item = val; }
96 void setIcon(const std::string &filename, int screen_num); 97 void setIcon(const std::string &filename, int screen_num);
97 virtual Menu *submenu() { return m_submenu; } 98 virtual Menu *submenu() { return m_submenu; }
@@ -130,7 +131,7 @@ public:
130 Menu *menu() { return m_menu; } 131 Menu *menu() { return m_menu; }
131 132
132private: 133private:
133 std::string m_label; ///< label of this item 134 FbString m_label; ///< label of this item
134 Menu *m_menu; ///< the menu we live in 135 Menu *m_menu; ///< the menu we live in
135 Menu *m_submenu; ///< a submenu, 0 if we don't have one 136 Menu *m_submenu; ///< a submenu, 0 if we don't have one
136 RefCount<Command> m_command; ///< command to be executed 137 RefCount<Command> m_command; ///< command to be executed