summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2005-06-23 03:09:39 (GMT)
committerfluxgen <fluxgen>2005-06-23 03:09:39 (GMT)
commit0df6609bb94ae51e3fd6f18b1c05667653dfb37f (patch)
tree023490c10cf3f5c17ba88ad5be925aae43a11bd0
parent5373f6d840abaa49685c15fee2f411e77472a7da (diff)
downloadfluxbox_lack-0df6609bb94ae51e3fd6f18b1c05667653dfb37f.zip
fluxbox_lack-0df6609bb94ae51e3fd6f18b1c05667653dfb37f.tar.bz2
added showSubmenu in MenuItem
-rw-r--r--src/FbTk/Menu.cc2
-rw-r--r--src/FbTk/MenuItem.cc6
-rw-r--r--src/FbTk/MenuItem.hh6
3 files changed, 11 insertions, 3 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index e05f531..25c000e 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -734,7 +734,7 @@ void Menu::drawSubmenu(unsigned int index) {
734 clearItem(index); 734 clearItem(index);
735 735
736 if (! item->submenu()->isVisible()) { 736 if (! item->submenu()->isVisible()) {
737 item->submenu()->show(); 737 item->showSubmenu();
738 item->submenu()->raise(); 738 item->submenu()->raise();
739 } 739 }
740 740
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc
index 1ed3ebd..ee40f63 100644
--- a/src/FbTk/MenuItem.cc
+++ b/src/FbTk/MenuItem.cc
@@ -29,6 +29,7 @@
29#include "Image.hh" 29#include "Image.hh"
30#include "App.hh" 30#include "App.hh"
31#include "StringUtil.hh" 31#include "StringUtil.hh"
32#include "Menu.hh"
32 33
33namespace FbTk { 34namespace FbTk {
34 35
@@ -297,4 +298,9 @@ void MenuItem::updateTheme(const MenuTheme &theme) {
297 298
298} 299}
299 300
301void MenuItem::showSubmenu() {
302 if (submenu() != 0)
303 submenu()->show();
304}
305
300}; // end namespace FbTk 306}; // end namespace FbTk
diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh
index b3b2f6b..0bf66be 100644
--- a/src/FbTk/MenuItem.hh
+++ b/src/FbTk/MenuItem.hh
@@ -94,13 +94,13 @@ public:
94 virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); } 94 virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); }
95 virtual inline void setToggleItem(bool val) { m_toggle_item = val; } 95 virtual inline void setToggleItem(bool val) { m_toggle_item = val; }
96 void setIcon(const std::string &filename, int screen_num); 96 void setIcon(const std::string &filename, int screen_num);
97 Menu *submenu() { return m_submenu; } 97 virtual Menu *submenu() { return m_submenu; }
98 /** 98 /**
99 @name accessors 99 @name accessors
100 */ 100 */
101 //@{ 101 //@{
102 virtual inline const std::string &label() const { return m_label; } 102 virtual inline const std::string &label() const { return m_label; }
103 inline const Menu *submenu() const { return m_submenu; } 103 virtual const Menu *submenu() const { return m_submenu; }
104 virtual inline bool isEnabled() const { return m_enabled; } 104 virtual inline bool isEnabled() const { return m_enabled; }
105 virtual inline bool isSelected() const { return m_selected; } 105 virtual inline bool isSelected() const { return m_selected; }
106 virtual inline bool isToggleItem() const { return m_toggle_item; } 106 virtual inline bool isToggleItem() const { return m_toggle_item; }
@@ -120,6 +120,8 @@ public:
120 @param time the time stamp 120 @param time the time stamp
121 */ 121 */
122 virtual void click(int button, int time); 122 virtual void click(int button, int time);
123 /// must use this to show submenu to ensure consistency for object like window menu in ClientMenu (see Workspace.cc)
124 virtual void showSubmenu();
123 RefCount<Command> &command() { return m_command; } 125 RefCount<Command> &command() { return m_command; }
124 const RefCount<Command> &command() const { return m_command; } 126 const RefCount<Command> &command() const { return m_command; }
125 //@} 127 //@}