aboutsummaryrefslogtreecommitdiff
path: root/src/LayerMenu.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/LayerMenu.hh')
-rw-r--r--src/LayerMenu.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/LayerMenu.hh b/src/LayerMenu.hh
index 8de0eba..40e934c 100644
--- a/src/LayerMenu.hh
+++ b/src/LayerMenu.hh
@@ -26,7 +26,7 @@
26 26
27#include "ToggleMenu.hh" 27#include "ToggleMenu.hh"
28 28
29#include "FbTk/MenuItem.hh" 29#include "FbTk/RadioMenuItem.hh"
30 30
31class LayerObject { 31class LayerObject {
32public: 32public:
@@ -37,20 +37,20 @@ public:
37 37
38 38
39/// this class holds the layermenu items 39/// this class holds the layermenu items
40class LayerMenuItem : public FbTk::MenuItem { 40class LayerMenuItem : public FbTk::RadioMenuItem {
41public: 41public:
42 LayerMenuItem(const FbTk::FbString &label, LayerObject *object, 42 LayerMenuItem(const FbTk::FbString &label, LayerObject *object,
43 int layernum, FbTk::RefCount<FbTk::Command<void> > &cmd): 43 int layernum, FbTk::RefCount<FbTk::Command<void> > &cmd):
44 FbTk::MenuItem(label, cmd), m_object(object), m_layernum(layernum) {} 44 FbTk::RadioMenuItem(label, cmd), m_object(object), m_layernum(layernum) {}
45 45
46 LayerMenuItem(const FbTk::FbString &label, LayerObject *object, 46 LayerMenuItem(const FbTk::FbString &label, LayerObject *object,
47 int layernum): 47 int layernum):
48 FbTk::MenuItem(label), m_object(object), m_layernum(layernum) {} 48 FbTk::RadioMenuItem(label), m_object(object), m_layernum(layernum) {}
49 49
50 bool isEnabled() const { return m_object->layerNumber() != m_layernum; } 50 bool isSelected() const { return m_object->layerNumber() == m_layernum; }
51 void click(int button, int time, unsigned int mods) { 51 void click(int button, int time, unsigned int mods) {
52 m_object->moveToLayer(m_layernum); 52 m_object->moveToLayer(m_layernum);
53 FbTk::MenuItem::click(button, time, mods); 53 FbTk::RadioMenuItem::click(button, time, mods);
54 } 54 }
55 55
56private: 56private: