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
MenuItem.h
- Committer:
- charly
- Date:
- 2015-03-16
- Revision:
- 10:2b6ddf53b05e
- Parent:
- 9:c9df0b33d176
- Child:
- 11:6814cbc83ae0
File content as of revision 10:2b6ddf53b05e:
#ifndef MENUITEM_H
#define MENUITEM_H
#include "Menu.h"
class Menu;
/** MenuItem is a menu-item of menu
*/
class MenuItem {
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)();
/** Text of Menue-Item to display
*/
char* selText;
/** position of menuitem in menu
*/
int pos;
/** Pointer to child-menue
*/
Menu *childMenu;
/** itemMode
*/
uint8_t itemMode;
menu_data * menu_parameter;
/** a sub-menu
*/
MenuItem(void (*)(), int, Menu *, char *, uint8_t = mode_default, menu_data * = NULL);
};
#endif
