diff --git a/README.md b/README.md index 1f9067c..fe68a8d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ *Menu creation Arduino library for LCDs, wraps [LiquidCrystal][lc].* -[![Download](https://img.shields.io/badge/download-1.4.1-blue.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/VaSe7u/LiquidMenu/archive/v1.4.1.zip) +[![Download](https://img.shields.io/badge/download-1.5.1-blue.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/VaSe7u/LiquidMenu/archive/v1.5.1.zip) [![Build Status](https://travis-ci.org/VaSe7u/LiquidMenu.svg?branch=master)](https://travis-ci.org/VaSe7u/LiquidMenu) [![documentation](https://img.shields.io/badge/docs-doxygen-orange.svg)](https://VaSe7u.github.io/LiquidMenu/doc/Doxygen/html/annotated.html) [![license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://opensource.org/licenses/mit-license.php) diff --git a/doc/Doxygen/Doxyfile b/doc/Doxygen/Doxyfile index 3ad18b9..f1a632d 100644 --- a/doc/Doxygen/Doxyfile +++ b/doc/Doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = LiquidMenu # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.4.1 +PROJECT_NUMBER = 1.5.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -51,7 +51,7 @@ PROJECT_BRIEF = "Menu creation Arduino library for LCDs, wraps LiquidCr # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = D:/Projects/Workspaces/Arduino/libraries/LiquidMenu/doc/Images/logo_small.png +PROJECT_LOGO = C:/Projects/Workspaces/Arduino/libraries/LiquidMenu/doc/Images/logo_small.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is diff --git a/doc/Doxygen/html/_liquid_line_8cpp.html b/doc/Doxygen/html/_liquid_line_8cpp.html index e49b954..5610d50 100644 --- a/doc/Doxygen/html/_liquid_line_8cpp.html +++ b/doc/Doxygen/html/_liquid_line_8cpp.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/_liquid_menu_8cpp.html b/doc/Doxygen/html/_liquid_menu_8cpp.html index 952eb2b..0536bd9 100644 --- a/doc/Doxygen/html/_liquid_menu_8cpp.html +++ b/doc/Doxygen/html/_liquid_menu_8cpp.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/_liquid_menu_8h.html b/doc/Doxygen/html/_liquid_menu_8h.html index c158c7f..e1a6713 100644 --- a/doc/Doxygen/html/_liquid_menu_8h.html +++ b/doc/Doxygen/html/_liquid_menu_8h.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/_liquid_menu_8h_source.html b/doc/Doxygen/html/_liquid_menu_8h_source.html index 5f10eb0..918d6ed 100644 --- a/doc/Doxygen/html/_liquid_menu_8h_source.html +++ b/doc/Doxygen/html/_liquid_menu_8h_source.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
@@ -72,16 +72,19 @@
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 
40 #pragma once
41 
42 #include <stdint.h>
43 #if defined(__AVR__)
44 # include <avr/pgmspace.h>
45 #endif
46 #include <stdio.h>
47 #include <stdlib.h>
48 
49 #include "LiquidMenu_config.h"
50 #include "LiquidMenu_debug.h"
51 
52 
53 #if LIQUIDMENU_LIBRARY == LiquidCrystal_LIBRARY
54 # pragma message ("LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.")
55 #elif LIQUIDMENU_LIBRARY == LiquidCrystal_I2C_LIBRARY
56 # pragma message ("LiquidMenu: Selected 'LiquidCrystal_I2C' (I2C) library. Edit 'LiquidMenu_config.h' file to change it.")
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 
66 typedef bool (*boolFnPtr)();
67 typedef int8_t (*int8tFnPtr)();
68 typedef uint8_t (*uint8tFnPtr)();
69 typedef int16_t (*int16tFnPtr)();
70 typedef uint16_t (*uint16tFnPtr)();
71 typedef int32_t (*int32tFnPtr)();
72 typedef uint32_t (*uint32tFnPtr)();
73 typedef float (*floatFnPtr)();
74 typedef double (*doubleFnPtr)();
75 typedef char (*charFnPtr)();
76 typedef char * (*charPtrFnPtr)();
77 typedef const char * (*constcharPtrFnPtr)();
78 
79 const char LIQUIDMENU_VERSION[] = "1.5";
80 
82 
85 enum class DataType : uint8_t {
86  NOT_USED = 0,
87  BOOL = 1, BOOLEAN = 1,
88  INT8_T = 8,
89  UINT8_T = 9,
90  INT16_T = 16,
91  UINT16_T = 17,
92  INT32_T = 32,
93  UINT32_T = 33,
94  FLOAT = 50, DOUBLE = 50,
95  CHAR = 60,
96  CHAR_PTR = 61,
97  CONST_CHAR_PTR = 62,
98  PROG_CONST_CHAR_PTR = 65,
99  GLYPH = 70,
100  BOOL_GETTER = 201, BOOLEAN_GETTER = 201,
101  INT8_T_GETTER = 208,
102  UINT8_T_GETTER = 209, BYTE_GETTER = 209,
103  INT16_T_GETTER = 216,
104  UINT16_T_GETTER = 217,
105  INT32_T_GETTER = 232,
106  UINT32_T_GETTER = 233,
107  FLOAT_GETTER = 240, DOUBLE_GETTER = 240,
108  CHAR_GETTER = 250,
109  CHAR_PTR_GETTER = 251,
110  CONST_CHAR_PTR_GETTER = 252
111 };
112 
114 /*
115 Used to store and set the relative or absolute position of the focus indicator.
116 */
117 enum class Position : uint8_t {
118  RIGHT = 1, NORMAL = 1,
119  LEFT = 2,
120  CUSTOM = 3,
121 };
122 
124 
128 
134 DataType recognizeType(bool variable);
135 
140 DataType recognizeType(char variable);
141 
146 DataType recognizeType(char* variable);
147 
152 DataType recognizeType(const char* variable);
153 
158 DataType recognizeType(int8_t variable);
159 
164 DataType recognizeType(uint8_t variable);
165 
170 DataType recognizeType(int16_t variable);
171 
176 DataType recognizeType(uint16_t variable);
177 
182 DataType recognizeType(int32_t variable);
183 
188 DataType recognizeType(uint32_t variable);
189 
194 DataType recognizeType(float variable);
195 
200 DataType recognizeType(double variable);
201 
202 
207 DataType recognizeType(boolFnPtr variable);
208 
209 
214 DataType recognizeType(int8tFnPtr variable);
215 
216 
221 DataType recognizeType(uint8tFnPtr variable);
222 
223 
228 DataType recognizeType(int16tFnPtr variable);
229 
230 
235 DataType recognizeType(uint16tFnPtr variable);
236 
237 
242 DataType recognizeType(int32tFnPtr variable);
243 
244 
249 DataType recognizeType(uint32tFnPtr varible);
250 
251 
256 DataType recognizeType(floatFnPtr variable);
257 
262 DataType recognizeType(doubleFnPtr variable);
263 
264 
269 DataType recognizeType(charFnPtr variable);
270 
271 
276 DataType recognizeType(charPtrFnPtr variable);
277 
278 
283 DataType recognizeType(constcharPtrFnPtr variable);
285 
286 
287 
289 
294 void print_me(uintptr_t address);
295 
296 
298 
305 class LiquidLine {
306  friend class LiquidScreen;
307 
308 public:
311 
313 
319  LiquidLine(uint8_t column, uint8_t row)
320  : _row(row), _column(column), _focusRow(row - 1),
321  _focusColumn(column - 1), _focusPosition(Position::NORMAL),
322  _variableCount(0), _focusable(false) {
323  for (uint8_t i = 0; i < MAX_VARIABLES; i++) {
324  _variable[i] = nullptr;
325  _variableType[i] = DataType::NOT_USED;
326  }
327  for (uint8_t f = 0; f < MAX_FUNCTIONS; f++) {
328  _function[f] = 0;
329  }
330  _floatDecimalPlaces = 2;
331  }
332 
334 
339  template <typename A>
340  LiquidLine(uint8_t column, uint8_t row, A &variableA)
341  : LiquidLine(column, row) {
342  add_variable(variableA);
343  }
344 
346 
352  template <typename A, typename B>
353  LiquidLine(uint8_t column, uint8_t row,
354  A &variableA, B &variableB)
355  : LiquidLine(column, row, variableA) {
356  add_variable(variableB);
357  }
358 
360 
367  template <typename A, typename B, typename C>
368  LiquidLine(uint8_t column, uint8_t row,
369  A &variableA, B &variableB, C &variableC)
370  : LiquidLine(column, row, variableA, variableB) {
371  add_variable(variableC);
372  }
373 
375 
383  template <typename A, typename B, typename C, typename D>
384  LiquidLine(uint8_t column, uint8_t row,
385  A &variableA, B &variableB, C &variableC, D &variableD)
386  : LiquidLine(column, row, variableA, variableB, variableC) {
387  add_variable(variableD);
388  }
389 
391 
392 
395 
397 
408  template <typename T>
409  bool add_variable(T &variable) {
410  print_me(reinterpret_cast<uintptr_t>(this));
411  if (_variableCount < MAX_VARIABLES) {
412  _variable[_variableCount] = (void*)&variable;
413  _variableType[_variableCount] = recognizeType(variable);
414 # if LIQUIDMENU_DEBUG
415  DEBUG(F("Added variable "));
416  // Check if the variable is actually a getter functions
417  // and don't diplay it if so.
418  if ((uint8_t)_variableType[_variableCount] < 200) { // 200+ are getters
419  DEBUG(reinterpret_cast<uintptr_t>(variable)); DEBUGLN(F(""));
420  }
421 # endif
422  _variableCount++;
423  return true;
424  }
425 # if LIQUIDMENU_DEBUG
426  DEBUG(F("Adding variable "));
427  // Check if the variable is actually a getter functions
428  // and don't diplay it if so.
429  if ((uint8_t)_variableType[_variableCount] < 200) { // 200+ are getters
430  DEBUG(reinterpret_cast<uintptr_t>(variable));
431  }
432 # endif
433  DEBUGLN(F(" failed, edit LiquidMenu_config.h to allow for more variables"));
434  return false;
435  }
436 
438 
456  bool attach_function(uint8_t number, void (*function)(void));
457 
459 
463  void set_decimalPlaces(uint8_t decimalPlaces);
464 
466 
482  bool set_focusPosition(Position position,
483  uint8_t column = 0, uint8_t row = 0);
484 
486 
495  bool set_asGlyph(uint8_t number);
496 
498 
506  bool set_asProgmem(uint8_t number);
508 
509 private:
511 
519  void print(DisplayClass *p_liquidCrystal, bool isFocused);
520 
522 
529  void print_variable(DisplayClass *p_liquidCrystal, uint8_t number);
530 
532 
540  bool is_callable(uint8_t number) const;
541 
543 
551  bool call_function(uint8_t number) const;
552 
553  uint8_t _row, _column, _focusRow, _focusColumn;
554  Position _focusPosition;
555  uint8_t _floatDecimalPlaces;
556  uint8_t _variableCount;
557  void (*_function[MAX_FUNCTIONS])(void);
558  const void *_variable[MAX_VARIABLES];
559  DataType _variableType[MAX_VARIABLES];
560  bool _focusable;
561 };
562 
563 
565 
574  friend class LiquidMenu;
575 
576 public:
577 
580 
582 
585  LiquidScreen();
586 
588 
591  explicit LiquidScreen(LiquidLine &liquidLine);
592 
594 
598  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2);
599 
601 
606  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
607  LiquidLine &liquidLine3);
608 
610 
616  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
617  LiquidLine &liquidLine3, LiquidLine &liquidLine4);
618 
620 
623 
625 
636  bool add_line(LiquidLine &liquidLine);
637 
639 
653  bool set_focusPosition(Position position);
654 
656 
666  void set_displayLineCount(uint8_t lineCount);
667 
669 
680  void hide(bool hide);
682 
683 private:
685 
691  void print(DisplayClass *p_liquidCrystal) const;
692 
694 
700  void switch_focus(bool forward = true);
701 
703 
711  bool is_callable(uint8_t number) const;
712 
714 
724  bool call_function(uint8_t number) const;
725 
726  LiquidLine *_p_liquidLine[MAX_LINES];
727  uint8_t _lineCount;
728  uint8_t _focus;
729  uint8_t _displayLineCount;
730  bool _hidden;
731 };
732 
733 
735 
744 class LiquidMenu {
745  friend class LiquidSystem;
746 
747 public:
748 
751 
753 
760  LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen = 1);
761 
763 
769  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen,
770  uint8_t startingScreen = 1);
771 
773 
780  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
781  LiquidScreen &liquidScreen2, uint8_t startingScreen = 1);
782 
784 
792  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
793  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
794  uint8_t startingScreen = 1);
795 
797 
806  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
807  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
808  LiquidScreen &liquidScreen4, uint8_t startingScreen = 1);
809 
811 
814 
816 
827  bool add_screen(LiquidScreen &liquidScreen);
828 
830 
836 
838  void next_screen();
839 
841 
844  void operator++();
845 
847 
850  void operator++(int);
851 
853  void previous_screen();
854 
856 
859  void operator--();
860 
862 
865  void operator--(int);
866 
868 
872  bool change_screen(LiquidScreen &p_liquidScreen);
873 
875 
880  bool change_screen(uint8_t number);
881 
883 
887  bool operator=(LiquidScreen &p_liquidScreen);
888 
890 
895  bool operator=(uint8_t number);
896 
898 
904  void switch_focus(bool forward = true);
905 
907 
921  bool set_focusPosition(Position position);
922 
924 
937  bool set_focusSymbol(Position position, uint8_t symbol[8]);
938 
940 
948  bool is_callable(uint8_t number) const;
949 
951 
962  bool call_function(uint8_t number) const;
963 
965 
968  void update() const;
969 
971 
977  void softUpdate() const;
978 
980 
985  void init() const;
986 
988 
989 private:
990  DisplayClass *_p_liquidCrystal;
991  LiquidScreen *_p_liquidScreen[MAX_SCREENS];
992  uint8_t _screenCount;
993  uint8_t _currentScreen;
994 };
995 
996 
998 
1009 public:
1010 
1013 
1015 
1020  explicit LiquidSystem(uint8_t startingMenu = 1);
1021 
1023 
1028  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1029  uint8_t startingMenu = 1);
1030 
1032 
1038  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1039  LiquidMenu &liquidMenu3, uint8_t startingMenu = 1);
1040 
1042 
1049  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1050  LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4,
1051  uint8_t startingMenu = 1);
1052 
1054 
1057 
1059 
1070  bool add_menu(LiquidMenu &liquidMenu);
1071 
1073 
1077  bool change_menu(LiquidMenu &p_liquidMenu);
1078 
1080 
1086 
1088  void next_screen();
1089 
1091 
1094  void operator++();
1095 
1097 
1100  void operator++(int);
1101 
1103  void previous_screen();
1104 
1106 
1109  void operator--();
1110 
1112 
1115  void operator--(int);
1116 
1118 
1122  bool change_screen(LiquidScreen &p_liquidScreen);
1123 
1125 
1130  bool change_screen(uint8_t number);
1131 
1133 
1137  bool operator=(LiquidScreen &p_liquidScreen);
1138 
1140 
1145  bool operator=(uint8_t number);
1146 
1148 
1154  void switch_focus(bool forward = true);
1155 
1157 
1171  bool set_focusPosition(Position position);
1172 
1174 
1187  bool set_focusSymbol(Position position, uint8_t symbol[8]);
1188 
1190 
1198  bool is_callable(uint8_t number) const;
1199 
1201 
1212  bool call_function(uint8_t number) const;
1213 
1215 
1218  void update() const;
1219 
1221 
1227  void softUpdate() const;
1228 
1230 
1231 private:
1232  LiquidMenu *_p_liquidMenu[MAX_MENUS];
1233  uint8_t _menuCount;
1234  uint8_t _currentMenu;
1235 };
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC)
Constructor for three variables/constants.
Definition: LiquidMenu.h:368
+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 
40 #pragma once
41 
42 #include <stdint.h>
43 #if defined(__AVR__)
44 # include <avr/pgmspace.h>
45 #endif
46 #include <stdio.h>
47 #include <stdlib.h>
48 
49 #include "LiquidMenu_config.h"
50 #include "LiquidMenu_debug.h"
51 
52 
53 #if LIQUIDMENU_LIBRARY == LiquidCrystal_LIBRARY
54 # pragma message ("LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.")
55 #elif LIQUIDMENU_LIBRARY == LiquidCrystal_I2C_LIBRARY
56 # pragma message ("LiquidMenu: Selected 'LiquidCrystal_I2C' (I2C) library. Edit 'LiquidMenu_config.h' file to change it.")
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 
66 typedef bool (*boolFnPtr)();
67 typedef int8_t (*int8tFnPtr)();
68 typedef uint8_t (*uint8tFnPtr)();
69 typedef int16_t (*int16tFnPtr)();
70 typedef uint16_t (*uint16tFnPtr)();
71 typedef int32_t (*int32tFnPtr)();
72 typedef uint32_t (*uint32tFnPtr)();
73 typedef float (*floatFnPtr)();
74 typedef double (*doubleFnPtr)();
75 typedef char (*charFnPtr)();
76 typedef char * (*charPtrFnPtr)();
77 typedef const char * (*constcharPtrFnPtr)();
78 
79 const char LIQUIDMENU_VERSION[] = "1.5";
80 
82 
85 enum class DataType : uint8_t {
86  NOT_USED = 0,
87  BOOL = 1, BOOLEAN = 1,
88  INT8_T = 8,
89  UINT8_T = 9,
90  INT16_T = 16,
91  UINT16_T = 17,
92  INT32_T = 32,
93  UINT32_T = 33,
94  FLOAT = 50, DOUBLE = 50,
95  CHAR = 60,
96  CHAR_PTR = 61,
97  CONST_CHAR_PTR = 62,
98  PROG_CONST_CHAR_PTR = 65,
99  GLYPH = 70,
100  BOOL_GETTER = 201, BOOLEAN_GETTER = 201,
101  INT8_T_GETTER = 208,
102  UINT8_T_GETTER = 209, BYTE_GETTER = 209,
103  INT16_T_GETTER = 216,
104  UINT16_T_GETTER = 217,
105  INT32_T_GETTER = 232,
106  UINT32_T_GETTER = 233,
107  FLOAT_GETTER = 240, DOUBLE_GETTER = 240,
108  CHAR_GETTER = 250,
109  CHAR_PTR_GETTER = 251,
110  CONST_CHAR_PTR_GETTER = 252
111 };
112 
114 /*
115 Used to store and set the relative or absolute position of the focus indicator.
116 */
117 enum class Position : uint8_t {
118  RIGHT = 1, NORMAL = 1,
119  LEFT = 2,
120  CUSTOM = 3,
121 };
122 
124 
128 
134 DataType recognizeType(bool variable);
135 
140 DataType recognizeType(char variable);
141 
146 DataType recognizeType(char* variable);
147 
152 DataType recognizeType(const char* variable);
153 
158 DataType recognizeType(int8_t variable);
159 
164 DataType recognizeType(uint8_t variable);
165 
170 DataType recognizeType(int16_t variable);
171 
176 DataType recognizeType(uint16_t variable);
177 
182 DataType recognizeType(int32_t variable);
183 
188 DataType recognizeType(uint32_t variable);
189 
194 DataType recognizeType(float variable);
195 
200 DataType recognizeType(double variable);
201 
202 
207 DataType recognizeType(boolFnPtr variable);
208 
209 
214 DataType recognizeType(int8tFnPtr variable);
215 
216 
221 DataType recognizeType(uint8tFnPtr variable);
222 
223 
228 DataType recognizeType(int16tFnPtr variable);
229 
230 
235 DataType recognizeType(uint16tFnPtr variable);
236 
237 
242 DataType recognizeType(int32tFnPtr variable);
243 
244 
249 DataType recognizeType(uint32tFnPtr varible);
250 
251 
256 DataType recognizeType(floatFnPtr variable);
257 
262 DataType recognizeType(doubleFnPtr variable);
263 
264 
269 DataType recognizeType(charFnPtr variable);
270 
271 
276 DataType recognizeType(charPtrFnPtr variable);
277 
278 
283 DataType recognizeType(constcharPtrFnPtr variable);
285 
286 
287 
289 
294 void print_me(uintptr_t address);
295 
296 
298 
305 class LiquidLine {
306  friend class LiquidScreen;
307 
308 public:
311 
313 
319  LiquidLine(uint8_t column, uint8_t row)
320  : _row(row), _column(column), _focusRow(row - 1),
321  _focusColumn(column - 1), _focusPosition(Position::NORMAL),
322  _variableCount(0), _focusable(false) {
323  for (uint8_t i = 0; i < MAX_VARIABLES; i++) {
324  _variable[i] = nullptr;
325  _variableType[i] = DataType::NOT_USED;
326  }
327  for (uint8_t f = 0; f < MAX_FUNCTIONS; f++) {
328  _function[f] = 0;
329  }
330  _floatDecimalPlaces = 2;
331  }
332 
334 
339  template <typename A>
340  LiquidLine(uint8_t column, uint8_t row, A &variableA)
341  : LiquidLine(column, row) {
342  add_variable(variableA);
343  }
344 
346 
352  template <typename A, typename B>
353  LiquidLine(uint8_t column, uint8_t row,
354  A &variableA, B &variableB)
355  : LiquidLine(column, row, variableA) {
356  add_variable(variableB);
357  }
358 
360 
367  template <typename A, typename B, typename C>
368  LiquidLine(uint8_t column, uint8_t row,
369  A &variableA, B &variableB, C &variableC)
370  : LiquidLine(column, row, variableA, variableB) {
371  add_variable(variableC);
372  }
373 
375 
383  template <typename A, typename B, typename C, typename D>
384  LiquidLine(uint8_t column, uint8_t row,
385  A &variableA, B &variableB, C &variableC, D &variableD)
386  : LiquidLine(column, row, variableA, variableB, variableC) {
387  add_variable(variableD);
388  }
389 
391 
392 
395 
397 
408  template <typename T>
409  bool add_variable(T &variable) {
410  print_me(reinterpret_cast<uintptr_t>(this));
411  if (_variableCount < MAX_VARIABLES) {
412  _variable[_variableCount] = (void*)&variable;
413  _variableType[_variableCount] = recognizeType(variable);
414 # if LIQUIDMENU_DEBUG
415  DEBUG(F("Added variable "));
416  // Check if the variable is actually a getter functions
417  // and don't diplay it if so.
418  if ((uint8_t)_variableType[_variableCount] < 200) { // 200+ are getters
419  DEBUG(reinterpret_cast<uintptr_t>(variable)); DEBUGLN(F(""));
420  }
421 # endif
422  _variableCount++;
423  return true;
424  }
425 # if LIQUIDMENU_DEBUG
426  DEBUG(F("Adding variable "));
427  // Check if the variable is actually a getter functions
428  // and don't diplay it if so.
429  if ((uint8_t)_variableType[_variableCount] < 200) { // 200+ are getters
430  DEBUG(reinterpret_cast<uintptr_t>(variable));
431  }
432 # endif
433  DEBUGLN(F(" failed, edit LiquidMenu_config.h to allow for more variables"));
434  return false;
435  }
436 
438 
456  bool attach_function(uint8_t number, void (*function)(void));
457 
459 
463  void set_decimalPlaces(uint8_t decimalPlaces);
464 
466 
482  bool set_focusPosition(Position position,
483  uint8_t column = 0, uint8_t row = 0);
484 
486 
495  bool set_asGlyph(uint8_t number);
496 
498 
506  bool set_asProgmem(uint8_t number);
508 
509 private:
511 
519  void print(DisplayClass *p_liquidCrystal, bool isFocused);
520 
522 
529  void print_variable(DisplayClass *p_liquidCrystal, uint8_t number);
530 
532 
540  bool is_callable(uint8_t number) const;
541 
543 
551  bool call_function(uint8_t number) const;
552 
553  uint8_t _row, _column, _focusRow, _focusColumn;
554  Position _focusPosition;
555  uint8_t _floatDecimalPlaces;
556  uint8_t _variableCount;
557  void (*_function[MAX_FUNCTIONS])(void);
558  const void *_variable[MAX_VARIABLES];
559  DataType _variableType[MAX_VARIABLES];
560  bool _focusable;
561 };
562 
563 
565 
574  friend class LiquidMenu;
575 
576 public:
577 
580 
582 
585  LiquidScreen();
586 
588 
591  explicit LiquidScreen(LiquidLine &liquidLine);
592 
594 
598  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2);
599 
601 
606  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
607  LiquidLine &liquidLine3);
608 
610 
616  LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2,
617  LiquidLine &liquidLine3, LiquidLine &liquidLine4);
618 
620 
623 
625 
636  bool add_line(LiquidLine &liquidLine);
637 
639 
653  bool set_focusPosition(Position position);
654 
656 
666  void set_displayLineCount(uint8_t lineCount);
667 
669 
680  void hide(bool hide);
682 
683 private:
685 
691  void print(DisplayClass *p_liquidCrystal) const;
692 
694 
700  void switch_focus(bool forward = true);
701 
703 
707  bool set_focusedLine(uint8_t lineIndex);
708 
710 
713  uint8_t get_focusedLine() const;
714 
716 
724  bool is_callable(uint8_t number) const;
725 
727 
737  bool call_function(uint8_t number) const;
738 
739  LiquidLine *_p_liquidLine[MAX_LINES];
740  uint8_t _lineCount;
741  uint8_t _focus;
742  uint8_t _displayLineCount;
743  bool _hidden;
744 };
745 
746 
748 
757 class LiquidMenu {
758  friend class LiquidSystem;
759 
760 public:
761 
764 
766 
773  LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen = 1);
774 
776 
782  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen,
783  uint8_t startingScreen = 1);
784 
786 
793  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
794  LiquidScreen &liquidScreen2, uint8_t startingScreen = 1);
795 
797 
805  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
806  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
807  uint8_t startingScreen = 1);
808 
810 
819  LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1,
820  LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3,
821  LiquidScreen &liquidScreen4, uint8_t startingScreen = 1);
822 
824 
827 
829 
840  bool add_screen(LiquidScreen &liquidScreen);
841 
843 
849 
851  void next_screen();
852 
854 
857  void operator++();
858 
860 
863  void operator++(int);
864 
866  void previous_screen();
867 
869 
872  void operator--();
873 
875 
878  void operator--(int);
879 
881 
885  bool change_screen(LiquidScreen *p_liquidScreen);
886 
888 
893  bool change_screen(uint8_t number);
894 
896 
900  bool operator=(LiquidScreen *p_liquidScreen);
901 
903 
908  bool operator=(uint8_t number);
909 
911 
917  void switch_focus(bool forward = true);
918 
920 
924  bool set_focusedLine(uint8_t lineIndex);
925 
927 
930  uint8_t get_focusedLine() const;
931 
933 
947  bool set_focusPosition(Position position);
948 
950 
963  bool set_focusSymbol(Position position, uint8_t symbol[8]);
964 
966 
974  bool is_callable(uint8_t number) const;
975 
977 
988  bool call_function(uint8_t number) const;
989 
991 
994  void update() const;
995 
997 
1003  void softUpdate() const;
1004 
1006 
1011  void init() const;
1012 
1014 
1015 private:
1016  DisplayClass *_p_liquidCrystal;
1017  LiquidScreen *_p_liquidScreen[MAX_SCREENS];
1018  uint8_t _screenCount;
1019  uint8_t _currentScreen;
1020 };
1021 
1022 
1024 
1035 public:
1036 
1039 
1041 
1046  explicit LiquidSystem(uint8_t startingMenu = 1);
1047 
1049 
1054  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1055  uint8_t startingMenu = 1);
1056 
1058 
1064  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1065  LiquidMenu &liquidMenu3, uint8_t startingMenu = 1);
1066 
1068 
1075  LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2,
1076  LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4,
1077  uint8_t startingMenu = 1);
1078 
1080 
1083 
1085 
1096  bool add_menu(LiquidMenu &liquidMenu);
1097 
1099 
1103  bool change_menu(LiquidMenu &p_liquidMenu);
1104 
1106 
1112 
1114  void next_screen();
1115 
1117 
1120  void operator++();
1121 
1123 
1126  void operator++(int);
1127 
1129  void previous_screen();
1130 
1132 
1135  void operator--();
1136 
1138 
1141  void operator--(int);
1142 
1144 
1148  bool change_screen(LiquidScreen *p_liquidScreen);
1149 
1151 
1156  bool change_screen(uint8_t number);
1157 
1159 
1163  bool operator=(LiquidScreen *p_liquidScreen);
1164 
1166 
1171  bool operator=(uint8_t number);
1172 
1174 
1180  void switch_focus(bool forward = true);
1181 
1183 
1187  bool set_focusedLine(uint8_t lineIndex);
1188 
1190 
1193  uint8_t get_focusedLine() const;
1194 
1196 
1210  bool set_focusPosition(Position position);
1211 
1213 
1226  bool set_focusSymbol(Position position, uint8_t symbol[8]);
1227 
1229 
1237  bool is_callable(uint8_t number) const;
1238 
1240 
1251  bool call_function(uint8_t number) const;
1252 
1254 
1257  void update() const;
1258 
1260 
1266  void softUpdate() const;
1267 
1269 
1270 private:
1271  LiquidMenu *_p_liquidMenu[MAX_MENUS];
1272  uint8_t _menuCount;
1273  uint8_t _currentMenu;
1274 };
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC)
Constructor for three variables/constants.
Definition: LiquidMenu.h:368
void operator--()
Switches to the previous screen.
Definition: LiquidSystem.cpp:109
-
void switch_focus(bool forward=true)
Switches the focus.
Definition: LiquidMenu.cpp:166
-
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidSystem.cpp:145
+
uint8_t get_focusedLine() const
Get the index of the currently focused line.
Definition: LiquidMenu.cpp:177
+
void switch_focus(bool forward=true)
Switches the focus.
Definition: LiquidMenu.cpp:167
+
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidSystem.cpp:153
LiquidSystem(uint8_t startingMenu=1)
The main constructor.
Definition: LiquidSystem.cpp:32
-
bool operator=(LiquidScreen &p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:129
-
Represents a collection of menus forming a menu system.
Definition: LiquidMenu.h:1008
+
Represents a collection of menus forming a menu system.
Definition: LiquidMenu.h:1034
+
bool change_screen(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:121
+
uint8_t get_focusedLine() const
Get the index of the currently focused line.
Definition: LiquidSystem.cpp:141
Represents the individual lines printed on the display.
Definition: LiquidMenu.h:305
-
void update() const
Prints the current screen to the display.
Definition: LiquidSystem.cpp:156
-
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidSystem.cpp:160
+
void update() const
Prints the current screen to the display.
Definition: LiquidSystem.cpp:164
+
bool set_focusedLine(uint8_t lineIndex)
Directly select focused line.
Definition: LiquidSystem.cpp:137
+
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidSystem.cpp:168
bool set_asGlyph(uint8_t number)
Converts a byte variable into a glyph index.
Definition: LiquidLine.cpp:77
bool set_asProgmem(uint8_t number)
Converts a const char pointer variable into const char pointer PROGMEM one.
Definition: LiquidLine.cpp:89
void operator--()
Switches to the previous screen.
Definition: LiquidMenu.cpp:118
@@ -89,25 +92,27 @@
void operator++()
Switches to the next screen.
Definition: LiquidMenu.cpp:97
bool add_variable(T &variable)
Adds a variable to the line.
Definition: LiquidMenu.h:409
const uint8_t MAX_SCREENS
Configures the number of available screens per menu.
Definition: LiquidMenu_config.h:70
+
bool set_focusedLine(uint8_t lineIndex)
Directly select focused line.
Definition: LiquidMenu.cpp:173
void set_displayLineCount(uint8_t lineCount)
Specifies the line size of the display (required for scrolling).
Definition: LiquidScreen.cpp:91
LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen=1)
The main constructor.
Definition: LiquidMenu.cpp:35
const uint8_t MAX_VARIABLES
Configures the number of available variables per line.
Definition: LiquidMenu_config.h:61
-
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidMenu.cpp:230
+
void softUpdate() const
Prints the current screen to the display (without clearing).
Definition: LiquidMenu.cpp:239
void previous_screen()
Switches to the previous screen.
Definition: LiquidSystem.cpp:105
-
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidMenu.cpp:172
+
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidMenu.cpp:181
LiquidScreen * get_currentScreen() const
Returns a reference to the current screen.
Definition: LiquidMenu.cpp:80
-
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidSystem.cpp:137
+
bool set_focusPosition(Position position)
Sets the focus position for the whole menu at once.
Definition: LiquidSystem.cpp:145
void next_screen()
Switches to the next screen.
Definition: LiquidMenu.cpp:84
-
void init() const
Initializes the menu object.
Definition: LiquidMenu.cpp:259
+
void init() const
Initializes the menu object.
Definition: LiquidMenu.cpp:268
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB)
Constructor for two variables/constants.
Definition: LiquidMenu.h:353
Represents a screen shown on the display.
Definition: LiquidMenu.h:573
#define DEBUG(x)
Debug print.
Definition: LiquidMenu_debug.h:23
-
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator&#39;s symbol.
Definition: LiquidSystem.cpp:141
-
void update() const
Prints the current screen to the display.
Definition: LiquidMenu.cpp:225
+
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator&#39;s symbol.
Definition: LiquidSystem.cpp:149
+
void update() const
Prints the current screen to the display.
Definition: LiquidMenu.cpp:234
-
bool call_function(uint8_t number) const
Calls an attached function specified by the number.
Definition: LiquidSystem.cpp:149
+
bool change_screen(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:141
+
bool call_function(uint8_t number) const
Calls an attached function specified by the number.
Definition: LiquidSystem.cpp:157
const uint8_t MAX_LINES
Configures the number of available lines per screen.
Definition: LiquidMenu_config.h:67
-
bool change_screen(LiquidScreen &p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:121
+
bool operator=(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidSystem.cpp:129
bool add_menu(LiquidMenu &liquidMenu)
Adds a LiquidMenu object to the menu system.
Definition: LiquidSystem.cpp:58
bool add_line(LiquidLine &liquidLine)
Adds a LiquidLine object to the screen.
Definition: LiquidScreen.cpp:57
@@ -115,16 +120,15 @@
void hide(bool hide)
Hides the screen.
Definition: LiquidScreen.cpp:95
bool change_menu(LiquidMenu &p_liquidMenu)
Switches to the specified menu.
Definition: LiquidSystem.cpp:73
LiquidScreen()
The main constructor.
Definition: LiquidScreen.cpp:32
-
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidMenu.cpp:215
+
bool is_callable(uint8_t number) const
Check if there is an attached function at the specified number.
Definition: LiquidMenu.cpp:224
const char LIQUIDMENU_VERSION[]
The version of the library.
Definition: LiquidMenu.h:79
-
Represents a collection of screens forming a menu.
Definition: LiquidMenu.h:744
+
Represents a collection of screens forming a menu.
Definition: LiquidMenu.h:757
LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC, D &variableD)
Constructor for four variables/constants.
Definition: LiquidMenu.h:384
-
bool change_screen(LiquidScreen &p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:141
+
bool operator=(LiquidScreen *p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:163
Position
Position enum.
Definition: LiquidMenu.h:117
-
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator&#39;s symbol.
Definition: LiquidMenu.cpp:186
+
bool set_focusSymbol(Position position, uint8_t symbol[8])
Changes the focus indicator&#39;s symbol.
Definition: LiquidMenu.cpp:195
bool attach_function(uint8_t number, void(*function)(void))
Attaches a callback function to the line.
Definition: LiquidLine.cpp:39
DataType recognizeType(bool variable)
Definition: recognizeType.cpp:9
-
bool operator=(LiquidScreen &p_liquidScreen)
Switches to the specified screen.
Definition: LiquidMenu.cpp:162
bool set_focusPosition(Position position, uint8_t column=0, uint8_t row=0)
Configures the focus indicator position for the line.
Definition: LiquidLine.cpp:58
void set_decimalPlaces(uint8_t decimalPlaces)
Sets the decimal places for floating point variables.
Definition: LiquidLine.cpp:53
void next_screen()
Switches to the next screen.
Definition: LiquidSystem.cpp:93
@@ -132,7 +136,7 @@
LiquidScreen * get_currentScreen() const
Returns a reference to the current screen.
Definition: LiquidSystem.cpp:89
void print_me(uintptr_t address)
Prints the number passed to it in a specific way.
Definition: LiquidLine.cpp:32
const uint8_t MAX_MENUS
Configures the number of available menus per menus system.
Definition: LiquidMenu_config.h:73
-
bool call_function(uint8_t number) const
Calls an attached function specified by the number.
Definition: LiquidMenu.cpp:219
+
bool call_function(uint8_t number) const
Calls an attached function specified by the number.
Definition: LiquidMenu.cpp:228
const uint8_t MAX_FUNCTIONS
Configures the number of available functions per line.
Definition: LiquidMenu_config.h:64
bool add_screen(LiquidScreen &liquidScreen)
Adds a LiquidScreen object to the menu.
Definition: LiquidMenu.cpp:67
LiquidLine(uint8_t column, uint8_t row, A &variableA)
Constructor for one variable/constant.
Definition: LiquidMenu.h:340
diff --git a/doc/Doxygen/html/_liquid_menu__config_8h.html b/doc/Doxygen/html/_liquid_menu__config_8h.html index 4cef6f3..4f7411b 100644 --- a/doc/Doxygen/html/_liquid_menu__config_8h.html +++ b/doc/Doxygen/html/_liquid_menu__config_8h.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
@@ -75,7 +75,7 @@
LiquidMenu_config.h File Reference
-
#include <LiquidCrystal.h>
+
#include <LiquidCrystal_I2C.h>

Go to the source code of this file.

@@ -92,12 +92,14 @@ - + + +#define  +#define 
#define LiquidCrystal_I2C_LIBRARY   (2)
 
Arduino's parallel "LiquidCrystal" library
I2C library
-#define LIQUIDMENU_LIBRARY   LiquidCrystal_LIBRARY
LIQUIDMENU_LIBRARY   LiquidCrystal_I2C_LIBRARY
 
-#define DisplayClass   LiquidCrystal
DisplayClass   LiquidCrystal_I2C
 
@@ -72,7 +72,7 @@
LiquidMenu_config.h
-Go to the documentation of this file.
1 
9 #pragma once
10 
16 #define LiquidCrystal_LIBRARY (1)
17 #define LiquidCrystal_I2C_LIBRARY (2)
18 
20 
21 // Select a "LiquidCrystal" library:
22 // ---------------------------------
23 
33 #define LIQUIDMENU_LIBRARY LiquidCrystal_LIBRARY
34 #include <LiquidCrystal.h>
35 #define DisplayClass LiquidCrystal
36 
43 // #define LIQUIDMENU_LIBRARY LiquidCrystal_I2C_LIBRARY
44 // #include <LiquidCrystal_I2C.h>
45 // #define DisplayClass LiquidCrystal_I2C
47 
52 // #include <LIBRARY_HEADER.h>
53 // #define DisplayClass LIBRARY_CONSTRUCTOR
56 
57 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 
59 
61 const uint8_t MAX_VARIABLES = 5;
62 
64 const uint8_t MAX_FUNCTIONS = 8;
65 
67 const uint8_t MAX_LINES = 12;
68 
70 const uint8_t MAX_SCREENS = 14;
71 
73 const uint8_t MAX_MENUS = 8;
74 
75 // Turns the debugging messages on or off.
76 #define LIQUIDMENU_DEBUG false
const uint8_t MAX_SCREENS
Configures the number of available screens per menu.
Definition: LiquidMenu_config.h:70
+Go to the documentation of this file.
1 
9 #pragma once
10 
16 #define LiquidCrystal_LIBRARY (1)
17 #define LiquidCrystal_I2C_LIBRARY (2)
18 
20 
21 // Select a "LiquidCrystal" library:
22 // ---------------------------------
23 
33 // #define LIQUIDMENU_LIBRARY LiquidCrystal_LIBRARY
34 // #include <LiquidCrystal.h>
35 // #define DisplayClass LiquidCrystal
37 
43 #define LIQUIDMENU_LIBRARY LiquidCrystal_I2C_LIBRARY
44 #include <LiquidCrystal_I2C.h>
45 #define DisplayClass LiquidCrystal_I2C
46 
52 // #include <LIBRARY_HEADER.h>
53 // #define DisplayClass LIBRARY_CONSTRUCTOR
56 
57 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 
59 
61 const uint8_t MAX_VARIABLES = 5;
62 
64 const uint8_t MAX_FUNCTIONS = 8;
65 
67 const uint8_t MAX_LINES = 12;
68 
70 const uint8_t MAX_SCREENS = 14;
71 
73 const uint8_t MAX_MENUS = 8;
74 
75 // Turns the debugging messages on or off.
76 #define LIQUIDMENU_DEBUG false
const uint8_t MAX_SCREENS
Configures the number of available screens per menu.
Definition: LiquidMenu_config.h:70
const uint8_t MAX_VARIABLES
Configures the number of available variables per line.
Definition: LiquidMenu_config.h:61
const uint8_t MAX_LINES
Configures the number of available lines per screen.
Definition: LiquidMenu_config.h:67
const uint8_t MAX_MENUS
Configures the number of available menus per menus system.
Definition: LiquidMenu_config.h:73
diff --git a/doc/Doxygen/html/_liquid_menu__debug_8h.html b/doc/Doxygen/html/_liquid_menu__debug_8h.html index deaa429..2ac64cc 100644 --- a/doc/Doxygen/html/_liquid_menu__debug_8h.html +++ b/doc/Doxygen/html/_liquid_menu__debug_8h.html @@ -23,7 +23,7 @@
diff --git a/doc/Doxygen/html/_liquid_menu__debug_8h_source.html b/doc/Doxygen/html/_liquid_menu__debug_8h_source.html index 60ba40c..8df1e98 100644 --- a/doc/Doxygen/html/_liquid_menu__debug_8h_source.html +++ b/doc/Doxygen/html/_liquid_menu__debug_8h_source.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/_liquid_screen_8cpp.html b/doc/Doxygen/html/_liquid_screen_8cpp.html index 56d02bc..353ddc3 100644 --- a/doc/Doxygen/html/_liquid_screen_8cpp.html +++ b/doc/Doxygen/html/_liquid_screen_8cpp.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/_liquid_system_8cpp.html b/doc/Doxygen/html/_liquid_system_8cpp.html index eea5ee6..c639e5a 100644 --- a/doc/Doxygen/html/_liquid_system_8cpp.html +++ b/doc/Doxygen/html/_liquid_system_8cpp.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/annotated.html b/doc/Doxygen/html/annotated.html index 6927301..f666427 100644 --- a/doc/Doxygen/html/annotated.html +++ b/doc/Doxygen/html/annotated.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/class_liquid_line-members.html b/doc/Doxygen/html/class_liquid_line-members.html index 1866921..d41ea3c 100644 --- a/doc/Doxygen/html/class_liquid_line-members.html +++ b/doc/Doxygen/html/class_liquid_line-members.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/class_liquid_line.html b/doc/Doxygen/html/class_liquid_line.html index 643d7e1..2821a98 100644 --- a/doc/Doxygen/html/class_liquid_line.html +++ b/doc/Doxygen/html/class_liquid_line.html @@ -23,7 +23,7 @@ diff --git a/doc/Doxygen/html/class_liquid_menu-members.html b/doc/Doxygen/html/class_liquid_menu-members.html index e32fbb4..179e234 100644 --- a/doc/Doxygen/html/class_liquid_menu-members.html +++ b/doc/Doxygen/html/class_liquid_menu-members.html @@ -23,7 +23,7 @@ @@ -73,25 +73,27 @@

diff --git a/doc/Doxygen/html/_liquid_menu__config_8h_source.html b/doc/Doxygen/html/_liquid_menu__config_8h_source.html index ca9a938..7a92679 100644 --- a/doc/Doxygen/html/_liquid_menu__config_8h_source.html +++ b/doc/Doxygen/html/_liquid_menu__config_8h_source.html @@ -23,7 +23,7 @@

LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/doc/Doxygen/html/class_liquid_menu.html b/doc/Doxygen/html/class_liquid_menu.html index 1de2f27..2ffdddc 100644 --- a/doc/Doxygen/html/class_liquid_menu.html +++ b/doc/Doxygen/html/class_liquid_menu.html @@ -23,7 +23,7 @@ @@ -120,21 +120,27 @@ - - - + + + - - - + + + + + + + + + @@ -486,8 +492,8 @@

-

◆ change_screen() [1/2]

+ +

◆ change_screen() [1/2]

@@ -495,7 +501,7 @@

bool LiquidMenu::change_screen

- + @@ -557,7 +563,27 @@

Returns
a reference to the current screen.
+
Returns
a pointer to the current screen.
+ + + +
+

◆ get_focusedLine()

+ +
+
+
add_screen(LiquidScreen &liquidScreen)LiquidMenu
call_function(uint8_t number) constLiquidMenu
change_screen(LiquidScreen &p_liquidScreen)LiquidMenu
change_screen(LiquidScreen *p_liquidScreen)LiquidMenu
change_screen(uint8_t number)LiquidMenu
get_currentScreen() constLiquidMenu
init() constLiquidMenu
is_callable(uint8_t number) constLiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3, LiquidScreen &liquidScreen4, uint8_t startingScreen=1)LiquidMenu
LiquidSystem (defined in LiquidMenu)LiquidMenufriend
next_screen()LiquidMenu
operator++()LiquidMenu
operator++(int)LiquidMenu
operator--()LiquidMenu
operator--(int)LiquidMenu
operator=(LiquidScreen &p_liquidScreen)LiquidMenu
operator=(uint8_t number)LiquidMenu
previous_screen()LiquidMenu
get_focusedLine() constLiquidMenu
init() constLiquidMenu
is_callable(uint8_t number) constLiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3, uint8_t startingScreen=1)LiquidMenu
LiquidMenu(DisplayClass &liquidCrystal, LiquidScreen &liquidScreen1, LiquidScreen &liquidScreen2, LiquidScreen &liquidScreen3, LiquidScreen &liquidScreen4, uint8_t startingScreen=1)LiquidMenu
LiquidSystem (defined in LiquidMenu)LiquidMenufriend
next_screen()LiquidMenu
operator++()LiquidMenu
operator++(int)LiquidMenu
operator--()LiquidMenu
operator--(int)LiquidMenu
operator=(LiquidScreen *p_liquidScreen)LiquidMenu
operator=(uint8_t number)LiquidMenu
previous_screen()LiquidMenu
set_focusedLine(uint8_t lineIndex)LiquidMenu
set_focusPosition(Position position)LiquidMenu
set_focusSymbol(Position position, uint8_t symbol[8])LiquidMenu
softUpdate() constLiquidMenu
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
void operator-- (int)
 Switches to the previous screen. More...
 
bool change_screen (LiquidScreen &p_liquidScreen)
 Switches to the specified 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= (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_focusedLine (uint8_t lineIndex)
 Directly select focused line. More...
 
uint8_t get_focusedLine () const
 Get the index of the currently focused line. More...
 
bool set_focusPosition (Position position)
 Sets the focus position for the whole menu at once. More...
 
(LiquidScreenLiquidScreen p_liquidScreen)
+ + + + + + +
uint8_t LiquidMenu::get_focusedLine () const
+
+ +

Get the index of the currently focused line.

+
Returns
the index of the currently focused line
@@ -712,8 +738,8 @@

-

◆ operator=() [1/2]

+ +

◆ operator=() [1/2]

@@ -721,7 +747,7 @@

bool LiquidMenu::operator= ( - LiquidScreen &  + LiquidScreenp_liquidScreen) @@ -783,6 +809,33 @@

+

◆ set_focusedLine()

+ +
+
+ + + + + + + + +
bool LiquidMenu::set_focusedLine (uint8_t lineIndex)
+
+ +

Directly select focused line.

+
Parameters
+ + +
lineIndex- index of the focused line
+
+
+
Returns
true: on success, false: when the selected line doesn't exist or it isn't focusable
+
diff --git a/doc/Doxygen/html/class_liquid_screen-members.html b/doc/Doxygen/html/class_liquid_screen-members.html index 4f5ae01..1278254 100644 --- a/doc/Doxygen/html/class_liquid_screen-members.html +++ b/doc/Doxygen/html/class_liquid_screen-members.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/class_liquid_screen.html b/doc/Doxygen/html/class_liquid_screen.html index ccde138..d75fb71 100644 --- a/doc/Doxygen/html/class_liquid_screen.html +++ b/doc/Doxygen/html/class_liquid_screen.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/class_liquid_system-members.html b/doc/Doxygen/html/class_liquid_system-members.html index 993abb4..597d9e0 100644 --- a/doc/Doxygen/html/class_liquid_system-members.html +++ b/doc/Doxygen/html/class_liquid_system-members.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
@@ -74,22 +74,24 @@ add_menu(LiquidMenu &liquidMenu)LiquidSystem call_function(uint8_t number) constLiquidSystem change_menu(LiquidMenu &p_liquidMenu)LiquidSystem - change_screen(LiquidScreen &p_liquidScreen)LiquidSystem + change_screen(LiquidScreen *p_liquidScreen)LiquidSystem change_screen(uint8_t number)LiquidSystem get_currentScreen() constLiquidSystem - is_callable(uint8_t number) constLiquidSystem - LiquidSystem(uint8_t startingMenu=1)LiquidSystemexplicit - LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, uint8_t startingMenu=1)LiquidSystem - LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, uint8_t startingMenu=1)LiquidSystem - LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4, uint8_t startingMenu=1)LiquidSystem - next_screen()LiquidSystem - operator++()LiquidSystem - operator++(int)LiquidSystem - operator--()LiquidSystem - operator--(int)LiquidSystem - operator=(LiquidScreen &p_liquidScreen)LiquidSystem - operator=(uint8_t number)LiquidSystem - previous_screen()LiquidSystem + get_focusedLine() constLiquidSystem + is_callable(uint8_t number) constLiquidSystem + LiquidSystem(uint8_t startingMenu=1)LiquidSystemexplicit + LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, uint8_t startingMenu=1)LiquidSystem + LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, uint8_t startingMenu=1)LiquidSystem + LiquidSystem(LiquidMenu &liquidMenu1, LiquidMenu &liquidMenu2, LiquidMenu &liquidMenu3, LiquidMenu &liquidMenu4, uint8_t startingMenu=1)LiquidSystem + next_screen()LiquidSystem + operator++()LiquidSystem + operator++(int)LiquidSystem + operator--()LiquidSystem + operator--(int)LiquidSystem + operator=(LiquidScreen *p_liquidScreen)LiquidSystem + operator=(uint8_t number)LiquidSystem + previous_screen()LiquidSystem + set_focusedLine(uint8_t lineIndex)LiquidSystem set_focusPosition(Position position)LiquidSystem set_focusSymbol(Position position, uint8_t symbol[8])LiquidSystem softUpdate() constLiquidSystem diff --git a/doc/Doxygen/html/class_liquid_system.html b/doc/Doxygen/html/class_liquid_system.html index 731842e..32d9684 100644 --- a/doc/Doxygen/html/class_liquid_system.html +++ b/doc/Doxygen/html/class_liquid_system.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
@@ -119,21 +119,27 @@ void operator-- (int)  Switches to the previous screen. More...
  -bool change_screen (LiquidScreen &p_liquidScreen) - Switches to the specified 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= (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_focusedLine (uint8_t lineIndex) + Directly select focused line. More...
+  +uint8_t get_focusedLine () const + Get the index of the currently focused line. More...
+  bool set_focusPosition (Position position)  Sets the focus position for the whole menu at once. More...
  @@ -435,8 +441,8 @@

-

◆ change_screen() [1/2]

+ +

◆ change_screen() [1/2]

+ +

◆ get_focusedLine()

+ +
+
+ + + + + + + +
uint8_t LiquidSystem::get_focusedLine () const
+
+ +

Get the index of the currently focused line.

+
Returns
the index of the currently focused line
@@ -640,8 +666,8 @@

-

◆ operator=() [1/2]

+ +

◆ operator=() [1/2]

@@ -649,7 +675,7 @@

bool LiquidSystem::operator= ( - LiquidScreen &  + LiquidScreenp_liquidScreen) @@ -711,6 +737,33 @@

+

◆ set_focusedLine()

+ +
+
+ + + + + + + + +
bool LiquidSystem::set_focusedLine (uint8_t lineIndex)
+
+ +

Directly select focused line.

+
Parameters
+ + +
lineIndex- index of the focused line
+
+
+
Returns
true: on success, false: when the selected line doesn't exist or it isn't focusable
+
diff --git a/doc/Doxygen/html/classes.html b/doc/Doxygen/html/classes.html index 784eb4d..f6dcdea 100644 --- a/doc/Doxygen/html/classes.html +++ b/doc/Doxygen/html/classes.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/Doxygen/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 0228b69..d3ef20f 100644 --- a/doc/Doxygen/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/doc/Doxygen/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/files.html b/doc/Doxygen/html/files.html index 175f159..ba7bba7 100644 --- a/doc/Doxygen/html/files.html +++ b/doc/Doxygen/html/files.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
diff --git a/doc/Doxygen/html/functions.html b/doc/Doxygen/html/functions.html index a3ca811..32b23a8 100644 --- a/doc/Doxygen/html/functions.html +++ b/doc/Doxygen/html/functions.html @@ -23,7 +23,7 @@ Logo
LiquidMenu -  1.4.1 +  1.5.1
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
@@ -95,7 +95,7 @@

- c -

@@ -105,6 +105,10 @@

- g -

@@ -161,7 +165,7 @@

- o -

@@ -187,6 +191,10 @@

- s -

  • set_displayLineCount() : LiquidScreen
  • +
  • set_focusedLine() +: LiquidMenu +, LiquidSystem +
  • set_focusPosition() : LiquidLine , LiquidMenu diff --git a/doc/Doxygen/html/functions_func.html b/doc/Doxygen/html/functions_func.html index 8d5b6af..6538f07 100644 --- a/doc/Doxygen/html/functions_func.html +++ b/doc/Doxygen/html/functions_func.html @@ -23,7 +23,7 @@ Logo
    LiquidMenu -  1.4.1 +  1.5.1
    Menu creation Arduino library for LCDs, wraps LiquidCrystal.
    @@ -95,7 +95,7 @@

    - c -

    @@ -105,6 +105,10 @@

    - g -

    @@ -161,7 +165,7 @@

    - o -

    @@ -187,6 +191,10 @@

    - s -

    • set_displayLineCount() : LiquidScreen
    • +
    • set_focusedLine() +: LiquidMenu +, LiquidSystem +
    • set_focusPosition() : LiquidLine , LiquidMenu diff --git a/doc/Doxygen/html/globals.html b/doc/Doxygen/html/globals.html index ea47a37..28f07b3 100644 --- a/doc/Doxygen/html/globals.html +++ b/doc/Doxygen/html/globals.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/globals_defs.html b/doc/Doxygen/html/globals_defs.html index eb28ea2..0b45e47 100644 --- a/doc/Doxygen/html/globals_defs.html +++ b/doc/Doxygen/html/globals_defs.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/globals_enum.html b/doc/Doxygen/html/globals_enum.html index ea70372..b3dc8e7 100644 --- a/doc/Doxygen/html/globals_enum.html +++ b/doc/Doxygen/html/globals_enum.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/globals_func.html b/doc/Doxygen/html/globals_func.html index aa0bd8b..fc646ec 100644 --- a/doc/Doxygen/html/globals_func.html +++ b/doc/Doxygen/html/globals_func.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/globals_vars.html b/doc/Doxygen/html/globals_vars.html index baaaca6..66e924d 100644 --- a/doc/Doxygen/html/globals_vars.html +++ b/doc/Doxygen/html/globals_vars.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/glyphs_8h.html b/doc/Doxygen/html/glyphs_8h.html index 308a01c..266d3c4 100644 --- a/doc/Doxygen/html/glyphs_8h.html +++ b/doc/Doxygen/html/glyphs_8h.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/glyphs_8h_source.html b/doc/Doxygen/html/glyphs_8h_source.html index 05cbdc9..7718028 100644 --- a/doc/Doxygen/html/glyphs_8h_source.html +++ b/doc/Doxygen/html/glyphs_8h_source.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      diff --git a/doc/Doxygen/html/index.html b/doc/Doxygen/html/index.html index f53ee0f..e6bddbb 100644 --- a/doc/Doxygen/html/index.html +++ b/doc/Doxygen/html/index.html @@ -23,7 +23,7 @@ Logo
      LiquidMenu -  1.4.1 +  1.5.1
      Menu creation Arduino library for LCDs, wraps LiquidCrystal.
      @@ -73,7 +73,7 @@
      Logo

Menu creation Arduino library for LCDs, wraps LiquidCrystal.

-

+

LiquidMenu wraps the Arduino's LiquidCrystal library with the ability to create menus. It simplifies the menu creation process by abstracting the elements of a menu into hierarchically organized classes.

Resources

    diff --git a/doc/Doxygen/html/pages.html b/doc/Doxygen/html/pages.html index 38716b7..f507f71 100644 --- a/doc/Doxygen/html/pages.html +++ b/doc/Doxygen/html/pages.html @@ -23,7 +23,7 @@ Logo
    LiquidMenu -  1.4.1 +  1.5.1
    Menu creation Arduino library for LCDs, wraps LiquidCrystal.
    diff --git a/doc/Doxygen/html/recognize_type_8cpp.html b/doc/Doxygen/html/recognize_type_8cpp.html index 6b4c7fa..373d2c8 100644 --- a/doc/Doxygen/html/recognize_type_8cpp.html +++ b/doc/Doxygen/html/recognize_type_8cpp.html @@ -23,7 +23,7 @@ Logo
    LiquidMenu -  1.4.1 +  1.5.1
    Menu creation Arduino library for LCDs, wraps LiquidCrystal.
    diff --git a/doc/Doxygen/html/search/all_1.js b/doc/Doxygen/html/search/all_1.js index d903d05..d7c49bc 100644 --- a/doc/Doxygen/html/search/all_1.js +++ b/doc/Doxygen/html/search/all_1.js @@ -2,6 +2,6 @@ var searchData= [ ['call_5ffunction',['call_function',['../class_liquid_menu.html#adc48665ed45cc8b7a688547c2711bee1',1,'LiquidMenu::call_function()'],['../class_liquid_system.html#a2e7e880c6329b8dca59d019b6ea7d10a',1,'LiquidSystem::call_function()']]], ['change_5fmenu',['change_menu',['../class_liquid_system.html#a88c0956003931a95180a4140ebce048d',1,'LiquidSystem']]], - ['change_5fscreen',['change_screen',['../class_liquid_menu.html#a406b6d717f642b116e4bba998f27393c',1,'LiquidMenu::change_screen(LiquidScreen &p_liquidScreen)'],['../class_liquid_menu.html#aa2da4a0f2c4406befe7f214e98ba5a48',1,'LiquidMenu::change_screen(uint8_t number)'],['../class_liquid_system.html#a72de20bedc0d2cf9736177386560d3ae',1,'LiquidSystem::change_screen(LiquidScreen &p_liquidScreen)'],['../class_liquid_system.html#ae65ae8d7c418ed3f99de3095944f3568',1,'LiquidSystem::change_screen(uint8_t number)']]], + ['change_5fscreen',['change_screen',['../class_liquid_menu.html#aeaea2afb1cc9d8ac70ca96c31c1034df',1,'LiquidMenu::change_screen(LiquidScreen *p_liquidScreen)'],['../class_liquid_menu.html#aa2da4a0f2c4406befe7f214e98ba5a48',1,'LiquidMenu::change_screen(uint8_t number)'],['../class_liquid_system.html#ab674bdea07cd46dc656d92dc4717a189',1,'LiquidSystem::change_screen(LiquidScreen *p_liquidScreen)'],['../class_liquid_system.html#ae65ae8d7c418ed3f99de3095944f3568',1,'LiquidSystem::change_screen(uint8_t number)']]], ['customfocus',['customFocus',['../glyphs_8h.html#a5e05ec5a67cf3c9a6c0b7268d99d8988',1,'glyph']]] ]; diff --git a/doc/Doxygen/html/search/all_3.js b/doc/Doxygen/html/search/all_3.js index 22b517f..cf7e8e0 100644 --- a/doc/Doxygen/html/search/all_3.js +++ b/doc/Doxygen/html/search/all_3.js @@ -1,5 +1,6 @@ var searchData= [ ['get_5fcurrentscreen',['get_currentScreen',['../class_liquid_menu.html#a42e776202652464ed489f21120198a2a',1,'LiquidMenu::get_currentScreen()'],['../class_liquid_system.html#a3a9e2d16877a774dbda4586e090a4b9f',1,'LiquidSystem::get_currentScreen()']]], + ['get_5ffocusedline',['get_focusedLine',['../class_liquid_menu.html#ae150b50e58e84b234d21425e4f04d2d5',1,'LiquidMenu::get_focusedLine()'],['../class_liquid_system.html#aa0107d05025c34039262d7976eeaea65',1,'LiquidSystem::get_focusedLine()']]], ['glyphs_2eh',['glyphs.h',['../glyphs_8h.html',1,'']]] ]; diff --git a/doc/Doxygen/html/search/all_9.js b/doc/Doxygen/html/search/all_9.js index 970dde5..32fb9df 100644 --- a/doc/Doxygen/html/search/all_9.js +++ b/doc/Doxygen/html/search/all_9.js @@ -2,5 +2,5 @@ var searchData= [ ['operator_2b_2b',['operator++',['../class_liquid_menu.html#a12b1b75ac4d82d992213b7d66a73ba63',1,'LiquidMenu::operator++()'],['../class_liquid_menu.html#aebc8843b6d91e49741d2be5fde02b03f',1,'LiquidMenu::operator++(int)'],['../class_liquid_system.html#a139b86202d2eb109a63ba630464d658a',1,'LiquidSystem::operator++()'],['../class_liquid_system.html#ac24b8243f062622de967f79eed6993aa',1,'LiquidSystem::operator++(int)']]], ['operator_2d_2d',['operator--',['../class_liquid_menu.html#a16eb7e91ce25eca66d8b21574a53b50a',1,'LiquidMenu::operator--()'],['../class_liquid_menu.html#a61134f032b157c57e9a7d798565bf20f',1,'LiquidMenu::operator--(int)'],['../class_liquid_system.html#a9464b4f2306bd27ba21d48f86650f596',1,'LiquidSystem::operator--()'],['../class_liquid_system.html#ae9ea52c5954479f804924048c50cb5f4',1,'LiquidSystem::operator--(int)']]], - ['operator_3d',['operator=',['../class_liquid_menu.html#a7f62e0068d1d1c1f38d3bdab01222f8f',1,'LiquidMenu::operator=(LiquidScreen &p_liquidScreen)'],['../class_liquid_menu.html#a1e5bff5dbee74b17db98c1b8ce582d74',1,'LiquidMenu::operator=(uint8_t number)'],['../class_liquid_system.html#a2909ccbcd30153f4e2a46c198eda6677',1,'LiquidSystem::operator=(LiquidScreen &p_liquidScreen)'],['../class_liquid_system.html#a0b333fc7958e07befc5e75d4b0e9e6a5',1,'LiquidSystem::operator=(uint8_t number)']]] + ['operator_3d',['operator=',['../class_liquid_menu.html#a914d7c7dcea22fa1c86fd908e03668f3',1,'LiquidMenu::operator=(LiquidScreen *p_liquidScreen)'],['../class_liquid_menu.html#a1e5bff5dbee74b17db98c1b8ce582d74',1,'LiquidMenu::operator=(uint8_t number)'],['../class_liquid_system.html#aa866de6a0b651a71f730d0660efff0d3',1,'LiquidSystem::operator=(LiquidScreen *p_liquidScreen)'],['../class_liquid_system.html#a0b333fc7958e07befc5e75d4b0e9e6a5',1,'LiquidSystem::operator=(uint8_t number)']]] ]; diff --git a/doc/Doxygen/html/search/all_c.js b/doc/Doxygen/html/search/all_c.js index fa69503..94b9185 100644 --- a/doc/Doxygen/html/search/all_c.js +++ b/doc/Doxygen/html/search/all_c.js @@ -4,6 +4,7 @@ var searchData= ['set_5fasprogmem',['set_asProgmem',['../class_liquid_line.html#a48e780de58fdd558d41952a377e812c4',1,'LiquidLine']]], ['set_5fdecimalplaces',['set_decimalPlaces',['../class_liquid_line.html#ad840bc6254280cfb2a9155ae1f39104e',1,'LiquidLine']]], ['set_5fdisplaylinecount',['set_displayLineCount',['../class_liquid_screen.html#a6a0b6ae610e7e4d30ceec10bb35442a6',1,'LiquidScreen']]], + ['set_5ffocusedline',['set_focusedLine',['../class_liquid_menu.html#a648df9d360ad442549e4e25f5f25d1f8',1,'LiquidMenu::set_focusedLine()'],['../class_liquid_system.html#a506a20342062d61f1f8eca87b9365e4e',1,'LiquidSystem::set_focusedLine()']]], ['set_5ffocusposition',['set_focusPosition',['../class_liquid_line.html#a84f19c3724695929a6a6cc3ef6083865',1,'LiquidLine::set_focusPosition()'],['../class_liquid_screen.html#a6b025aaf4ba5d0749aa828a303e64415',1,'LiquidScreen::set_focusPosition()'],['../class_liquid_menu.html#acdce4caf01ad04fcbb8b7bbc91db98b2',1,'LiquidMenu::set_focusPosition()'],['../class_liquid_system.html#af261a981d86b320ba57c392bd1b65432',1,'LiquidSystem::set_focusPosition()']]], ['set_5ffocussymbol',['set_focusSymbol',['../class_liquid_menu.html#aee55f6820e8e752e25775781e2a0de18',1,'LiquidMenu::set_focusSymbol()'],['../class_liquid_system.html#adf9bc656e655c4deb098a334a09f53b8',1,'LiquidSystem::set_focusSymbol()']]], ['softupdate',['softUpdate',['../class_liquid_menu.html#a506aa5f8822031096a881aed7c6e45e5',1,'LiquidMenu::softUpdate()'],['../class_liquid_system.html#a263abccb44122e37e72f2acac9befb14',1,'LiquidSystem::softUpdate()']]], diff --git a/doc/Doxygen/html/search/functions_1.js b/doc/Doxygen/html/search/functions_1.js index 5281555..376b52b 100644 --- a/doc/Doxygen/html/search/functions_1.js +++ b/doc/Doxygen/html/search/functions_1.js @@ -2,5 +2,5 @@ var searchData= [ ['call_5ffunction',['call_function',['../class_liquid_menu.html#adc48665ed45cc8b7a688547c2711bee1',1,'LiquidMenu::call_function()'],['../class_liquid_system.html#a2e7e880c6329b8dca59d019b6ea7d10a',1,'LiquidSystem::call_function()']]], ['change_5fmenu',['change_menu',['../class_liquid_system.html#a88c0956003931a95180a4140ebce048d',1,'LiquidSystem']]], - ['change_5fscreen',['change_screen',['../class_liquid_menu.html#a406b6d717f642b116e4bba998f27393c',1,'LiquidMenu::change_screen(LiquidScreen &p_liquidScreen)'],['../class_liquid_menu.html#aa2da4a0f2c4406befe7f214e98ba5a48',1,'LiquidMenu::change_screen(uint8_t number)'],['../class_liquid_system.html#a72de20bedc0d2cf9736177386560d3ae',1,'LiquidSystem::change_screen(LiquidScreen &p_liquidScreen)'],['../class_liquid_system.html#ae65ae8d7c418ed3f99de3095944f3568',1,'LiquidSystem::change_screen(uint8_t number)']]] + ['change_5fscreen',['change_screen',['../class_liquid_menu.html#aeaea2afb1cc9d8ac70ca96c31c1034df',1,'LiquidMenu::change_screen(LiquidScreen *p_liquidScreen)'],['../class_liquid_menu.html#aa2da4a0f2c4406befe7f214e98ba5a48',1,'LiquidMenu::change_screen(uint8_t number)'],['../class_liquid_system.html#ab674bdea07cd46dc656d92dc4717a189',1,'LiquidSystem::change_screen(LiquidScreen *p_liquidScreen)'],['../class_liquid_system.html#ae65ae8d7c418ed3f99de3095944f3568',1,'LiquidSystem::change_screen(uint8_t number)']]] ]; diff --git a/doc/Doxygen/html/search/functions_2.js b/doc/Doxygen/html/search/functions_2.js index cd0550b..be24afc 100644 --- a/doc/Doxygen/html/search/functions_2.js +++ b/doc/Doxygen/html/search/functions_2.js @@ -1,4 +1,5 @@ var searchData= [ - ['get_5fcurrentscreen',['get_currentScreen',['../class_liquid_menu.html#a42e776202652464ed489f21120198a2a',1,'LiquidMenu::get_currentScreen()'],['../class_liquid_system.html#a3a9e2d16877a774dbda4586e090a4b9f',1,'LiquidSystem::get_currentScreen()']]] + ['get_5fcurrentscreen',['get_currentScreen',['../class_liquid_menu.html#a42e776202652464ed489f21120198a2a',1,'LiquidMenu::get_currentScreen()'],['../class_liquid_system.html#a3a9e2d16877a774dbda4586e090a4b9f',1,'LiquidSystem::get_currentScreen()']]], + ['get_5ffocusedline',['get_focusedLine',['../class_liquid_menu.html#ae150b50e58e84b234d21425e4f04d2d5',1,'LiquidMenu::get_focusedLine()'],['../class_liquid_system.html#aa0107d05025c34039262d7976eeaea65',1,'LiquidSystem::get_focusedLine()']]] ]; diff --git a/doc/Doxygen/html/search/functions_7.js b/doc/Doxygen/html/search/functions_7.js index 970dde5..32fb9df 100644 --- a/doc/Doxygen/html/search/functions_7.js +++ b/doc/Doxygen/html/search/functions_7.js @@ -2,5 +2,5 @@ var searchData= [ ['operator_2b_2b',['operator++',['../class_liquid_menu.html#a12b1b75ac4d82d992213b7d66a73ba63',1,'LiquidMenu::operator++()'],['../class_liquid_menu.html#aebc8843b6d91e49741d2be5fde02b03f',1,'LiquidMenu::operator++(int)'],['../class_liquid_system.html#a139b86202d2eb109a63ba630464d658a',1,'LiquidSystem::operator++()'],['../class_liquid_system.html#ac24b8243f062622de967f79eed6993aa',1,'LiquidSystem::operator++(int)']]], ['operator_2d_2d',['operator--',['../class_liquid_menu.html#a16eb7e91ce25eca66d8b21574a53b50a',1,'LiquidMenu::operator--()'],['../class_liquid_menu.html#a61134f032b157c57e9a7d798565bf20f',1,'LiquidMenu::operator--(int)'],['../class_liquid_system.html#a9464b4f2306bd27ba21d48f86650f596',1,'LiquidSystem::operator--()'],['../class_liquid_system.html#ae9ea52c5954479f804924048c50cb5f4',1,'LiquidSystem::operator--(int)']]], - ['operator_3d',['operator=',['../class_liquid_menu.html#a7f62e0068d1d1c1f38d3bdab01222f8f',1,'LiquidMenu::operator=(LiquidScreen &p_liquidScreen)'],['../class_liquid_menu.html#a1e5bff5dbee74b17db98c1b8ce582d74',1,'LiquidMenu::operator=(uint8_t number)'],['../class_liquid_system.html#a2909ccbcd30153f4e2a46c198eda6677',1,'LiquidSystem::operator=(LiquidScreen &p_liquidScreen)'],['../class_liquid_system.html#a0b333fc7958e07befc5e75d4b0e9e6a5',1,'LiquidSystem::operator=(uint8_t number)']]] + ['operator_3d',['operator=',['../class_liquid_menu.html#a914d7c7dcea22fa1c86fd908e03668f3',1,'LiquidMenu::operator=(LiquidScreen *p_liquidScreen)'],['../class_liquid_menu.html#a1e5bff5dbee74b17db98c1b8ce582d74',1,'LiquidMenu::operator=(uint8_t number)'],['../class_liquid_system.html#aa866de6a0b651a71f730d0660efff0d3',1,'LiquidSystem::operator=(LiquidScreen *p_liquidScreen)'],['../class_liquid_system.html#a0b333fc7958e07befc5e75d4b0e9e6a5',1,'LiquidSystem::operator=(uint8_t number)']]] ]; diff --git a/doc/Doxygen/html/search/functions_a.js b/doc/Doxygen/html/search/functions_a.js index fa69503..94b9185 100644 --- a/doc/Doxygen/html/search/functions_a.js +++ b/doc/Doxygen/html/search/functions_a.js @@ -4,6 +4,7 @@ var searchData= ['set_5fasprogmem',['set_asProgmem',['../class_liquid_line.html#a48e780de58fdd558d41952a377e812c4',1,'LiquidLine']]], ['set_5fdecimalplaces',['set_decimalPlaces',['../class_liquid_line.html#ad840bc6254280cfb2a9155ae1f39104e',1,'LiquidLine']]], ['set_5fdisplaylinecount',['set_displayLineCount',['../class_liquid_screen.html#a6a0b6ae610e7e4d30ceec10bb35442a6',1,'LiquidScreen']]], + ['set_5ffocusedline',['set_focusedLine',['../class_liquid_menu.html#a648df9d360ad442549e4e25f5f25d1f8',1,'LiquidMenu::set_focusedLine()'],['../class_liquid_system.html#a506a20342062d61f1f8eca87b9365e4e',1,'LiquidSystem::set_focusedLine()']]], ['set_5ffocusposition',['set_focusPosition',['../class_liquid_line.html#a84f19c3724695929a6a6cc3ef6083865',1,'LiquidLine::set_focusPosition()'],['../class_liquid_screen.html#a6b025aaf4ba5d0749aa828a303e64415',1,'LiquidScreen::set_focusPosition()'],['../class_liquid_menu.html#acdce4caf01ad04fcbb8b7bbc91db98b2',1,'LiquidMenu::set_focusPosition()'],['../class_liquid_system.html#af261a981d86b320ba57c392bd1b65432',1,'LiquidSystem::set_focusPosition()']]], ['set_5ffocussymbol',['set_focusSymbol',['../class_liquid_menu.html#aee55f6820e8e752e25775781e2a0de18',1,'LiquidMenu::set_focusSymbol()'],['../class_liquid_system.html#adf9bc656e655c4deb098a334a09f53b8',1,'LiquidSystem::set_focusSymbol()']]], ['softupdate',['softUpdate',['../class_liquid_menu.html#a506aa5f8822031096a881aed7c6e45e5',1,'LiquidMenu::softUpdate()'],['../class_liquid_system.html#a263abccb44122e37e72f2acac9befb14',1,'LiquidSystem::softUpdate()']]], diff --git a/doc/Doxygen/html/todo.html b/doc/Doxygen/html/todo.html index 368eeda..1c86bbe 100644 --- a/doc/Doxygen/html/todo.html +++ b/doc/Doxygen/html/todo.html @@ -23,7 +23,7 @@ Logo
    LiquidMenu -  1.4.1 +  1.5.1
    Menu creation Arduino library for LCDs, wraps LiquidCrystal.
    diff --git a/examples/K_getters_menu/K_getters_menu.ino b/examples/K_getters_menu/K_getters_menu.ino index a834272..07a9426 100644 --- a/examples/K_getters_menu/K_getters_menu.ino +++ b/examples/K_getters_menu/K_getters_menu.ino @@ -102,10 +102,9 @@ void setup() { menu.update(); delay(1000); if (menu.get_currentScreen() == &welcome_screen) { - menu.change_screen(pot_screen); + menu.change_screen(&pot_screen); menu.update(); } - menu.change_screen(&pot_screen); } void loop() { diff --git a/src/LiquidMenu.cpp b/src/LiquidMenu.cpp index 1ee43cb..c74af09 100644 --- a/src/LiquidMenu.cpp +++ b/src/LiquidMenu.cpp @@ -138,11 +138,12 @@ bool LiquidMenu::change_screen(uint8_t number) { } } -bool LiquidMenu::change_screen(LiquidScreen &p_liquidScreen) { +bool LiquidMenu::change_screen(LiquidScreen *p_liquidScreen) { // _p_liquidMenu[_currentMenu]->_p_liquidCrystal->clear(); for (uint8_t s = 0; s < _screenCount; s++) { _p_liquidCrystal->clear(); - if (reinterpret_cast(&p_liquidScreen) == reinterpret_cast(&(*_p_liquidScreen[s]))) { + if (p_liquidScreen == _p_liquidScreen[s]) { + // if (reinterpret_cast(&p_liquidScreen) == reinterpret_cast(&(*_p_liquidScreen[s]))) { _currentScreen = s; update(); DEBUG(F("Switched to screen (")); @@ -159,7 +160,7 @@ bool LiquidMenu::operator=(uint8_t number) { return change_screen(number); } -bool LiquidMenu::operator=(LiquidScreen &p_liquidScreen) { +bool LiquidMenu::operator=(LiquidScreen *p_liquidScreen) { return change_screen(p_liquidScreen); } diff --git a/src/LiquidMenu.h b/src/LiquidMenu.h index 3cf5482..7e55dba 100644 --- a/src/LiquidMenu.h +++ b/src/LiquidMenu.h @@ -843,7 +843,7 @@ class LiquidMenu { /** Call this method to obtain a reference to the current screen. - @returns a reference to the current screen. + @returns a pointer to the current screen. */ LiquidScreen* get_currentScreen() const; @@ -882,7 +882,7 @@ class LiquidMenu { @param *p_liquidScreen - pointer to the LiquidScreen object @returns true on success and false if the screen is not found */ - bool change_screen(LiquidScreen &p_liquidScreen); + bool change_screen(LiquidScreen *p_liquidScreen); /// Switches to the specified screen. /** @@ -897,7 +897,7 @@ class LiquidMenu { @param &p_liquidScreen - pointer to the screen @returns true on success and false if the screen is not found */ - bool operator=(LiquidScreen &p_liquidScreen); + bool operator=(LiquidScreen *p_liquidScreen); /// Switches to the specified screen. /** @@ -1106,7 +1106,7 @@ class LiquidSystem { /** Call this method to obtain a reference to the current screen. - @returns a reference to the current screen. + @returns a pointer to the current screen. */ LiquidScreen* get_currentScreen() const; @@ -1145,7 +1145,7 @@ class LiquidSystem { @param *p_liquidScreen - pointer to the LiquidScreen object @returns true on success and false if the screen is not found */ - bool change_screen(LiquidScreen &p_liquidScreen); + bool change_screen(LiquidScreen *p_liquidScreen); /// Switches to the specified screen. /** @@ -1160,7 +1160,7 @@ class LiquidSystem { @param &p_liquidScreen - pointer to the screen @returns true on success and false if the screen is not found */ - bool operator=(LiquidScreen &p_liquidScreen); + bool operator=(LiquidScreen *p_liquidScreen); /// Switches to the specified screen. /** diff --git a/src/LiquidSystem.cpp b/src/LiquidSystem.cpp index ef6ea3f..6011ed3 100644 --- a/src/LiquidSystem.cpp +++ b/src/LiquidSystem.cpp @@ -118,7 +118,7 @@ bool LiquidSystem::change_screen(uint8_t number) { return _p_liquidMenu[_currentMenu]->change_screen(number); } -bool LiquidSystem::change_screen(LiquidScreen &p_liquidScreen) { +bool LiquidSystem::change_screen(LiquidScreen *p_liquidScreen) { return _p_liquidMenu[_currentMenu]->change_screen(p_liquidScreen); } @@ -126,7 +126,7 @@ bool LiquidSystem::operator=(uint8_t number) { return change_screen(number); } -bool LiquidSystem::operator=(LiquidScreen &p_liquidScreen) { +bool LiquidSystem::operator=(LiquidScreen *p_liquidScreen) { return change_screen(p_liquidScreen); }