aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-08-04 04:59:14 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-08-04 04:59:14 (GMT)
commit797038823815f446c25d191837e63a022209641d (patch)
treebc8f39dc91c182c538fa541cb29d29964b15ac8f /src/IconbarTool.cc
parent0688816d11e1fbd5576197f39f949ead687101d9 (diff)
downloadfluxbox-797038823815f446c25d191837e63a022209641d.zip
fluxbox-797038823815f446c25d191837e63a022209641d.tar.bz2
add selection box to various "choose one of these" menu items
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index b6e2900..f2ed082 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -39,7 +39,7 @@
39#include "FbTk/STLUtil.hh" 39#include "FbTk/STLUtil.hh"
40#include "FbTk/I18n.hh" 40#include "FbTk/I18n.hh"
41#include "FbTk/Menu.hh" 41#include "FbTk/Menu.hh"
42#include "FbTk/MenuItem.hh" 42#include "FbTk/RadioMenuItem.hh"
43#include "FbTk/BoolMenuItem.hh" 43#include "FbTk/BoolMenuItem.hh"
44#include "FbTk/RefCount.hh" 44#include "FbTk/RefCount.hh"
45#include "FbTk/SimpleCommand.hh" 45#include "FbTk/SimpleCommand.hh"
@@ -99,18 +99,18 @@ void FbTk::Resource<FbTk::Container::Alignment>::setFromString(const char *str)
99 99
100namespace { 100namespace {
101 101
102class ToolbarModeMenuItem : public FbTk::MenuItem { 102class ToolbarModeMenuItem : public FbTk::RadioMenuItem {
103public: 103public:
104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler, 104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler,
105 string mode, 105 string mode,
106 FbTk::RefCount<FbTk::Command<void> > &cmd): 106 FbTk::RefCount<FbTk::Command<void> > &cmd):
107 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 107 FbTk::RadioMenuItem(label, cmd), m_handler(handler), m_mode(mode) {
108 setCloseOnClick(false); 108 setCloseOnClick(false);
109 } 109 }
110 bool isEnabled() const { return m_handler.mode() != m_mode; } 110 bool isSelected() const { return m_handler.mode() == m_mode; }
111 void click(int button, int time, unsigned int mods) { 111 void click(int button, int time, unsigned int mods) {
112 m_handler.setMode(m_mode); 112 m_handler.setMode(m_mode);
113 FbTk::MenuItem::click(button, time, mods); 113 FbTk::RadioMenuItem::click(button, time, mods);
114 } 114 }
115 115
116private: 116private:
@@ -118,18 +118,18 @@ private:
118 string m_mode; 118 string m_mode;
119}; 119};
120 120
121class ToolbarAlignMenuItem: public FbTk::MenuItem { 121class ToolbarAlignMenuItem: public FbTk::RadioMenuItem {
122public: 122public:
123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler, 123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler,
124 FbTk::Container::Alignment mode, 124 FbTk::Container::Alignment mode,
125 FbTk::RefCount<FbTk::Command<void> > &cmd): 125 FbTk::RefCount<FbTk::Command<void> > &cmd):
126 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 126 FbTk::RadioMenuItem(label, cmd), m_handler(handler), m_mode(mode) {
127 setCloseOnClick(false); 127 setCloseOnClick(false);
128 } 128 }
129 bool isEnabled() const { return m_handler.alignment() != m_mode; } 129 bool isSelected() const { return m_handler.alignment() == m_mode; }
130 void click(int button, int time, unsigned int mods) { 130 void click(int button, int time, unsigned int mods) {
131 m_handler.setAlignment(m_mode); 131 m_handler.setAlignment(m_mode);
132 FbTk::MenuItem::click(button, time, mods); 132 FbTk::RadioMenuItem::click(button, time, mods);
133 } 133 }
134 134
135private: 135private: