LiquidMenu  1.6.0
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu.h
Go to the documentation of this file.
1 /*
2 The MIT License (MIT)
3 
4 Copyright (c) 2016 Vasil Kalchev
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
38 #pragma once
39 
40 #include <stdint.h>
41 #if defined(__AVR__)
42 # include <avr/pgmspace.h>
43 #endif
44 #include <stdio.h>
45 #include <stdlib.h>
46 
47 #include "LiquidMenu_config.h"
48 #include "LiquidMenu_debug.h"
49 
50 
51 #if LIQUIDMENU_LIBRARY == LiquidCrystal_LIBRARY
52 # pragma message ("LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.")
53 #include <LiquidCrystal.h>
54 #elif LIQUIDMENU_LIBRARY == LiquidCrystal_I2C_LIBRARY
55 # pragma message ("LiquidMenu: Selected 'LiquidCrystal_I2C' (I2C) library. Edit 'LiquidMenu_config.h' file to change it.")
56 #include <LiquidCrystal_I2C.h>
57 #else
58 # pragma message ("LiquidMenu: Selected custom library. Edit 'LiquidMenu_config.h' file to change it.")
59 #endif
60 
61 #if LIQUIDMENU_DEBUG
62 # warning "LiquidMenu: Debugging messages are enabled."
63 #endif
64 
65 const char LIQUIDMENU_VERSION[] = "1.6";
66 
67 
68 
70 
73 typedef bool (*boolFnPtr)();
77 typedef int8_t (*int8tFnPtr)();
79 typedef uint8_t (*uint8tFnPtr)();
81 typedef int16_t (*int16tFnPtr)();
83 typedef uint16_t (*uint16tFnPtr)();
85 typedef int32_t (*int32tFnPtr)();
87 typedef uint32_t (*uint32tFnPtr)();
89 typedef float (*floatFnPtr)();
91 typedef double (*doubleFnPtr)();
93 typedef char (*charFnPtr)();
95 typedef char * (*charPtrFnPtr)();
97 typedef const char * (*constcharPtrFnPtr)();
99 
100 
102 
105 enum class DataType : uint8_t {
106  NOT_USED = 0,
107  BOOL = 1, BOOLEAN = 1,
108  INT8_T = 8,
109  UINT8_T = 9,
110  INT16_T = 16,
111  UINT16_T = 17,
112  INT32_T = 32,
113  UINT32_T = 33,
114  FLOAT = 50, DOUBLE = 50,
115  CHAR = 60,
116  CHAR_PTR = 61,
117  CONST_CHAR_PTR = 62,
118  PROG_CONST_CHAR_PTR = 65,
119  GLYPH = 70,
120  FIRST_GETTER = 200,
121  BOOL_GETTER = 201, BOOLEAN_GETTER = 201,
122  INT8_T_GETTER = 208,
123  UINT8_T_GETTER = 209, BYTE_GETTER = 209,
124  INT16_T_GETTER = 216,
125  UINT16_T_GETTER = 217,
126  INT32_T_GETTER = 232,
127  UINT32_T_GETTER = 233,
128  FLOAT_GETTER = 240, DOUBLE_GETTER = 240,
129  CHAR_GETTER = 250,
130  CHAR_PTR_GETTER = 251,
131  CONST_CHAR_PTR_GETTER = 252
132 };
133 
135 /*
136 Used to store and set the relative or absolute position of the focus indicator.
137 */
138 enum class Position : uint8_t {
139  RIGHT = 1, NORMAL = 1,
140  LEFT = 2,
141  CUSTOM = 3,
142 };
143 
145 
149 
155 DataType recognizeType(bool variable);
156 
161 DataType recognizeType(char variable);
162 
167 DataType recognizeType(char* variable);
168 
173 DataType recognizeType(const char* variable);
174 
179 DataType recognizeType(int8_t variable);
180 
185 DataType recognizeType(uint8_t variable);
186 
191 DataType recognizeType(int16_t variable);
192 
197 DataType recognizeType(uint16_t variable);
198 
203 DataType recognizeType(int32_t variable);
204 
209 DataType recognizeType(uint32_t variable);
210 
215 DataType recognizeType(float variable);
216 
221 DataType recognizeType(double variable);
222 
223 
229 
230 
236 
237 
243 
244 
250 
251 
257 
258 
264 
265 
271 
272 
278 
284 
285 
291 
292 
298 
299 
306 
307 
308 
310 
315 void print_me(uintptr_t address);
316 
317 
319 
326 class LiquidLine {
327  friend class LiquidScreen;
328 
329 public:
332 
334 
340  LiquidLine(uint8_t column, uint8_t row)
341  : _row(row), _column(column), _focusRow(row - 1),
342  _focusColumn(column - 1), _focusPosition(Position::NORMAL),
343  _floatDecimalPlaces(2), _variableCount(0), _focusable(false) {
344 
345  for (uint8_t i = 0; i < MAX_VARIABLES; i++) {
346  _variable[i] = nullptr;
347  _variableType[i] = DataType::NOT_USED;
348  }
349 
350  for (uint8_t f = 0; f < MAX_FUNCTIONS; f++) {
351  _function[f] = 0;
352  }
353  }
354 
356 
361  template <typename A>
362  LiquidLine(uint8_t column, uint8_t row, A &variableA)
363  : LiquidLine(column, row) {
364  add_variable(variableA);
365  }
366 
368 
374  template <typename A, typename B>
375  LiquidLine(uint8_t column, uint8_t row,
376  A &variableA, B &variableB)
377  : LiquidLine(column, row, variableA) {
378  add_variable(variableB);
379  }
380 
382 
389  template <typename A, typename B, typename C>
390  LiquidLine(uint8_t column, uint8_t row,
391  A &variableA, B &variableB, C &variableC)
392  : LiquidLine(column, row, variableA, variableB) {
393  add_variable(variableC);
394  }
395 
397 
405  template <typename A, typename B, typename C, typename D>
406  LiquidLine(uint8_t column, uint8_t row,
407  A &variableA, B &variableB, C &variableC, D &variableD)
408  : LiquidLine(column, row, variableA, variableB, variableC) {
409  add_variable(variableD);
410  }
411 
413 
414 
417 
419 
430  template <typename T>
431  bool add_variable(T &variable) {
432  DEBUG(F("LLine ")); print_me(reinterpret_cast<uintptr_t>(this));
433 
434  DataType varType = recognizeType(variable);
435 
436  #if LIQUIDMENU_DEBUG
437  DEBUG(F("Add "));
438  if ((uint8_t)varType < (uint8_t)DataType::FIRST_GETTER) {
439  DEBUG(F("variable \""));
440  DEBUG(variable);
441  } else {
442  DEBUG(F("getter \"N/A"));
443  }
444  DEBUG(F("\" of DataType("));
445  DEBUG((uint8_t)varType); DEBUG(F(")"));
446  #endif
447 
448  if (_variableCount < MAX_VARIABLES) {
449  _variable[_variableCount] = (void*)&variable;
450  _variableType[_variableCount] = varType;
451  _variableCount++;
452 
453  DEBUGLN(F(""));
454  return true;
455  } else {
456  DEBUGLN(F(" failed, edit LiquidMenu_config.h to allow for more variables"));
457  return false;
458  }
459  }
460 
462 
480  bool attach_function(uint8_t number, void (*function)(void));
481 
483 
487  void set_decimalPlaces(uint8_t decimalPlaces);
488 
490 
506  bool set_focusPosition(Position position,
507  uint8_t column = 0, uint8_t row = 0);
508 
510 
519  bool set_asGlyph(uint8_t number);
520 
522 
530  bool set_asProgmem(uint8_t number);
532 
533 private:
535 
543  void print(DisplayClass *p_liquidCrystal, bool isFocused);
544 
546 
553  void print_variable(DisplayClass *p_liquidCrystal, uint8_t number);
554 
556 
564  bool is_callable(uint8_t number) const;
565 
567 
575  bool call_function(uint8_t number) const;
576 
577  uint8_t _row, _column, _focusRow, _focusColumn;
578  Position _focusPosition;
579  uint8_t _floatDecimalPlaces;
580  uint8_t _variableCount;
581  void (*_function[MAX_FUNCTIONS])(void);
582  const void *_variable[MAX_VARIABLES];
583  DataType _variableType[MAX_VARIABLES];
584  bool _focusable;
585 };
586 
587 
589 
598  friend class LiquidMenu;
599 
600 public:
601 
604 
606 
609  LiquidScreen();
610 
612 
615  explicit LiquidScreen(LiquidLine &liquidLine);
616 
618 
622  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2);
623 
625 
630  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
631  LiquidLine &liquidLine3);
632 
634 
640  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
641  LiquidLine &liquidLine3, LiquidLine &liquidLine4);
642 
644 
647 
649 
660  bool add_line(LiquidLine &liquidLine);
661 
663 
677  bool set_focusPosition(Position position);
678 
680 
690  void set_displayLineCount(uint8_t lineCount);
691 
693 
704  void hide(bool hide);
706 
707 private:
709 
715  void print(DisplayClass *p_liquidCrystal) const;
716 
718 
728  void switch_focus(bool forward = true);
729 
731 
735  bool set_focusedLine(uint8_t lineIndex);
736 
738 
741  uint8_t get_focusedLine() const;
742 
744 
752  bool is_callable(uint8_t number) const;
753 
755 
765  bool call_function(uint8_t number) const;
766 
767  LiquidLine *_p_liquidLine[MAX_LINES];
768  uint8_t _lineCount;
769  uint8_t _focus;
770  uint8_t _displayLineCount;
771  bool _hidden;
772 };
773 
774 
776 
785 class LiquidMenu {
786  friend class LiquidSystem;
787 
788 public:
789 
792 
794 
801  LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen = 1);
802 
804 
810  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen,
811  uint8_t startingScreen = 1);
812 
814 
821  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
822  LiquidScreen &liquidScreen2, uint8_t startingScreen = 1);
823 
825 
833  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
834  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
835  uint8_t startingScreen = 1);
836 
838 
847  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
848  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
849  LiquidScreen &liquidScreen4, uint8_t startingScreen = 1);
850 
852 
855 
857 
868  bool add_screen(LiquidScreen &liquidScreen);
869 
871 
877 
879  void next_screen();
880 
882 
885  void operator++();
886 
888 
891  void operator++(int);
892 
894  void previous_screen();
895 
897 
900  void operator--();
901 
903 
906  void operator--(int);
907 
909 
913  bool change_screen(LiquidScreen *p_liquidScreen);
914 
916 
921  bool change_screen(uint8_t number);
922 
924 
928  bool operator=(LiquidScreen *p_liquidScreen);
929 
931 
936  bool operator=(uint8_t number);
937 
939 
945  void switch_focus(bool forward = true);
946 
948 
952  bool set_focusedLine(uint8_t lineIndex);
953 
955 
958  uint8_t get_focusedLine() const;
959 
961 
975  bool set_focusPosition(Position position);
976 
978 
991  bool set_focusSymbol(Position position, uint8_t symbol[8]);
992 
994 
1002  bool is_callable(uint8_t number) const;
1003 
1005 
1017  bool call_function(uint8_t number, bool refresh = true) const;
1018 
1020 
1023  void update() const;
1024 
1026 
1032  void softUpdate() const;
1033 
1035 
1040  void init() const;
1041 
1043 
1044 private:
1045  DisplayClass *_p_liquidCrystal;
1046  LiquidScreen *_p_liquidScreen[MAX_SCREENS];
1047  uint8_t _screenCount;
1048  uint8_t _currentScreen;
1049 };
1050 
1051 
1053 
1064 public:
1065 
1068 
1070 
1075  explicit LiquidSystem(uint8_t startingMenu = 1);
1076 
1078 
1083  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1084  uint8_t startingMenu = 1);
1085 
1087 
1093  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1094  LiquidMenu &liquidMenu3, uint8_t startingMenu = 1);
1095 
1097 
1104  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1105  LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4,
1106  uint8_t startingMenu = 1);
1107 
1109 
1112 
1114 
1125  bool add_menu(LiquidMenu &liquidMenu);
1126 
1128 
1132  bool change_menu(LiquidMenu &p_liquidMenu);
1133 
1135 
1141 
1143  void next_screen();
1144 
1146 
1149  void operator++();
1150 
1152 
1155  void operator++(int);
1156 
1158  void previous_screen();
1159 
1161 
1164  void operator--();
1165 
1167 
1170  void operator--(int);
1171 
1173 
1177  bool change_screen(LiquidScreen *p_liquidScreen);
1178 
1180 
1185  bool change_screen(uint8_t number);
1186 
1188 
1192  bool operator=(LiquidScreen *p_liquidScreen);
1193 
1195 
1200  bool operator=(uint8_t number);
1201 
1203 
1209  void switch_focus(bool forward = true);
1210 
1212 
1216  bool set_focusedLine(uint8_t lineIndex);
1217 
1219 
1222  uint8_t get_focusedLine() const;
1223 
1225 
1239  bool set_focusPosition(Position position);
1240 
1242 
1255  bool set_focusSymbol(Position position, uint8_t symbol[8]);
1256 
1258 
1266  bool is_callable(uint8_t number) const;
1267 
1269 
1281  bool call_function(uint8_t number, bool refresh = true) const;
1282 
1284 
1287  void update() const;
1288 
1290 
1296  void softUpdate() const;
1297 
1299 
1300 private:
1301  LiquidMenu *_p_liquidMenu[MAX_MENUS];
1302  uint8_t _menuCount;
1303  uint8_t _currentMenu;
1304 };
MAX_LINES
const uint8_t MAX_LINES
Configures the number of available lines per screen.
Definition: LiquidMenu_config.h:69
LiquidMenu::init
void init() const
Initializes the menu object.
Definition: LiquidMenu.cpp:281
int8tFnPtr
int8_t(* int8tFnPtr)()
int8_t
Definition: LiquidMenu.h:77
LiquidMenu::is_callable
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidMenu.cpp:235
LiquidSystem::previous_screen
void previous_screen()
Switches to the previous screen.
Definition: LiquidSystem.cpp:108
LiquidSystem::call_function
bool call_function(uint8_t number, bool refresh=true) const
Calls an attached function specified by the number.
Definition: LiquidSystem.cpp:166
LiquidSystem::next_screen
void next_screen()
Switches to the next screen.
Definition: LiquidSystem.cpp:96
LiquidSystem::update
void update() const
Prints the current screen to the display.
Definition: LiquidSystem.cpp:171
LiquidSystem::operator=
bool operator=(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:132
LiquidLine::set_asGlyph
bool set_asGlyph(uint8_t number)
Converts a byte variable into a glyph index.
Definition: LiquidLine.cpp:75
LiquidSystem::get_currentScreen
LiquidScreen * get_currentScreen() const
Returns a reference to the current screen.
Definition: LiquidSystem.cpp:92
LIQUIDMENU_VERSION
const char LIQUIDMENU_VERSION[]
The version of the library.
Definition: LiquidMenu.h:65
LiquidMenu::switch_focus
void switch_focus(bool forward=true)
Switches the focus.
Definition: LiquidMenu.cpp:177
recognizeType
DataType recognizeType(bool variable)
Definition: recognizeType.cpp:9
LiquidScreen::LiquidScreen
LiquidScreen()
The main constructor.
Definition: LiquidScreen.cpp:50
DisplayClass
#define DisplayClass
Name of wrapped library's class.
Definition: LiquidMenu_config.h:31
LiquidScreen::hide
void hide(bool hide)
Hides the screen.
Definition: LiquidScreen.cpp:124
LiquidLine
Represents the individual lines printed on the display.
Definition: LiquidMenu.h:326
constcharPtrFnPtr
const typedef char *(* constcharPtrFnPtr)()
const char*
Definition: LiquidMenu.h:97
LiquidLine::set_decimalPlaces
void set_decimalPlaces(uint8_t decimalPlaces)
Sets the decimal places for floating point variables.
Definition: LiquidLine.cpp:50
LiquidSystem::add_menu
bool add_menu(LiquidMenu &liquidMenu)
Adds a LiquidMenu object to the menu system.
Definition: LiquidSystem.cpp:58
MAX_FUNCTIONS
const uint8_t MAX_FUNCTIONS
Configures the number of available functions per line.
Definition: LiquidMenu_config.h:66
MAX_VARIABLES
const uint8_t MAX_VARIABLES
Configures the number of available variables per line.
Definition: LiquidMenu_config.h:63
charPtrFnPtr
char *(* charPtrFnPtr)()
char*
Definition: LiquidMenu.h:95
LiquidSystem::switch_focus
void switch_focus(bool forward=true)
Switches the focus.
Definition: LiquidSystem.cpp:136
Position
Position
Position enum.
Definition: LiquidMenu.h:138
LiquidMenu::previous_screen
void previous_screen()
Switches to the previous screen.
Definition: LiquidMenu.cpp:115
DataType
DataType
Data type enum.
Definition: LiquidMenu.h:105
DEBUG
#define DEBUG(x)
Debug print.
Definition: LiquidMenu_debug.h:23
LiquidMenu::set_focusedLine
bool set_focusedLine(uint8_t lineIndex)
Directly select focused line.
Definition: LiquidMenu.cpp:183
LiquidSystem
Represents a collection of menus forming a menu system.
Definition: LiquidMenu.h:1063
DIVISION_LINE_LENGTH
const uint8_t DIVISION_LINE_LENGTH
Sets the length of the division line.
Definition: LiquidMenu.cpp:39
LiquidMenu::add_screen
bool add_screen(LiquidScreen &liquidScreen)
Adds a LiquidScreen object to the menu.
Definition: LiquidMenu.cpp:73
int16tFnPtr
int16_t(* int16tFnPtr)()
int16_t
Definition: LiquidMenu.h:81
print_me
void print_me(uintptr_t address)
Debug prints an address.
Definition: LiquidMenu.cpp:34
print_me
void print_me(uintptr_t address)
Debug prints an address.
Definition: LiquidMenu.cpp:34
LiquidMenu::call_function
bool call_function(uint8_t number, bool refresh=true) const
Calls an attached function specified by the number.
Definition: LiquidMenu.cpp:239
DEBUGLN2
#define DEBUGLN2(x, y)
Debug print two parameters with newline.
Definition: LiquidMenu_debug.h:29
LiquidSystem::LiquidSystem
LiquidSystem(uint8_t startingMenu=1)
The main constructor.
Definition: LiquidSystem.cpp:32
LiquidMenu_debug.h
boolFnPtr
bool(* boolFnPtr)()
Definition: LiquidMenu.h:75
glyphs.h
LiquidMenu::change_screen
bool change_screen(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:151
LiquidMenu.h
LiquidMenu_config.h
LiquidSystem::set_focusedLine
bool set_focusedLine(uint8_t lineIndex)
Directly select focused line.
Definition: LiquidSystem.cpp:140
LiquidMenu::LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen=1)
The main constructor.
Definition: LiquidMenu.cpp:41
LiquidScreen::set_focusPosition
bool set_focusPosition(Position position)
Sets the focus position for the whole screen at once.
Definition: LiquidScreen.cpp:105
LiquidLine::LiquidLine
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC)
Constructor for three variables/constants.
Definition: LiquidMenu.h:390
LiquidLine::attach_function
bool attach_function(uint8_t number, void(*function)(void))
Attaches a callback function to the line.
Definition: LiquidLine.cpp:33
LiquidMenu::operator++
void operator++()
Switches to the next screen.
Definition: LiquidMenu.cpp:107
LiquidSystem::set_focusSymbol
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator's symbol.
Definition: LiquidSystem.cpp:155
MAX_SCREENS
const uint8_t MAX_SCREENS
Configures the number of available screens per menu.
Definition: LiquidMenu_config.h:72
LiquidScreen
Represents a screen shown on the display.
Definition: LiquidMenu.h:597
LiquidMenu::softUpdate
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidMenu.cpp:252
LiquidMenu::set_focusSymbol
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator's symbol.
Definition: LiquidMenu.cpp:206
charFnPtr
char(* charFnPtr)()
char
Definition: LiquidMenu.h:93
MAX_MENUS
const uint8_t MAX_MENUS
Configures the number of available menus per menus system.
Definition: LiquidMenu_config.h:75
LiquidMenu::set_focusPosition
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidMenu.cpp:191
doubleFnPtr
double(* doubleFnPtr)()
double
Definition: LiquidMenu.h:91
int32tFnPtr
int32_t(* int32tFnPtr)()
int32_t
Definition: LiquidMenu.h:85
LiquidSystem::operator++
void operator++()
Switches to the next screen.
Definition: LiquidSystem.cpp:100
LiquidMenu
Represents a collection of screens forming a menu.
Definition: LiquidMenu.h:785
LiquidMenu::operator=
bool operator=(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:173
LiquidSystem::operator--
void operator--()
Switches to the previous screen.
Definition: LiquidSystem.cpp:112
floatFnPtr
float(* floatFnPtr)()
float
Definition: LiquidMenu.h:89
LiquidMenu::operator--
void operator--()
Switches to the previous screen.
Definition: LiquidMenu.cpp:128
uint8tFnPtr
uint8_t(* uint8tFnPtr)()
uint8_t
Definition: LiquidMenu.h:79
LiquidLine::LiquidLine
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB)
Constructor for two variables/constants.
Definition: LiquidMenu.h:375
LiquidLine::set_asProgmem
bool set_asProgmem(uint8_t number)
Converts a const char pointer variable into const char pointer PROGMEM one.
Definition: LiquidLine.cpp:87
LiquidSystem::get_focusedLine
uint8_t get_focusedLine() const
Get the index of the currently focused line.
Definition: LiquidSystem.cpp:144
LiquidMenu::get_currentScreen
LiquidScreen * get_currentScreen() const
Returns a reference to the current screen.
Definition: LiquidMenu.cpp:90
LiquidMenu::update
void update() const
Prints the current screen to the display.
Definition: LiquidMenu.cpp:247
LiquidLine::add_variable
bool add_variable(T &variable)
Adds a variable to the line.
Definition: LiquidMenu.h:431
LiquidScreen::set_displayLineCount
void set_displayLineCount(uint8_t lineCount)
Specifies the line size of the display (required for scrolling).
Definition: LiquidScreen.cpp:120
uint16tFnPtr
uint16_t(* uint16tFnPtr)()
uint16_t
Definition: LiquidMenu.h:83
LiquidLine::LiquidLine
LiquidLine(uint8_t column, uint8_t row, A &variableA)
Constructor for one variable/constant.
Definition: LiquidMenu.h:362
LiquidScreen::add_line
bool add_line(LiquidLine &liquidLine)
Adds a LiquidLine object to the screen.
Definition: LiquidScreen.cpp:75
LiquidSystem::change_screen
bool change_screen(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:124
LiquidSystem::change_menu
bool change_menu(LiquidMenu &p_liquidMenu)
Switches to the specified menu.
Definition: LiquidSystem.cpp:76
uint32tFnPtr
uint32_t(* uint32tFnPtr)()
uint32_t
Definition: LiquidMenu.h:87
DEBUGLN
#define DEBUGLN(x)
Debug print with newline.
Definition: LiquidMenu_debug.h:25
LiquidLine::LiquidLine
LiquidLine(uint8_t column, uint8_t row)
The main constructor.
Definition: LiquidMenu.h:340
LiquidLine::LiquidLine
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC, D &variableD)
Constructor for four variables/constants.
Definition: LiquidMenu.h:406
DEBUG2
#define DEBUG2(x, y)
Debug print two parameters.
Definition: LiquidMenu_debug.h:27
LiquidSystem::is_callable
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidSystem.cpp:162
LiquidMenu::get_focusedLine
uint8_t get_focusedLine() const
Get the index of the currently focused line.
Definition: LiquidMenu.cpp:187
LiquidLine::set_focusPosition
bool set_focusPosition(Position position, uint8_t column=0, uint8_t row=0)
Configures the focus indicator position for the line.
Definition: LiquidLine.cpp:54
LiquidSystem::softUpdate
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidSystem.cpp:175
LiquidSystem::set_focusPosition
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidSystem.cpp:148
LiquidMenu::next_screen
void next_screen()
Switches to the next screen.
Definition: LiquidMenu.cpp:94