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
Navigator.h@1:84d263c8932d, 2013-03-05 (annotated)
- Committer:
- pyeh9
- Date:
- Tue Mar 05 20:33:27 2013 +0000
- Revision:
- 1:84d263c8932d
- Child:
- 2:2654dc659298
second version - all necessary files in one folder;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pyeh9 | 1:84d263c8932d | 1 | #ifndef NAVIGATOR_H |
pyeh9 | 1:84d263c8932d | 2 | #define NAVIGATOR_H |
pyeh9 | 1:84d263c8932d | 3 | |
pyeh9 | 1:84d263c8932d | 4 | #include "mbed.h" |
pyeh9 | 1:84d263c8932d | 5 | #include "Menu.h" |
pyeh9 | 1:84d263c8932d | 6 | #include "TextLCD.h" |
pyeh9 | 1:84d263c8932d | 7 | #include "RPG.h" |
pyeh9 | 1:84d263c8932d | 8 | |
pyeh9 | 1:84d263c8932d | 9 | class Navigator { |
pyeh9 | 1:84d263c8932d | 10 | private: |
pyeh9 | 1:84d263c8932d | 11 | |
pyeh9 | 1:84d263c8932d | 12 | public: |
pyeh9 | 1:84d263c8932d | 13 | //Navigator(Menu &, RPG &, TextLCD &); |
pyeh9 | 1:84d263c8932d | 14 | Navigator(Menu *root, RPG &, TextLCD *lcd); |
pyeh9 | 1:84d263c8932d | 15 | Menu *activeMenu; |
pyeh9 | 1:84d263c8932d | 16 | RPG rpg; |
pyeh9 | 1:84d263c8932d | 17 | TextLCD *lcd; |
pyeh9 | 1:84d263c8932d | 18 | |
pyeh9 | 1:84d263c8932d | 19 | bool lastButton, button; |
pyeh9 | 1:84d263c8932d | 20 | int direction; |
pyeh9 | 1:84d263c8932d | 21 | |
pyeh9 | 1:84d263c8932d | 22 | int bottom; |
pyeh9 | 1:84d263c8932d | 23 | int cursorPos; // what selection the cursor points to |
pyeh9 | 1:84d263c8932d | 24 | int cursorLine; // what line of the lcd the cursor is on. 1 = first line, 2 = second line |
pyeh9 | 1:84d263c8932d | 25 | |
pyeh9 | 1:84d263c8932d | 26 | void poll(); |
pyeh9 | 1:84d263c8932d | 27 | void moveUp(); |
pyeh9 | 1:84d263c8932d | 28 | void moveDown(); |
pyeh9 | 1:84d263c8932d | 29 | void printMenu(); |
pyeh9 | 1:84d263c8932d | 30 | void printCursor(); |
pyeh9 | 1:84d263c8932d | 31 | void update(); |
pyeh9 | 1:84d263c8932d | 32 | }; |
pyeh9 | 1:84d263c8932d | 33 | |
pyeh9 | 1:84d263c8932d | 34 | #endif |