menu v1
Fork of Menu by
Navigator.h@3:3cdd377f5899, 2015-05-13 (annotated)
- Committer:
- jjcimon
- Date:
- Wed May 13 11:40:22 2015 +0000
- Revision:
- 3:3cdd377f5899
- Parent:
- 2:2654dc659298
Beta private,
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 |
jjcimon | 3:3cdd377f5899 | 3 | #include "SMARTGPU.h" |
pyeh9 | 1:84d263c8932d | 4 | #include "mbed.h" |
pyeh9 | 1:84d263c8932d | 5 | #include "Menu.h" |
jjcimon | 3:3cdd377f5899 | 6 | // #include "TextLCD.h" |
pyeh9 | 1:84d263c8932d | 7 | #include "RPG.h" |
jjcimon | 3:3cdd377f5899 | 8 | #include "SMARTGPU.h" |
pyeh9 | 1:84d263c8932d | 9 | class Navigator { |
pyeh9 | 1:84d263c8932d | 10 | private: |
pyeh9 | 1:84d263c8932d | 11 | |
pyeh9 | 1:84d263c8932d | 12 | public: |
jjcimon | 3:3cdd377f5899 | 13 | Navigator(Menu *, RPG &, SMARTGPU *); |
pyeh9 | 2:2654dc659298 | 14 | Menu *activeMenu; // the current menu - can change when RPG is pushed on selection with child menu |
pyeh9 | 1:84d263c8932d | 15 | RPG rpg; |
jjcimon | 3:3cdd377f5899 | 16 | SMARTGPU *lcd; |
jjcimon | 3:3cdd377f5899 | 17 | |
pyeh9 | 1:84d263c8932d | 18 | |
pyeh9 | 1:84d263c8932d | 19 | bool lastButton, button; |
pyeh9 | 2:2654dc659298 | 20 | int direction; // 1 = CW, -1 = CCW |
pyeh9 | 1:84d263c8932d | 21 | |
jjcimon | 3:3cdd377f5899 | 22 | int hor; |
jjcimon | 3:3cdd377f5899 | 23 | int courb; |
pyeh9 | 2:2654dc659298 | 24 | int bottom; // the index of the last item of current menu |
pyeh9 | 2:2654dc659298 | 25 | int cursorPos; // what selection the cursor points to |
pyeh9 | 1:84d263c8932d | 26 | int cursorLine; // what line of the lcd the cursor is on. 1 = first line, 2 = second line |
pyeh9 | 1:84d263c8932d | 27 | |
pyeh9 | 2:2654dc659298 | 28 | void poll(); // repeatedly call this function to determine if RPG is being used |
pyeh9 | 1:84d263c8932d | 29 | void moveUp(); |
pyeh9 | 1:84d263c8932d | 30 | void moveDown(); |
pyeh9 | 1:84d263c8932d | 31 | void printMenu(); |
pyeh9 | 1:84d263c8932d | 32 | void printCursor(); |
pyeh9 | 1:84d263c8932d | 33 | }; |
pyeh9 | 1:84d263c8932d | 34 | |
pyeh9 | 1:84d263c8932d | 35 | #endif |