|
DUDS
|
Distributed Update of Data from Something
|
A generic take on MenuItem that invokes a Boost signal when the item is chosen, selected, or deselected. More...
#include <GenericMenuItem.hpp>
Public Types | |
| typedef boost::signals2::signal< void(MenuView &invokingView, const MenuAccess &access, GenericMenuItem &self) > | Signal |
| The signal type invoked when the item is chosen, selected, or deselected. More... | |
Public Types inherited from duds::ui::menu::MenuItem | |
| typedef duds::general::BitFlags< struct MenuItemFlags > | Flags |
| A set of option and state flags for menu items. More... | |
Public Member Functions | |
| virtual void | chose (MenuView &invokingView, const MenuAccess &access) |
| Invokes the choseSig signal in response to the user chosing this menu item. More... | |
| boost::signals2::connection | choseConnect (const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item chose signal. More... | |
| boost::signals2::connection | choseConnect (const typename Signal::group_type &group, const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item chose signal. More... | |
| boost::signals2::connection | choseConnectExtended (const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item chose signal. More... | |
| boost::signals2::connection | choseConnectExtended (const typename Signal::group_type &group, const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item chose signal. More... | |
| void | choseDisconnect (const typename Signal::group_type &group) |
| Disconnect a group from the generic menu item chose signal. More... | |
| template<typename Slot > | |
| void | choseDisconnect (const Slot &slotFunc) |
| Disconnect from the generic menu item chose signal. More... | |
| virtual void | deselect (MenuView &invokingView, const MenuAccess &access) |
| Invokes the deselSig signal in response to the user deselecting this menu item. More... | |
| boost::signals2::connection | deselectConnect (const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item deselect signal. More... | |
| boost::signals2::connection | deselectConnect (const typename Signal::group_type &group, const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item deselect signal. More... | |
| boost::signals2::connection | deselectConnectExtended (const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item deselect signal. More... | |
| boost::signals2::connection | deselectConnectExtended (const typename Signal::group_type &group, const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item deselect signal. More... | |
| void | deselectDisconnect (const typename Signal::group_type &group) |
| Disconnect a group from the generic menu item deselect signal. More... | |
| template<typename Slot > | |
| void | deselectDisconnect (const Slot &slotFunc) |
| Disconnect from the generic menu item deselect signal. More... | |
| virtual void | select (MenuView &invokingView, const MenuAccess &access) |
| Invokes the selSig signal in response to the user selecting this menu item. More... | |
| boost::signals2::connection | selectConnect (const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item select signal. More... | |
| boost::signals2::connection | selectConnect (const typename Signal::group_type &group, const typename Signal::slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item select signal. More... | |
| boost::signals2::connection | selectConnectExtended (const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item select signal. More... | |
| boost::signals2::connection | selectConnectExtended (const typename Signal::group_type &group, const typename Signal::extended_slot_type &slot, boost::signals2::connect_position at=boost::signals2::at_back) |
| Make a connection to the generic menu item select signal. More... | |
| void | selectDisconnect (const typename Signal::group_type &group) |
| Disconnect a group from the generic menu item select signal. More... | |
| template<typename Slot > | |
| void | selectDisconnect (const Slot &slotFunc) |
| Disconnect from the generic menu item select signal. More... | |
Public Member Functions inherited from duds::ui::menu::MenuItem | |
| void | changeEnabledState (bool state) |
| Changes the state of the item to either enabled or disabled. More... | |
| void | changeToggle (bool state) |
| Changes the toggle state of the item to the indicated state. More... | |
| void | changeVisibility (bool vis) |
| Changes the visibility of the item. More... | |
| void | clearToggle () |
| Clears the toggle state of the item. More... | |
| const std::string & | description () const |
| Returns the optional description text for this item. More... | |
| void | description (const std::string &d) |
| Changes the optional description text for this item. More... | |
| void | disable () |
| Makes the item disabled. More... | |
| void | enable () |
| Makes the item enabled. More... | |
| Flags | flags () const |
| Returns the option flags for the item. More... | |
| bool | hasValue () const |
| True if the item is flagged as having a value. More... | |
| void | hide () |
| Makes the item invisible. More... | |
| bool | isDisabled () const |
| True if the item is flagged as disabled. More... | |
| bool | isEnabled () const |
| True if the item is flagged as enabled. More... | |
| bool | isInvisible () const |
| True if the item is flagged as invisible. More... | |
| bool | isSelectable () const |
| Returns true if the item is both visible and enabled. More... | |
| bool | isToggle () const |
| True if the item is flagged as being a toggle. More... | |
| bool | isToggledOn () const |
| True if the item is in the toggled on (true) state. More... | |
| bool | isVisible () const |
| True if the item is flagged as visible. More... | |
| const std::string & | label () const |
| Returns the label text for this item. More... | |
| void | label (const std::string &l) |
| Changes the label text for this item. More... | |
| Menu * | menu () const |
| Returns the menu object that owns this item. More... | |
| void | remove () |
| Removes the item from its parent menu. More... | |
| void | setToggle () |
| Sets the toggle state of the item. More... | |
| void | show () |
| Makes the item visible. More... | |
| bool | toggle () |
| Toggles the toggle state of the item and returns the new toggle state. More... | |
| const std::string & | value () const |
| Returns the optional value text for the item. More... | |
| void | value (const std::string &v) |
| Changes the optional value text for the item. More... | |
Static Public Member Functions | |
| static std::shared_ptr< GenericMenuItem > | make (const std::string &label, Flags flags=Flags::Zero()) |
| Makes a shared pointer holding a new GenericMenuItem. More... | |
| static std::shared_ptr< GenericMenuItem > | make (const std::string &label, const std::string &description, Flags flags=Flags::Zero()) |
| Makes a shared pointer holding a new GenericMenuItem. More... | |
| static std::shared_ptr< GenericMenuItem > | make (const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero()) |
| Makes a shared pointer holding a new GenericMenuItem with an associated value. More... | |
Protected Member Functions | |
| GenericMenuItem (MenuItemToken, const std::string &label, Flags flags=Flags::Zero()) | |
| Constructs a new GenericMenuItem. More... | |
| GenericMenuItem (MenuItemToken, const std::string &label, const std::string &description, Flags flags=Flags::Zero()) | |
| Constructs a new GenericMenuItem. More... | |
| GenericMenuItem (MenuItemToken, const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero()) | |
| Constructs a new GenericMenuItem with an associated value. More... | |
Protected Member Functions inherited from duds::ui::menu::MenuItem | |
| MenuItem (MenuItemToken, const std::string &label, Flags flags=Flags::Zero()) | |
| Constructs a new MenuItem. More... | |
| MenuItem (MenuItemToken, const std::string &label, const std::string &description, Flags flags=Flags::Zero()) | |
| Constructs a new MenuItem. More... | |
| MenuItem (MenuItemToken, const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero()) | |
| Constructs a new MenuItem with an associated value. More... | |
| MenuItem (MenuItemToken, const MenuItem &mi) | |
| Copy constructs a new MenuItem. More... | |
Private Attributes | |
| Signal | choseSig |
| The signal that is invoked when the user choses this menu item. More... | |
| Signal | deselSig |
| The signal that is invoked when the user deselects this menu item. More... | |
| Signal | selSig |
| The signal that is invoked when the user selects this menu item. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from duds::ui::menu::MenuItem | |
| static constexpr Flags | Disabled = Flags::Bit(0) |
| Indicates that the item may not be chosen by the user. More... | |
| static constexpr Flags | HasValue = Flags::Bit(2) |
| Indicates that the item has a value, or setting, that should be shown in the menu if possible. More... | |
| static constexpr Flags | Invisible = Flags::Bit(1) |
| Indicates that the item will not be rendered. More... | |
| static constexpr Flags | Toggle = Flags::Bit(3) |
| Denotes that the item is a toggle, and that the toggle state should be visible on the menu. More... | |
| static constexpr Flags | ToggledOn = Flags::Bit(4) |
| The toggle state; true when the state is on, when the item is true. More... | |
A generic take on MenuItem that invokes a Boost signal when the item is chosen, selected, or deselected.
Definition at line 23 of file GenericMenuItem.hpp.
| typedef boost::signals2::signal< void( MenuView &invokingView, const MenuAccess &access, GenericMenuItem &self ) > duds::ui::menu::GenericMenuItem::Signal |
The signal type invoked when the item is chosen, selected, or deselected.
| invokingView | The view used to chose or select the menu item. |
| access | An access object for the menu that may be used to modify the menu. |
| self | The GenericMenuItem that invoked the signal. |
Definition at line 38 of file GenericMenuItem.hpp.
|
inlineprotected |
Constructs a new GenericMenuItem.
| label | Short text presented to the user as the menu item. |
| flags | The option flags for the item. The default is zero: enabled, visible, no value, and not a toggle. |
Definition at line 62 of file GenericMenuItem.hpp.
|
inlineprotected |
Constructs a new GenericMenuItem.
| label | Short text presented to the user as the menu item. |
| description | Longer text optionally presented to the user to provide a better idea of what the option does. |
| flags | The option flags for the item. The default is zero: enabled, visible, no value, and not a toggle. |
Definition at line 78 of file GenericMenuItem.hpp.
|
inlineprotected |
Constructs a new GenericMenuItem with an associated value.
| label | Short text presented to the user as the menu item. |
| description | Longer text optionally presented to the user to provide a better idea of what the option does. |
| value | The current value associated with the menu item. |
| flags | The option flags for the item. While the default is zero, the MenuItem::HasValue flag will be OR'd with the given value by the constructor. |
Definition at line 97 of file GenericMenuItem.hpp.
|
virtual |
Invokes the choseSig signal in response to the user chosing this menu item.
Use one of the choseConnect() or choseConnectExtended() functions to make connections to the signal.
Implements duds::ui::menu::MenuItem.
Definition at line 14 of file GenericMenuItem.cpp.
Referenced by make().
|
inline |
Make a connection to the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 183 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 195 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 208 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 220 of file GenericMenuItem.hpp.
|
inline |
Disconnect a group from the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 233 of file GenericMenuItem.hpp.
|
inline |
Disconnect from the generic menu item chose signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 245 of file GenericMenuItem.hpp.
|
virtual |
Invokes the deselSig signal in response to the user deselecting this menu item.
Reimplemented from duds::ui::menu::MenuItem.
Definition at line 22 of file GenericMenuItem.cpp.
Referenced by make().
|
inline |
Make a connection to the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 325 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 337 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 350 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 362 of file GenericMenuItem.hpp.
|
inline |
Disconnect a group from the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 375 of file GenericMenuItem.hpp.
|
inline |
Disconnect from the generic menu item deselect signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 387 of file GenericMenuItem.hpp.
|
inlinestatic |
Makes a shared pointer holding a new GenericMenuItem.
| label | Short text presented to the user as the menu item. |
| flags | The option flags for the item. The default is zero: enabled, visible, no value, and not a toggle. |
Definition at line 110 of file GenericMenuItem.hpp.
|
inlinestatic |
Makes a shared pointer holding a new GenericMenuItem.
| label | Short text presented to the user as the menu item. |
| description | Longer text optionally presented to the user to provide a better idea of what the option does. |
| flags | The option flags for the item. The default is zero: enabled, visible, no value, and not a toggle. |
Definition at line 124 of file GenericMenuItem.hpp.
|
inlinestatic |
Makes a shared pointer holding a new GenericMenuItem with an associated value.
| label | Short text presented to the user as the menu item. |
| description | Longer text optionally presented to the user to provide a better idea of what the option does. |
| value | The current value associated with the menu item. |
| flags | The option flags for the item. While the default is zero, the MenuItem::HasValue flag will be OR'd with the given value by the constructor. |
Definition at line 147 of file GenericMenuItem.hpp.
|
virtual |
Invokes the selSig signal in response to the user selecting this menu item.
Reimplemented from duds::ui::menu::MenuItem.
Definition at line 18 of file GenericMenuItem.cpp.
Referenced by make().
|
inline |
Make a connection to the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 254 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 266 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 279 of file GenericMenuItem.hpp.
|
inline |
Make a connection to the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 291 of file GenericMenuItem.hpp.
|
inline |
Disconnect a group from the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 304 of file GenericMenuItem.hpp.
|
inline |
Disconnect from the generic menu item select signal.
See the Boost reference documentation for more details, or the tutorial for an overview of the whole boost::singals2 system.
Definition at line 316 of file GenericMenuItem.hpp.
|
private |
The signal that is invoked when the user choses this menu item.
Definition at line 43 of file GenericMenuItem.hpp.
Referenced by chose().
|
private |
The signal that is invoked when the user deselects this menu item.
Definition at line 51 of file GenericMenuItem.hpp.
Referenced by deselect().
|
private |
The signal that is invoked when the user selects this menu item.
Definition at line 47 of file GenericMenuItem.hpp.
Referenced by select().