DUDS
Distributed Update of Data from Something
duds::ui::menu::renderers::BppMenuIconItem Class Reference

A MenuIten that holds a bit-per-pixel icon to represent the item. More...

#include <BppIconItem.hpp>

Inheritance diagram for duds::ui::menu::renderers::BppMenuIconItem:
Collaboration diagram for duds::ui::menu::renderers::BppMenuIconItem:

Protected Member Functions

 BppMenuIconItem (MenuItemToken, const std::string &label, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, const duds::ui::graphics::BppImageSptr &icon, const std::string &label, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, duds::ui::graphics::BppImageSptr &&icon, const std::string &label, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, const std::string &label, const std::string &description, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, const duds::ui::graphics::BppImageSptr &icon, const std::string &label, const std::string &description, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, duds::ui::graphics::BppImageSptr &&icon, const std::string &label, const std::string &description, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem. More...
 
 BppMenuIconItem (MenuItemToken, const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem with an associated value. More...
 
 BppMenuIconItem (MenuItemToken, const duds::ui::graphics::BppImageSptr &icon, const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem with an associated value. More...
 
 BppMenuIconItem (MenuItemToken, duds::ui::graphics::BppImageSptr &&icon, const std::string &label, const std::string &description, const std::string &value, Flags flags=Flags::Zero())
 Constructs a new BppMenuIconItem 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...
 

Additional Inherited Members

- 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 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...
 
virtual void chose (MenuView &invokingView, const MenuAccess &access)=0
 Called by MenuView when the user choses this MenuItem. 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...
 
virtual void deselect (MenuView &invokingView, const MenuAccess &access)
 Invoked when the user has selected another item, and before the select() function for that item is invoked. 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...
 
Menumenu () const
 Returns the menu object that owns this item. More...
 
void remove ()
 Removes the item from its parent menu. More...
 
virtual void select (MenuView &invokingView, const MenuAccess &access)
 Invoked when the user has selected, but has not chosen, the item. 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...
 
- Public Member Functions inherited from duds::ui::menu::renderers::BppIconItem
 BppIconItem ()=default
 Constructs the item without an icon. More...
 
 BppIconItem (const duds::ui::graphics::ConstBppImageSptr &icon)
 Constructs the item with the given icon. More...
 
 BppIconItem (duds::ui::graphics::ConstBppImageSptr &&icon)
 Constructs the item with the given icon. More...
 
const duds::ui::graphics::ConstBppImageSptricon () const
 Returns the item's icon. More...
 
void icon (const duds::ui::graphics::ConstBppImageSptr &newimg)
 Sets the item's icon to the given image. More...
 
void icon (duds::ui::graphics::ConstBppImageSptr &&newimg)
 Sets the item's icon to the given image. More...
 
- 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...
 

Detailed Description

A MenuIten that holds a bit-per-pixel icon to represent the item.

When using a dynamic_cast from a MenuItem in an attempt to obtain an icon, cast to a BppIconItem.

Author
Jeff Jackowski

Definition at line 77 of file BppIconItem.hpp.

Constructor & Destructor Documentation

◆ BppMenuIconItem() [1/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const std::string &  label,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
labelShort text presented to the user as the menu item.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 87 of file BppIconItem.hpp.

◆ BppMenuIconItem() [2/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const duds::ui::graphics::BppImageSptr icon,
const std::string &  label,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon.
labelShort text presented to the user as the menu item.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 101 of file BppIconItem.hpp.

◆ BppMenuIconItem() [3/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
duds::ui::graphics::BppImageSptr &&  icon,
const std::string &  label,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon. The shared pointer is moved into this object.
labelShort text presented to the user as the menu item.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 117 of file BppIconItem.hpp.

◆ BppMenuIconItem() [4/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const std::string &  label,
const std::string &  description,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 133 of file BppIconItem.hpp.

◆ BppMenuIconItem() [5/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const duds::ui::graphics::BppImageSptr icon,
const std::string &  label,
const std::string &  description,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon.
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 150 of file BppIconItem.hpp.

◆ BppMenuIconItem() [6/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
duds::ui::graphics::BppImageSptr &&  icon,
const std::string &  label,
const std::string &  description,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon. The shared pointer is moved into this object.
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
flagsThe option flags for the item. The default is zero: enabled, visible, no value, and not a toggle.

Definition at line 169 of file BppIconItem.hpp.

◆ BppMenuIconItem() [7/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const std::string &  label,
const std::string &  description,
const std::string &  value,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem with an associated value.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
valueThe current value associated with the menu item.
flagsThe 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 189 of file BppIconItem.hpp.

◆ BppMenuIconItem() [8/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
const duds::ui::graphics::BppImageSptr icon,
const std::string &  label,
const std::string &  description,
const std::string &  value,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem with an associated value.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon.
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
valueThe current value associated with the menu item.
flagsThe 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 209 of file BppIconItem.hpp.

◆ BppMenuIconItem() [9/9]

duds::ui::menu::renderers::BppMenuIconItem::BppMenuIconItem ( MenuItemToken  ,
duds::ui::graphics::BppImageSptr &&  icon,
const std::string &  label,
const std::string &  description,
const std::string &  value,
Flags  flags = Flags::Zero() 
)
inlineprotected

Constructs a new BppMenuIconItem with an associated value.

Note
All BppMenuIconItem objects must be managed by std::shared_ptr.
Parameters
iconThe image for the item's icon. The shared pointer is moved into this object.
labelShort text presented to the user as the menu item.
descriptionLonger text optionally presented to the user to provide a better idea of what the option does.
valueThe current value associated with the menu item.
flagsThe 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 232 of file BppIconItem.hpp.


The documentation for this class was generated from the following file: