aboutsummaryrefslogtreecommitdiff
path: root/src/IntResMenuItem.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2005-05-03 13:53:25 (GMT)
committersimonb <simonb>2005-05-03 13:53:25 (GMT)
commit7d4f711204ab0b51d45eaff332708f529c11c9f5 (patch)
tree57488fc9d10740f0501396f68b4e061b0cec8810 /src/IntResMenuItem.cc
parent575578d810733e0ca8d970f5923594a9d1930216 (diff)
downloadfluxbox_pavel-7d4f711204ab0b51d45eaff332708f529c11c9f5.zip
fluxbox_pavel-7d4f711204ab0b51d45eaff332708f529c11c9f5.tar.bz2
fix some menu drawing issues
Diffstat (limited to 'src/IntResMenuItem.cc')
-rw-r--r--src/IntResMenuItem.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/IntResMenuItem.cc b/src/IntResMenuItem.cc
index a1595a6..30aead1 100644
--- a/src/IntResMenuItem.cc
+++ b/src/IntResMenuItem.cc
@@ -21,8 +21,11 @@
21 21
22// $Id$ 22// $Id$
23 23
24#include "FbTk/Menu.hh"
25
24#include "IntResMenuItem.hh" 26#include "IntResMenuItem.hh"
25#include "PixmapWithMask.hh" 27#include "PixmapWithMask.hh"
28
26#ifdef HAVE_CSTDIO 29#ifdef HAVE_CSTDIO
27 #include <cstdio> 30 #include <cstdio>
28#else 31#else
@@ -41,8 +44,8 @@ std::string appendIntValue(const std::string &label, int value) {
41 44
42}; 45};
43 46
44IntResMenuItem::IntResMenuItem(const char *label, FbTk::Resource<int> &res, int min_val, int max_val): 47IntResMenuItem::IntResMenuItem(const char *label, FbTk::Resource<int> &res, int min_val, int max_val, FbTk::Menu &host_menu):
45 FbTk::MenuItem(label), m_org_label(FbTk::MenuItem::label()), 48 FbTk::MenuItem(label, host_menu), m_org_label(FbTk::MenuItem::label()),
46 m_max(max_val), m_min(min_val), m_res(res) { 49 m_max(max_val), m_min(min_val), m_res(res) {
47 setLabel(appendIntValue(m_org_label, *m_res).c_str()); 50 setLabel(appendIntValue(m_org_label, *m_res).c_str());
48} 51}
@@ -72,4 +75,11 @@ void IntResMenuItem::click(int button, int time) {
72 setLabel(appendIntValue(m_org_label, *m_res).c_str()); 75 setLabel(appendIntValue(m_org_label, *m_res).c_str());
73 // call other commands 76 // call other commands
74 FbTk::MenuItem::click(button, time); 77 FbTk::MenuItem::click(button, time);
78
79 // show new value, which for us means forcing a full menu update
80 // since the text is drawn onto the background!
81 if (menu()) {
82 menu()->frameWindow().updateBackground(false);
83 menu()->clearWindow();
84 }
75} 85}