diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-04 04:59:14 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-04 04:59:14 (GMT) |
commit | 797038823815f446c25d191837e63a022209641d (patch) | |
tree | bc8f39dc91c182c538fa541cb29d29964b15ac8f /src/LayerMenu.hh | |
parent | 0688816d11e1fbd5576197f39f949ead687101d9 (diff) | |
download | fluxbox-797038823815f446c25d191837e63a022209641d.zip fluxbox-797038823815f446c25d191837e63a022209641d.tar.bz2 |
add selection box to various "choose one of these" menu items
Diffstat (limited to 'src/LayerMenu.hh')
-rw-r--r-- | src/LayerMenu.hh | 12 |
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 | ||
31 | class LayerObject { | 31 | class LayerObject { |
32 | public: | 32 | public: |
@@ -37,20 +37,20 @@ public: | |||
37 | 37 | ||
38 | 38 | ||
39 | /// this class holds the layermenu items | 39 | /// this class holds the layermenu items |
40 | class LayerMenuItem : public FbTk::MenuItem { | 40 | class LayerMenuItem : public FbTk::RadioMenuItem { |
41 | public: | 41 | public: |
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 | ||
56 | private: | 56 | private: |