LcdMenu
-
class LcdMenu
- #include <LcdMenu.h>
Represents the main menu object.
The LcdMenu class is the main object that manages the menu system. It is responsible for displaying the menu on the screen, processing user input, and updating the display based on the user’s actions.
Public Functions
-
inline LcdMenu(MenuRenderer &renderer)
Construct new instance of
LcdMenu
.
-
MenuRenderer *getRenderer()
Get the renderer.
- Returns:
the renderer
-
MenuScreen *getScreen()
Get the screen that currently on display.
- Returns:
currently active screen
-
void setScreen(MenuScreen *screen)
Set new screen to display. The only place that clears whole screen. Then it Will
draw
of new screen screen using the renderer.- Parameters:
screen – the new screen to display
-
bool process(const unsigned char c)
Process the input character.
- Parameters:
c – the input character
- Returns:
true
if the input was processed successfully
-
void hide()
Hide the menu. When you want to display any other content on the screen then call this function then display your content, later call
show()
to show the menu.
-
uint8_t getCursor()
Get the current cursor position of current screen.
- Returns:
the 0-based
cursor
position
-
void setCursor(uint8_t cursor)
Set the current cursor position.
- Parameters:
cursor – the 0-based
cursor
position
Private Members
-
MenuRenderer &renderer
The renderer used to display the menu on the screen.
-
MenuScreen *screen = NULL
Currently visible menu screen.
-
inline LcdMenu(MenuRenderer &renderer)