LiquidMenu
1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
|
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... | |
void | set_decimalPlaces (uint8_t decimalPlaces) |
Sets the decimal places for floating point variables. 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... | |
bool | set_asProgmem (uint8_t number) |
Converts a const char pointer variable into const char pointer PROGMEM one. More... | |
Friends | |
class | LiquidScreen |
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 controls them. The public methods are for configuration only.
|
inline |
The main constructor.
This is the main constructor that gets called every time.
column | - the column at which the line starts |
row | - the row at which the line is printed |
|
inline |
Constructor for one variable/constant.
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.
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.
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.
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 |
|
inline |
Adds a variable to the line.
&variable | - reference to the variable |
MAX_VARIABLES
. The default is 5.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
.
number | - function number used for identification |
*function | - pointer to the function |
MAX_FUNCTIONS
. The default is 8.bool LiquidLine::set_asGlyph | ( | uint8_t | number | ) |
Converts a byte variable into a glyph index.
If a custom character (glyph) was created using DisplayClass::createChar(byte index, byte character[8])
it can be displayed as a normal variable using this method.
number | - the variable number that will be converted to an index |
byte
. bool LiquidLine::set_asProgmem | ( | uint8_t | number | ) |
Converts a const char pointer variable into const char pointer PROGMEM one.
Use this function to tell the object that the attached const char pointer variable is saved in flash memory rather than in RAM like a normal variable.
number | - the variable number that will be converted |
const char[]
. void LiquidLine::set_decimalPlaces | ( | uint8_t | decimalPlaces | ) |
Sets the decimal places for floating point variables.
decimalPlaces | - number of decimal places to show |
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.
position | - LEFT , RIGHT or CUSTOM |
column | - if using CUSTOM this specifies the column |
row | - if using CUSTOM this specifies the row |
Position
is enum class. Use Position::(member)
when specifying the position.