Baseline for testing
Navigator.h@3:8395f7ab6d3e, 2019-07-25 (annotated)
- Committer:
- foxbrianr
- Date:
- Thu Jul 25 00:42:49 2019 +0000
- Revision:
- 3:8395f7ab6d3e
- Parent:
- 2:2654dc659298
Baseline for testing
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" |
foxbrianr | 3:8395f7ab6d3e | 6 | #include "LCD.h" |
pyeh9 | 1:84d263c8932d | 7 | |
pyeh9 | 1:84d263c8932d | 8 | class Navigator { |
pyeh9 | 1:84d263c8932d | 9 | private: |
pyeh9 | 1:84d263c8932d | 10 | |
pyeh9 | 1:84d263c8932d | 11 | public: |
foxbrianr | 3:8395f7ab6d3e | 12 | Navigator(Menu *, LCD *); |
foxbrianr | 3:8395f7ab6d3e | 13 | //Navigator(Menu *, RPG &, TextLCD *); |
pyeh9 | 2:2654dc659298 | 14 | Menu *activeMenu; // the current menu - can change when RPG is pushed on selection with child menu |
foxbrianr | 3:8395f7ab6d3e | 15 | |
foxbrianr | 3:8395f7ab6d3e | 16 | LCD *lcd; |
pyeh9 | 1:84d263c8932d | 17 | |
pyeh9 | 1:84d263c8932d | 18 | bool lastButton, button; |
pyeh9 | 2:2654dc659298 | 19 | int direction; // 1 = CW, -1 = CCW |
pyeh9 | 1:84d263c8932d | 20 | |
foxbrianr | 3:8395f7ab6d3e | 21 | int top; // the index of the last item of current menu |
pyeh9 | 2:2654dc659298 | 22 | int bottom; // the index of the last item of current menu |
foxbrianr | 3:8395f7ab6d3e | 23 | |
pyeh9 | 2:2654dc659298 | 24 | int cursorPos; // what selection the cursor points to |
foxbrianr | 3:8395f7ab6d3e | 25 | int cursorLine; // what line of the lcd the cursor is one |
pyeh9 | 1:84d263c8932d | 26 | |
foxbrianr | 3:8395f7ab6d3e | 27 | void update(char cmd); // repeatedly call this function to determine if RPG is being used |
pyeh9 | 1:84d263c8932d | 28 | void moveUp(); |
pyeh9 | 1:84d263c8932d | 29 | void moveDown(); |
foxbrianr | 3:8395f7ab6d3e | 30 | void selectMenu(); |
pyeh9 | 1:84d263c8932d | 31 | void printMenu(); |
pyeh9 | 1:84d263c8932d | 32 | void printCursor(); |
foxbrianr | 3:8395f7ab6d3e | 33 | |
foxbrianr | 3:8395f7ab6d3e | 34 | void pageUp (); |
foxbrianr | 3:8395f7ab6d3e | 35 | void pageDown (); |
pyeh9 | 1:84d263c8932d | 36 | }; |
pyeh9 | 1:84d263c8932d | 37 | |
pyeh9 | 1:84d263c8932d | 38 | #endif |