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/FocusModelMenuItem.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/FocusModelMenuItem.hh')
-rw-r--r-- | src/FocusModelMenuItem.hh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/FocusModelMenuItem.hh b/src/FocusModelMenuItem.hh index d75e8a0..7541659 100644 --- a/src/FocusModelMenuItem.hh +++ b/src/FocusModelMenuItem.hh | |||
@@ -24,7 +24,7 @@ | |||
24 | #define FOCUSMODELMENUITEM_HH | 24 | #define FOCUSMODELMENUITEM_HH |
25 | 25 | ||
26 | 26 | ||
27 | #include "FbTk/MenuItem.hh" | 27 | #include "FbTk/RadioMenuItem.hh" |
28 | #include "FbTk/RefCount.hh" | 28 | #include "FbTk/RefCount.hh" |
29 | 29 | ||
30 | namespace FbTk { | 30 | namespace FbTk { |
@@ -33,22 +33,22 @@ template <class T> class Command; | |||
33 | 33 | ||
34 | #include "FocusControl.hh" | 34 | #include "FocusControl.hh" |
35 | 35 | ||
36 | class FocusModelMenuItem : public FbTk::MenuItem { | 36 | class FocusModelMenuItem : public FbTk::RadioMenuItem { |
37 | public: | 37 | public: |
38 | FocusModelMenuItem(const FbTk::FbString &label, FocusControl &focus_control, | 38 | FocusModelMenuItem(const FbTk::FbString &label, FocusControl &focus_control, |
39 | FocusControl::FocusModel model, | 39 | FocusControl::FocusModel model, |
40 | FbTk::RefCount<FbTk::Command<void> > &cmd): | 40 | FbTk::RefCount<FbTk::Command<void> > &cmd): |
41 | FbTk::MenuItem(label, cmd), | 41 | FbTk::RadioMenuItem(label, cmd), |
42 | m_focus_control(focus_control), | 42 | m_focus_control(focus_control), |
43 | m_focusmodel(model) { | 43 | m_focusmodel(model) { |
44 | setCloseOnClick(false); | 44 | setCloseOnClick(false); |
45 | } | 45 | } |
46 | 46 | ||
47 | bool isEnabled() const { return m_focus_control.focusModel() != m_focusmodel; } | 47 | bool isSelected() const { return m_focus_control.focusModel() == m_focusmodel; } |
48 | 48 | ||
49 | void click(int button, int time, unsigned int mods) { | 49 | void click(int button, int time, unsigned int mods) { |
50 | m_focus_control.setFocusModel(m_focusmodel); | 50 | m_focus_control.setFocusModel(m_focusmodel); |
51 | FbTk::MenuItem::click(button, time, mods); | 51 | FbTk::RadioMenuItem::click(button, time, mods); |
52 | } | 52 | } |
53 | 53 | ||
54 | private: | 54 | private: |
@@ -56,23 +56,23 @@ private: | |||
56 | FocusControl::FocusModel m_focusmodel; | 56 | FocusControl::FocusModel m_focusmodel; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | class TabFocusModelMenuItem : public FbTk::MenuItem { | 59 | class TabFocusModelMenuItem : public FbTk::RadioMenuItem { |
60 | public: | 60 | public: |
61 | TabFocusModelMenuItem(const FbTk::FbString &label, | 61 | TabFocusModelMenuItem(const FbTk::FbString &label, |
62 | FocusControl &focus_control, | 62 | FocusControl &focus_control, |
63 | FocusControl::TabFocusModel model, | 63 | FocusControl::TabFocusModel model, |
64 | FbTk::RefCount<FbTk::Command<void> > &cmd): | 64 | FbTk::RefCount<FbTk::Command<void> > &cmd): |
65 | FbTk::MenuItem(label, cmd), | 65 | FbTk::RadioMenuItem(label, cmd), |
66 | m_focus_control(focus_control), | 66 | m_focus_control(focus_control), |
67 | m_tabfocusmodel(model) { | 67 | m_tabfocusmodel(model) { |
68 | setCloseOnClick(false); | 68 | setCloseOnClick(false); |
69 | } | 69 | } |
70 | 70 | ||
71 | bool isEnabled() const { return m_focus_control.tabFocusModel() != m_tabfocusmodel; } | 71 | bool isSelected() const { return m_focus_control.tabFocusModel() == m_tabfocusmodel; } |
72 | 72 | ||
73 | void click(int button, int time, unsigned int mods) { | 73 | void click(int button, int time, unsigned int mods) { |
74 | m_focus_control.setTabFocusModel(m_tabfocusmodel); | 74 | m_focus_control.setTabFocusModel(m_tabfocusmodel); |
75 | FbTk::MenuItem::click(button, time, mods); | 75 | FbTk::RadioMenuItem::click(button, time, mods); |
76 | } | 76 | } |
77 | 77 | ||
78 | private: | 78 | private: |