Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9
Fork of Menu by
Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9
Diff: MenuItem.h
- Revision:
- 10:2b6ddf53b05e
- Parent:
- 9:c9df0b33d176
- Child:
- 11:6814cbc83ae0
--- a/MenuItem.h Fri Mar 13 18:44:49 2015 +0000
+++ b/MenuItem.h Mon Mar 16 21:05:37 2015 +0000
@@ -11,6 +11,33 @@
private:
public:
+ /** modes of MenuItems
+ */
+ enum mode{
+ /** default mode: just display the Menu-Text an perform user_action
+ */
+ mode_default = 0,
+ /** wait_select: Call user_action and then only accept a select
+ * use for displaying text, values,...
+ * the menu is paused until select is pressed
+ */
+ mode_wait_select = 1,
+ /** mode_yes_no: show text and ask user for yes/no
+ *
+ */
+ mode_yes_no = 2
+ };
+
+ /** structure to pass data to menu and back
+ */
+ struct menu_data{
+ // Longer text to display.
+ // For Yes/No-Question
+ char * text;
+ //Yes/No Value In and Out
+ bool yes_no;
+ };
+
/** pointer to user-action to execute when menu item is selected
*/
void (*userAction)();
@@ -23,10 +50,15 @@
/** Pointer to child-menue
*/
Menu *childMenu;
+ /** itemMode
+ */
+ uint8_t itemMode;
+
+ menu_data * menu_parameter;
/** a sub-menu
*/
- MenuItem(void (*)(), int, Menu *, char *);
+ MenuItem(void (*)(), int, Menu *, char *, uint8_t = mode_default, menu_data * = NULL);
};
