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
Menu.h@9:c9df0b33d176, 2015-03-13 (annotated)
- Committer:
- charly
- Date:
- Fri Mar 13 18:44:49 2015 +0000
- Revision:
- 9:c9df0b33d176
- Parent:
- 8:fbaeab73fe1a
Refactored Selection to MenuItem; Added comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pyeh9 | 0:577f0ec71f4c | 1 | #ifndef MENU_H |
pyeh9 | 0:577f0ec71f4c | 2 | #define MENU_H |
pyeh9 | 0:577f0ec71f4c | 3 | |
pyeh9 | 0:577f0ec71f4c | 4 | #include "mbed.h" |
charly | 9:c9df0b33d176 | 5 | #include "MenuItem.h" |
pyeh9 | 0:577f0ec71f4c | 6 | #include <vector> |
pyeh9 | 0:577f0ec71f4c | 7 | |
charly | 9:c9df0b33d176 | 8 | class MenuItem; |
pyeh9 | 1:84d263c8932d | 9 | |
charly | 9:c9df0b33d176 | 10 | /** Menu: Create Menues with Submenues, MenuItems, actions,... |
charly | 9:c9df0b33d176 | 11 | * |
charly | 9:c9df0b33d176 | 12 | */ |
pyeh9 | 0:577f0ec71f4c | 13 | class Menu { |
pyeh9 | 0:577f0ec71f4c | 14 | private: |
pyeh9 | 0:577f0ec71f4c | 15 | public: |
charly | 9:c9df0b33d176 | 16 | /** vector of of Menu-Items |
charly | 9:c9df0b33d176 | 17 | * |
charly | 9:c9df0b33d176 | 18 | */ |
charly | 9:c9df0b33d176 | 19 | vector<MenuItem> selections; |
charly | 9:c9df0b33d176 | 20 | |
charly | 9:c9df0b33d176 | 21 | /** name of a menu |
charly | 9:c9df0b33d176 | 22 | */ |
pyeh9 | 1:84d263c8932d | 23 | char *menuID; |
charly | 8:fbaeab73fe1a | 24 | |
charly | 8:fbaeab73fe1a | 25 | // currently selected Item in Menu (used to return to this point from submenu) |
charly | 8:fbaeab73fe1a | 26 | int CurrentSelection; |
pyeh9 | 1:84d263c8932d | 27 | |
charly | 9:c9df0b33d176 | 28 | /** a menu |
charly | 9:c9df0b33d176 | 29 | */ |
pyeh9 | 1:84d263c8932d | 30 | Menu(char *); |
pyeh9 | 0:577f0ec71f4c | 31 | |
charly | 9:c9df0b33d176 | 32 | /** add an Item to the menu |
charly | 9:c9df0b33d176 | 33 | */ |
charly | 9:c9df0b33d176 | 34 | void add(const MenuItem &toAdd); |
charly | 9:c9df0b33d176 | 35 | /** change the text of an menu-item |
charly | 9:c9df0b33d176 | 36 | */ |
charly | 6:819049708d51 | 37 | void changeText(int position, char *newText); |
charly | 9:c9df0b33d176 | 38 | /** get current text of menu-item |
charly | 9:c9df0b33d176 | 39 | */ |
pyeh9 | 0:577f0ec71f4c | 40 | char *getText(int); |
pyeh9 | 0:577f0ec71f4c | 41 | }; |
pyeh9 | 0:577f0ec71f4c | 42 | #endif |