ItemSubMenu

Defines

ITEM_SUBMENU(...)
class ItemSubMenu : public MenuItem
#include <ItemSubMenu.h>

Represents a submenu item in a menu.

This class extends the MenuItem class and provides functionality to navigate to a different screen when the item is selected.

Public Functions

inline ItemSubMenu(const char *text, MenuScreen *&screen)
Parameters:
  • text – text to display for the item

  • screen – the next screen to show

Protected Functions

inline virtual bool process(LcdMenu *menu, const unsigned char command)

Process a command decoded in 1 byte. It can be a printable character or a control command like ENTER or LEFT. Return value is used to determine operation was successful or ignored. If the parent of item received that handle was ignored it can execute it’s own action on this command. Thus, the item always has priority in processing; if it is ignored, it is delegated to the parent element. Behaviour is very similar to Even Bubbling in JavaScript.

Parameters:
  • menu – the owner menu of the item, can be used to retrieve required object, such as DisplayInterface or MenuScreen

  • command – the character command, can be a printable character or a control command

Returns:

true if command was successfully handled by item.

inline void changeScreen(LcdMenu *menu)

Private Members

MenuScreen *&screen