GlsMenu
1.5.4
|
#include <gls_menu_item.h>
Public Types | |
typedef GlsMenuHandlerGroup_T< State_t > | BaseClass |
Public Member Functions | |
GlsMenuItem_T (const std::string &name, GlsMenuDictionary &dataDict, GlsMenuAction::HandlerCont_t &actionHandlers) | |
virtual | ~GlsMenuItem_T () |
State_t * | State () |
void | Select () |
State_t * | Item (const std::string &name) const |
virtual std::istream & | ReadValue (std::istream &instr) |
const GlsMenuDictionary & | Attributes () const |
virtual std::ostream & | WriteValue (std::ostream &outstr) |
virtual void | Inc (long amount=1) |
Protected Member Functions | |
virtual GlsMenuData * | CreateDataItem (const std::string &name) const |
Protected Attributes | |
State_t * | _currentState |
GlsMenuDictionary & | _dataDict |
Data dictionary to pass to items created in the group. This is the dictionary used to evaluate menu data variables. More... | |
GlsMenuAction::HandlerCont_t & | _handlers |
bool | _uniqueKeys |
Specifies whether attribute names should be unique or not. More... | |
GlsMenuDictionary | _attr |
The dictionary of attributes for the group attribute. More... | |
This provides the functionality of a menu item. A menu item can contain one or more states that are visible at different instances. The current state is the first one found that is currently visible.
The class is templatized so that users can provide their own extended menu item state class as the states of the menu item. The State_t template parameter must be a class derived from GlsMenuItemState.
Definition at line 188 of file gls_menu_item.h.
typedef GlsMenuHandlerGroup_T<State_t> GlsMenuItem_T< State_t >::BaseClass |
Definition at line 191 of file gls_menu_item.h.
|
inline |
Class constructor.
name | name of menu item. This usually refers to a location of an item, as the states of the item can contain different labels. |
dataDict | the meta-data dictionary used for looking up the values of variables. This is passed on to the item's states when they are created for them to use. |
actionHandlers | These are handlers for menu actions passed in by the creator. These are considered local to the menu set. |
Definition at line 207 of file gls_menu_item.h.
|
inlinevirtual |
Class destructor.
Definition at line 222 of file gls_menu_item.h.
|
inlineinherited |
Read attribute dictionary from an input stream.
instr | input stream to read value from. |
Definition at line 78 of file gls_menu_data_group.h.
References GlsMenuDataGroup::_attr.
Referenced by GlsMFDMenu_T< MenuItem_t, Submenu_t, PageId_t >::ReadValue().
|
inlineprotectedvirtualinherited |
Create a new instance of our particular data item type. In this case, it is an menu item that will accept action handlers, since it or one of its components will handle actions.
name | name of the data item. |
Implements GlsMenuDynDataGroup.
Definition at line 319 of file gls_menu_data_group.h.
|
virtualinherited |
Increment the data item. Derived classes must override this as the default is a no-op.
Reimplemented in GlsMenuDiscrete_T< T >.
Referenced by GlsMenuSet_T< MenuType_t, DataFactory_t >::IncData().
|
inlineinherited |
Gain access to a particular meta-data item within the group.
name | name of the meta-data item. |
Definition at line 294 of file gls_menu_data_group.h.
|
virtualinherited |
Read attribute dictionary from an input stream.
instr | input stream to read value from. |
Reimplemented from GlsMenuDataGroup.
|
inline |
The menu item has been selected, so notify the current state, if any, that it has been selected. This should activate all callbacks.
Definition at line 263 of file gls_menu_item.h.
References GlsMenuItem_T< State_t >::_currentState.
|
inline |
Returns the current state of the menu item and checks the timers of all its menu item states. This should be called on a cyclical basis if the timer mechanism is to work properly. This should be used to update the state of the menu item on some display. The state should determine how the item looks on the display.
Definition at line 233 of file gls_menu_item.h.
References GlsMenuDataGroup::_attr, and GlsMenuItem_T< State_t >::_currentState.
|
virtualinherited |
Read attribute dictionary from an input stream.
instr | input stream to read value from. |
|
protectedinherited |
The dictionary of attributes for the group attribute.
Definition at line 100 of file gls_menu_data_group.h.
Referenced by GlsMenuDataGroup::Attributes(), GlsMenu_T< MenuItem_t, GlsMFD::MenuItemId_t >::GlsMenu_T(), GlsMFDMenu_T< MenuItem_t, Submenu_t, PageId_t >::GlsMFDMenu_T(), GlsMFDSubmenu_T< MenuItemId_t >::GlsMFDSubmenu_T(), GlsMenuDataGroup_T< T >::Item(), GlsMenuHandlerGroup_T< Menu_t >::Item(), GlsMFDMenu_T< MenuItem_t, Submenu_t, PageId_t >::ReadValue(), and GlsMenuItem_T< State_t >::State().
|
protected |
Definition at line 270 of file gls_menu_item.h.
Referenced by GlsMenuItem_T< State_t >::Select(), and GlsMenuItem_T< State_t >::State().
|
protectedinherited |
Data dictionary to pass to items created in the group. This is the dictionary used to evaluate menu data variables.
Definition at line 302 of file gls_menu_data_group.h.
|
protectedinherited |
Definition at line 306 of file gls_menu_data_group.h.
|
protectedinherited |
Specifies whether attribute names should be unique or not.
Definition at line 151 of file gls_menu_data_group.h.