Represents a collection of menus forming a menu system. More...
#include <LiquidMenu.h>
Public Member Functions | |
Constructors | |
LiquidSystem (uint8_t startingMenu=1) | |
The main constructor. More... | |
LiquidSystem (LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, uint8_t startingMenu=1) | |
Constructor for 2 LiquidMenu objects. More... | |
LiquidSystem (LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, uint8_t startingMenu=1) | |
Constructor for 3 LiquidMenu objects. More... | |
LiquidSystem (LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4, uint8_t startingMenu=1) | |
Constructor for 4 LiquidMenu objects. More... | |
Public methods | |
bool | add_menu (LiquidMenu &liquidMenu) |
Adds a LiquidMenu object to the menu system. More... | |
bool | change_menu (LiquidMenu &p_liquidMenu) |
Switches to the specified menu. More... | |
void | next_screen () |
Switches to the next screen. More... | |
void | operator++ () |
Switches to the next screen. More... | |
void | operator++ (int) |
Switches to the next screen. More... | |
void | previous_screen () |
Switches to the previous screen. More... | |
void | operator-- () |
Switches to the previous screen. More... | |
void | operator-- (int) |
Switches to the previous screen. More... | |
bool | change_screen (LiquidScreen &p_liquidScreen) |
Switches to the specified screen. More... | |
bool | change_screen (uint8_t number) |
Switches to the specified screen. More... | |
bool | operator= (LiquidScreen &p_liquidScreen) |
Switches to the specified screen. More... | |
bool | operator= (uint8_t number) |
Switches to the specified screen. More... | |
void | switch_focus (bool forward=true) |
Switches the focus. More... | |
bool | set_focusPosition (Position position) |
Sets the focus position for the whole menu at once. More... | |
bool | set_focusSymbol (Position position, uint8_t symbol[8]) |
Changes the focus indicator's symbol. More... | |
bool | call_function (uint8_t number) const |
Calls an attached function specified by the number. More... | |
void | update () const |
Prints the current screen to the display. More... | |
void | softUpdate () const |
Prints the current screen to the display (without clearing). More... | |
Detailed Description
Represents a collection of menus forming a menu system.
A menu system is made up of LiquidMenu objects. It holds pointers to them and calls their functions depending on which one is active. This class is uses the same public methods as LiquidMenu with the addition of a method for adding a LiquidMenu object and a method for chaning the currently active menu. This class is optional, it is used only if there is a need for multiple menus.
- See also
- LiquidMenu
- Examples:
- system_menu.ino.
Constructor & Destructor Documentation
§ LiquidSystem() [1/4]
|
explicit |
The main constructor.
This is the main constructor that gets called every time.
- Parameters
-
startingMenu - the number of the menu that will be shown first
§ LiquidSystem() [2/4]
LiquidSystem::LiquidSystem | ( | LiquidMenu & | liquidMenu1, |
LiquidMenu & | liquidMenu2, | ||
uint8_t | startingMenu = 1 |
||
) |
Constructor for 2 LiquidMenu objects.
- Parameters
-
&liquidMenu1 - pointer to a LiquidMenu object &liquidMenu2 - pointer to a LiquidMenu object startingMenu - the number of the menu that will be shown first
§ LiquidSystem() [3/4]
LiquidSystem::LiquidSystem | ( | LiquidMenu & | liquidMenu1, |
LiquidMenu & | liquidMenu2, | ||
LiquidMenu & | liquidMenu3, | ||
uint8_t | startingMenu = 1 |
||
) |
Constructor for 3 LiquidMenu objects.
- Parameters
-
&liquidMenu1 - pointer to a LiquidMenu object &liquidMenu2 - pointer to a LiquidMenu object &liquidMenu3 - pointer to a LiquidMenu object startingMenu - the number of the menu that will be shown first
§ LiquidSystem() [4/4]
LiquidSystem::LiquidSystem | ( | LiquidMenu & | liquidMenu1, |
LiquidMenu & | liquidMenu2, | ||
LiquidMenu & | liquidMenu3, | ||
LiquidMenu & | liquidMenu4, | ||
uint8_t | startingMenu = 1 |
||
) |
Constructor for 4 LiquidMenu objects.
- Parameters
-
&liquidMenu1 - pointer to a LiquidMenu object &liquidMenu2 - pointer to a LiquidMenu object &liquidMenu3 - pointer to a LiquidMenu object &liquidMenu4 - pointer to a LiquidMenu object startingMenu - the number of the menu that will be shown first
Member Function Documentation
§ add_menu()
bool LiquidSystem::add_menu | ( | LiquidMenu & | liquidMenu | ) |
Adds a LiquidMenu object to the menu system.
- Parameters
-
&liquidMenu - pointer to a LiquidMenu object
- Returns
- true on success and false if the maximum amount of menus has been reached
- Note
- The maximum amount of menus per menu system is specified in LiquidMenu_config.h as
MAX_MENUS
. The default is 12.
- See also
- LiquidMenu_config.h
- MAX_MENUS
§ call_function()
bool LiquidSystem::call_function | ( | uint8_t | number | ) | const |
Calls an attached function specified by the number.
Calls the function specified by the number argument for the current screen and for the focused line.
- Parameters
-
number - number of the function in the array
- Returns
- true if there is a function at the specified number
- Note
- Function numbering starts from 1.
- See also
- bool LiquidLine::attach_function(uint8_t number, void (*function)(void))
- Examples:
- system_menu.ino.
§ change_menu()
bool LiquidSystem::change_menu | ( | LiquidMenu & | p_liquidMenu | ) |
Switches to the specified menu.
- Parameters
-
*p_liquidMenu - pointer to the LiquidMenu object
- Returns
- true on success and false if the menu is not found
- Examples:
- system_menu.ino.
§ change_screen() [1/2]
bool LiquidSystem::change_screen | ( | LiquidScreen & | p_liquidScreen | ) |
Switches to the specified screen.
- Parameters
-
*p_liquidScreen - pointer to the LiquidScreen object
- Returns
- true on success and false if the screen is not found
§ change_screen() [2/2]
bool LiquidSystem::change_screen | ( | uint8_t | number | ) |
Switches to the specified screen.
- Parameters
-
number - the number of the screen
- Returns
- true on success and false if the number of the screen is invalid.
§ next_screen()
void LiquidSystem::next_screen | ( | ) |
Switches to the next screen.
- Examples:
- system_menu.ino.
§ operator++() [1/2]
void LiquidSystem::operator++ | ( | ) |
Switches to the next screen.
- Note
- Prefix increment operator overloading.
§ operator++() [2/2]
void LiquidSystem::operator++ | ( | int | ) |
Switches to the next screen.
- Note
- Postfix increment operator overloading.
§ operator--() [1/2]
void LiquidSystem::operator-- | ( | ) |
Switches to the previous screen.
- Note
- Prefix decrement operator overloading.
§ operator--() [2/2]
void LiquidSystem::operator-- | ( | int | ) |
Switches to the previous screen.
- Note
- Postfix decrement operator overloading.
§ operator=() [1/2]
bool LiquidSystem::operator= | ( | LiquidScreen & | p_liquidScreen | ) |
Switches to the specified screen.
- Parameters
-
&p_liquidScreen - pointer to the screen
- Returns
- true on success and false if the screen is not found
§ operator=() [2/2]
bool LiquidSystem::operator= | ( | uint8_t | number | ) |
Switches to the specified screen.
- Parameters
-
number - the number of the screen
- Returns
- true on success and false if the number of the screen is invalid.
§ previous_screen()
void LiquidSystem::previous_screen | ( | ) |
Switches to the previous screen.
- Examples:
- system_menu.ino.
§ set_focusPosition()
bool LiquidSystem::set_focusPosition | ( | Position | position | ) |
Sets the focus position for the whole menu at once.
The valid positions are LEFT
and RIGHT
. CUSTOM
is not valid for this function because it needs individual colum and row for every line.
- Parameters
-
position - LEFT
orRIGHT
- Returns
- true on success and false if the position specified is invalid
- Note
- The
Position
is enum class. UsePosition::(member)
when specifeing the position.
- See also
- Position
§ set_focusSymbol()
bool LiquidSystem::set_focusSymbol | ( | Position | position, |
uint8_t | symbol[8] | ||
) |
Changes the focus indicator's symbol.
The symbol is changed for a particular position.
- Parameters
-
position - the position for which the symbol will be changed symbol[] - the symbol
- Returns
- true on success and false if the position specified is invalid
- Note
- The
Position
is enum class. UsePosition::(member)
when specifeing the position.
- See also
- Position
§ softUpdate()
void LiquidSystem::softUpdate | ( | ) | const |
Prints the current screen to the display (without clearing).
Call this method when there is a change in some of the variable attached and the new symbols cover all of the old symbols.
- Note
- This method doesn't clear the display.
§ switch_focus()
void LiquidSystem::switch_focus | ( | bool | forward = true | ) |
Switches the focus.
Switches the focus to the next or previous line according to the passed parameter.
- Parameters
-
forward - true for forward, false for backward
- Examples:
- system_menu.ino.
§ update()
void LiquidSystem::update | ( | ) | const |
Prints the current screen to the display.
Call this method when there is a change in some of the variable attached.
- Examples:
- system_menu.ino.
The documentation for this class was generated from the following files:
- LiquidMenu.h
- LiquidSystem.cpp