aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.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/Slit.cc
parent0688816d11e1fbd5576197f39f949ead687101d9 (diff)
downloadfluxbox_pavel-797038823815f446c25d191837e63a022209641d.zip
fluxbox_pavel-797038823815f446c25d191837e63a022209641d.tar.bz2
add selection box to various "choose one of these" menu items
Diffstat (limited to 'src/Slit.cc')
-rw-r--r--src/Slit.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index ecd8280..20b86d6 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -57,6 +57,7 @@
57#include "FbTk/I18n.hh" 57#include "FbTk/I18n.hh"
58#include "FbTk/BoolMenuItem.hh" 58#include "FbTk/BoolMenuItem.hh"
59#include "FbTk/IntMenuItem.hh" 59#include "FbTk/IntMenuItem.hh"
60#include "FbTk/RadioMenuItem.hh"
60 61
61#ifdef HAVE_SYS_STAT_H 62#ifdef HAVE_SYS_STAT_H
62#include <sys/types.h> 63#include <sys/types.h>
@@ -236,16 +237,16 @@ private:
236 string m_label; 237 string m_label;
237}; 238};
238 239
239class PlaceSlitMenuItem: public FbTk::MenuItem { 240class PlaceSlitMenuItem: public FbTk::RadioMenuItem {
240public: 241public:
241 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command<void> > &cmd): 242 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command<void> > &cmd):
242 FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) { 243 FbTk::RadioMenuItem(label, cmd), m_slit(slit), m_place(place) {
243 setCloseOnClick(false); 244 setCloseOnClick(false);
244 } 245 }
245 bool isEnabled() const { return m_slit.placement() != m_place; } 246 bool isSelected() const { return m_slit.placement() == m_place; }
246 void click(int button, int time, unsigned int mods) { 247 void click(int button, int time, unsigned int mods) {
247 m_slit.setPlacement(m_place); 248 m_slit.setPlacement(m_place);
248 FbTk::MenuItem::click(button, time, mods); 249 FbTk::RadioMenuItem::click(button, time, mods);
249 } 250 }
250private: 251private:
251 Slit &m_slit; 252 Slit &m_slit;
@@ -1291,7 +1292,7 @@ void Slit::setupMenu() {
1291 1292
1292 m_slitmenu.insert(alpha_menuitem); 1293 m_slitmenu.insert(alpha_menuitem);
1293 1294
1294 m_slitmenu.insert(new SlitDirMenuItem(_FB_XTEXT(Slit, Direction, "Slit Direction", "Orientation of slit"), 1295 m_slitmenu.insert(new SlitDirMenuItem(_FB_XTEXT(Slit, Direction, "Slit Direction:", "Orientation of slit"),
1295 *this, 1296 *this,
1296 save_and_reconfigure)); 1297 save_and_reconfigure));
1297 m_slitmenu.insert(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu); 1298 m_slitmenu.insert(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu);