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/Xinerama.hh | |
parent | 0688816d11e1fbd5576197f39f949ead687101d9 (diff) | |
download | fluxbox_pavel-797038823815f446c25d191837e63a022209641d.zip fluxbox_pavel-797038823815f446c25d191837e63a022209641d.tar.bz2 |
add selection box to various "choose one of these" menu items
Diffstat (limited to 'src/Xinerama.hh')
-rw-r--r-- | src/Xinerama.hh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Xinerama.hh b/src/Xinerama.hh index eab2e37..876005f 100644 --- a/src/Xinerama.hh +++ b/src/Xinerama.hh | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include "FbTk/RefCount.hh" | 30 | #include "FbTk/RefCount.hh" |
31 | #include "FbTk/SimpleCommand.hh" | 31 | #include "FbTk/SimpleCommand.hh" |
32 | #include "FbTk/MenuItem.hh" | 32 | #include "FbTk/RadioMenuItem.hh" |
33 | 33 | ||
34 | // provides a generic way for giving an object a xinerama head menu | 34 | // provides a generic way for giving an object a xinerama head menu |
35 | // The object must have two functions: | 35 | // The object must have two functions: |
@@ -38,18 +38,18 @@ | |||
38 | 38 | ||
39 | /// this class holds the xinerama items | 39 | /// this class holds the xinerama items |
40 | template <typename ItemType> | 40 | template <typename ItemType> |
41 | class XineramaHeadMenuItem : public FbTk::MenuItem { | 41 | class XineramaHeadMenuItem : public FbTk::RadioMenuItem { |
42 | public: | 42 | public: |
43 | XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum, | 43 | XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum, |
44 | FbTk::RefCount<FbTk::Command<void> > &cmd): | 44 | FbTk::RefCount<FbTk::Command<void> > &cmd): |
45 | FbTk::MenuItem(label,cmd), m_object(object), m_headnum(headnum) {} | 45 | FbTk::RadioMenuItem(label,cmd), m_object(object), m_headnum(headnum) {} |
46 | XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum): | 46 | XineramaHeadMenuItem(const FbTk::FbString &label, ItemType &object, int headnum): |
47 | FbTk::MenuItem(label), m_object(object), m_headnum(headnum) {} | 47 | FbTk::RadioMenuItem(label), m_object(object), m_headnum(headnum) {} |
48 | 48 | ||
49 | bool isEnabled() const { return m_object.getOnHead() != m_headnum; } | 49 | bool isSelected() const { return m_object.getOnHead() == m_headnum; } |
50 | void click(int button, int time, unsigned int mods) { | 50 | void click(int button, int time, unsigned int mods) { |
51 | m_object.saveOnHead(m_headnum); | 51 | m_object.saveOnHead(m_headnum); |
52 | FbTk::MenuItem::click(button, time, mods); | 52 | FbTk::RadioMenuItem::click(button, time, mods); |
53 | } | 53 | } |
54 | 54 | ||
55 | private: | 55 | private: |