added showSubmenu in MenuItem
This commit is contained in:
parent
5373f6d840
commit
0df6609bb9
3 changed files with 11 additions and 3 deletions
|
@ -734,7 +734,7 @@ void Menu::drawSubmenu(unsigned int index) {
|
||||||
clearItem(index);
|
clearItem(index);
|
||||||
|
|
||||||
if (! item->submenu()->isVisible()) {
|
if (! item->submenu()->isVisible()) {
|
||||||
item->submenu()->show();
|
item->showSubmenu();
|
||||||
item->submenu()->raise();
|
item->submenu()->raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Image.hh"
|
#include "Image.hh"
|
||||||
#include "App.hh"
|
#include "App.hh"
|
||||||
#include "StringUtil.hh"
|
#include "StringUtil.hh"
|
||||||
|
#include "Menu.hh"
|
||||||
|
|
||||||
namespace FbTk {
|
namespace FbTk {
|
||||||
|
|
||||||
|
@ -297,4 +298,9 @@ void MenuItem::updateTheme(const MenuTheme &theme) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MenuItem::showSubmenu() {
|
||||||
|
if (submenu() != 0)
|
||||||
|
submenu()->show();
|
||||||
|
}
|
||||||
|
|
||||||
}; // end namespace FbTk
|
}; // end namespace FbTk
|
||||||
|
|
|
@ -94,13 +94,13 @@ public:
|
||||||
virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); }
|
virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); }
|
||||||
virtual inline void setToggleItem(bool val) { m_toggle_item = val; }
|
virtual inline void setToggleItem(bool val) { m_toggle_item = val; }
|
||||||
void setIcon(const std::string &filename, int screen_num);
|
void setIcon(const std::string &filename, int screen_num);
|
||||||
Menu *submenu() { return m_submenu; }
|
virtual Menu *submenu() { return m_submenu; }
|
||||||
/**
|
/**
|
||||||
@name accessors
|
@name accessors
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
virtual inline const std::string &label() const { return m_label; }
|
virtual inline const std::string &label() const { return m_label; }
|
||||||
inline const Menu *submenu() const { return m_submenu; }
|
virtual const Menu *submenu() const { return m_submenu; }
|
||||||
virtual inline bool isEnabled() const { return m_enabled; }
|
virtual inline bool isEnabled() const { return m_enabled; }
|
||||||
virtual inline bool isSelected() const { return m_selected; }
|
virtual inline bool isSelected() const { return m_selected; }
|
||||||
virtual inline bool isToggleItem() const { return m_toggle_item; }
|
virtual inline bool isToggleItem() const { return m_toggle_item; }
|
||||||
|
@ -120,6 +120,8 @@ public:
|
||||||
@param time the time stamp
|
@param time the time stamp
|
||||||
*/
|
*/
|
||||||
virtual void click(int button, int time);
|
virtual void click(int button, int time);
|
||||||
|
/// must use this to show submenu to ensure consistency for object like window menu in ClientMenu (see Workspace.cc)
|
||||||
|
virtual void showSubmenu();
|
||||||
RefCount<Command> &command() { return m_command; }
|
RefCount<Command> &command() { return m_command; }
|
||||||
const RefCount<Command> &command() const { return m_command; }
|
const RefCount<Command> &command() const { return m_command; }
|
||||||
//@}
|
//@}
|
||||||
|
|
Loading…
Reference in a new issue