Represents the individual lines printed on the display. More...
#include <LiquidMenu.h>
Public Member Functions | |
Constructors | |
LiquidLine (uint8_t column, uint8_t row) | |
The main constructor. More... | |
template<typename A > | |
LiquidLine (uint8_t column, uint8_t row, A &variableA) | |
Constructor for one variable/constant. More... | |
template<typename A , typename B > | |
LiquidLine (uint8_t column, uint8_t row, A &variableA, B &variableB) | |
Constructor for two variables/constants. More... | |
template<typename A , typename B , typename C > | |
LiquidLine (uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC) | |
Constructor for three variables/constants. More... | |
template<typename A , typename B , typename C , typename D > | |
LiquidLine (uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC, D &variableD) | |
Constructor for four variables/constants. More... | |
Public methods | |
template<typename T > | |
bool | add_variable (T &variable) |
Adds a variable to the line. More... | |
bool | attach_function (uint8_t number, void(*function)(void)) |
Attaches a callback function to the line. More... | |
bool | set_focusPosition (Position position, uint8_t column=0, uint8_t row=0) |
Configures the focus indicator position for the line. More... | |
bool | set_asGlyph (uint8_t number) |
Converts a byte variable into a glyph index. More... | |
Friends | |
class | LiquidScreen |
Detailed Description
Represents the individual lines printed on the display.
This is the lowest class in the hierarchy, it holds pointers to the variables/constants that will be printed, where the line is positioned, where the focus indicator is positioned and pointers to the callback functions. This classes' objects go into a LiquidScreen object which which controls them. The public methods are for configuration only.
- Examples:
- buttons_menu.ino, focus_menu.ino, functions_menu.ino, hello_menu.ino, serial_menu.ino, and system_menu.ino.
Constructor & Destructor Documentation
|
inline |
The main constructor.
This is the main constructor that gets called every time.
- Parameters
-
column - the column at which the line starts row - the row at which the line is printed
|
inline |
Constructor for one variable/constant.
- Parameters
-
column - the column at which the line starts row - the row at which the line is printed &variableA - variable/constant to be printed
|
inline |
Constructor for two variables/constants.
- Parameters
-
column - the column at which the line starts row - the row at which the line is printed &variableA - variable/constant to be printed &variableB - variable/constant to be printed
|
inline |
Constructor for three variables/constants.
- Parameters
-
column - the column at which the line starts row - the row at which the line is printed &variableA - variable/constant to be printed &variableB - variable/constant to be printed &variableC - variable/constant to be printed
|
inline |
Constructor for four variables/constants.
- Parameters
-
column - the column at which the line starts row - the row at which the line is printed &variableA - variable/constant to be printed &variableB - variable/constant to be printed &variableC - variable/constant to be printed &variableD - variable/constant to be printed
Member Function Documentation
|
inline |
Adds a variable to the line.
- Parameters
-
&variable - reference to the variable
- Returns
- true on success and false if the maximum amount of variables has been reached
- Note
- The maximum amount of variable per line is specified in LiquidMenu_config.h as
MAX_VARIABLES
. The default is 5.
- See also
- LiquidMenu_config.h
- MAX_VARIABLES

bool LiquidLine::attach_function | ( | uint8_t | number, |
void(*)(void) | function | ||
) |
Attaches a callback function to the line.
The number is used for identification. The callback function can later be called when the line is focused with LiquidMenu::call_function(uint8_t number) const
.
- Parameters
-
number - function number used for identification *function - pointer to the function
- Returns
- true on success and false if maximum amount of functions has been reached
- Note
- Function numbering starts from 1.
-
The maximum amount of functions per line is specified in LiquidMenu_config.h as
MAX_FUNCTIONS
. The default is 8.
- Examples:
- functions_menu.ino, and system_menu.ino.

bool LiquidLine::set_asGlyph | ( | uint8_t | number | ) |
Converts a byte variable into a glyph index.
If a custom character (glyph) was created using LiquidCrystal::createChar(byte index, byte character[8])
it can be displayed as a normal variable using this method.
- Parameters
-
number - the variable number that will be converted to an index
- Returns
- true on success and false if the variable with that number is not a
byte
.
bool LiquidLine::set_focusPosition | ( | Position | position, |
uint8_t | column = 0 , |
||
uint8_t | row = 0 |
||
) |
Configures the focus indicator position for the line.
The valid positions are LEFT
, RIGHT
and CUSTOM
. The CUSTOM
position is absolute so it also needs the column and row that it will be printed on.
- Parameters
-
position - LEFT
,RIGHT
orCUSTOM
column - if using CUSTOM
this specifies the columnrow - if using CUSTOM
this specifies the row
- Returns
- true on success and false if the position specified is invalid
- Note
- The
Position
is enum class. UsePosition::(member)
when specifying the position.
- See also
- Position
- Examples:
- system_menu.ino.


The documentation for this class was generated from the following files:
- LiquidMenu.h
- LiquidLine.cpp