DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
BaseMenu Class Referenceabstract

Class for maintaining a linked list of menu items to form a menu. More...

#include <BaseMenu.h>

Inheritance diagram for BaseMenu:
Inheritance graph
[legend]
Collaboration diagram for BaseMenu:
Collaboration graph
[legend]

Public Member Functions

virtual void handleUserConfirmationAction (UserConfirmationAction action)=0
 Implement this method to respond to user confirmation actions.
 
void handleUserSelectionAction (UserSelectionAction action)
 Method to respond to user selection actions.
 
void displayMenu (DisplayInterface *displayInterface)
 Method to display the menu on screen.
 
void setMenuName (const char *name)
 Set the name of this menu.
 
const char * getMenuName ()
 Get the name of this menu.
 
void addItem (BaseMenuItem *menuItem)
 Add a menu item to this menu.
 
BaseMenuItemgetFirstMenuItem ()
 Get the first menu item associated with this menu.
 
BaseMenuItemgetMenuItemAtIndex (uint8_t index)
 Get the menu item at the specified index.
 
uint8_t getMenuItemCount ()
 Get the number of menu items associated with this menu.
 
uint8_t getSelectedItemIndex ()
 Get the index of the currently selected menu item.
 
bool getSelectionChanged ()
 Check if the user selection has changed.
 
void setEventManager (EventManager *eventManager)
 Set the application's event manager instance.
 
EventManagergetEventManager ()
 Get the application's event manager instance.
 

Private Attributes

const char * _name = nullptr
 
BaseMenuItem_firstMenuItem = nullptr
 
uint8_t _menuItemCount = 0
 
uint8_t _currentItemIndex = 0
 
uint8_t _selectedItemIndex = 0
 
bool _selectionChanged = false
 
EventManager_eventManager = nullptr
 

Detailed Description

Class for maintaining a linked list of menu items to form a menu.

Member Function Documentation

◆ addItem()

void BaseMenu::addItem ( BaseMenuItem menuItem)

Add a menu item to this menu.

Parameters
itemPointer to an existing menu item
Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayMenu()

void BaseMenu::displayMenu ( DisplayInterface displayInterface)

Method to display the menu on screen.

Parameters
displayInterfacePointer to the physical display
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEventManager()

EventManager * BaseMenu::getEventManager ( )

Get the application's event manager instance.

Returns
Pointer to the event manager instance
Here is the caller graph for this function:

◆ getFirstMenuItem()

BaseMenuItem * BaseMenu::getFirstMenuItem ( )

Get the first menu item associated with this menu.

Returns
Pointer to the first menu item

◆ getMenuItemAtIndex()

BaseMenuItem * BaseMenu::getMenuItemAtIndex ( uint8_t  index)

Get the menu item at the specified index.

Parameters
indexIndex of the menu item to retrieve
Returns
Pointer to the specified menu item, or nullptr if it doesn't exist
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMenuItemCount()

uint8_t BaseMenu::getMenuItemCount ( )

Get the number of menu items associated with this menu.

Returns
8 bit integer count of menu items

◆ getMenuName()

const char * BaseMenu::getMenuName ( )

Get the name of this menu.

Returns
Pointer to the char array containing the menu name

◆ getSelectedItemIndex()

uint8_t BaseMenu::getSelectedItemIndex ( )

Get the index of the currently selected menu item.

Returns
Index of the currently selected menu item
Here is the caller graph for this function:

◆ getSelectionChanged()

bool BaseMenu::getSelectionChanged ( )

Check if the user selection has changed.

Returns
True|False

◆ handleUserConfirmationAction()

virtual void BaseMenu::handleUserConfirmationAction ( UserConfirmationAction  action)
pure virtual

Implement this method to respond to user confirmation actions.

Parameters
actionUserConfirmationAction::[None|SingleClick|DoubleClick|LongPress]

Implemented in SelectActionMenu, SelectCommandStationMenu, and SelectLocoMenu.

Here is the caller graph for this function:

◆ handleUserSelectionAction()

void BaseMenu::handleUserSelectionAction ( UserSelectionAction  action)

Method to respond to user selection actions.

Parameters
actionUserSelectionAction::[None|Up|UpFaster|UpFastest|Down|DownFaster|DownFastest]
Here is the caller graph for this function:

◆ setEventManager()

void BaseMenu::setEventManager ( EventManager eventManager)

Set the application's event manager instance.

Parameters
eventManagerPointer to the event manager instance
Here is the caller graph for this function:

◆ setMenuName()

void BaseMenu::setMenuName ( const char *  name)

Set the name of this menu.

Parameters
namePointer to the char array containing the name
Here is the caller graph for this function:

Member Data Documentation

◆ _currentItemIndex

uint8_t BaseMenu::_currentItemIndex = 0
private

◆ _eventManager

EventManager* BaseMenu::_eventManager = nullptr
private

◆ _firstMenuItem

BaseMenuItem* BaseMenu::_firstMenuItem = nullptr
private

◆ _menuItemCount

uint8_t BaseMenu::_menuItemCount = 0
private

◆ _name

const char* BaseMenu::_name = nullptr
private

◆ _selectedItemIndex

uint8_t BaseMenu::_selectedItemIndex = 0
private

◆ _selectionChanged

bool BaseMenu::_selectionChanged = false
private

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