Baseline for testing
Menu.h@3:8395f7ab6d3e, 2019-07-25 (annotated)
- Committer:
- foxbrianr
- Date:
- Thu Jul 25 00:42:49 2019 +0000
- Revision:
- 3:8395f7ab6d3e
- Parent:
- 1:84d263c8932d
Baseline for testing
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" |
pyeh9 | 0:577f0ec71f4c | 5 | #include "Selection.h" |
foxbrianr | 3:8395f7ab6d3e | 6 | #include "LCD.h" |
foxbrianr | 3:8395f7ab6d3e | 7 | |
pyeh9 | 0:577f0ec71f4c | 8 | #include <vector> |
foxbrianr | 3:8395f7ab6d3e | 9 | #include <string> |
pyeh9 | 0:577f0ec71f4c | 10 | |
pyeh9 | 1:84d263c8932d | 11 | class Selection; |
pyeh9 | 1:84d263c8932d | 12 | |
pyeh9 | 0:577f0ec71f4c | 13 | class Menu { |
pyeh9 | 0:577f0ec71f4c | 14 | private: |
pyeh9 | 0:577f0ec71f4c | 15 | |
pyeh9 | 0:577f0ec71f4c | 16 | public: |
foxbrianr | 3:8395f7ab6d3e | 17 | |
foxbrianr | 3:8395f7ab6d3e | 18 | LCD * lcd; |
foxbrianr | 3:8395f7ab6d3e | 19 | Menu * parent; |
foxbrianr | 3:8395f7ab6d3e | 20 | |
foxbrianr | 3:8395f7ab6d3e | 21 | int update_needed; |
foxbrianr | 3:8395f7ab6d3e | 22 | |
foxbrianr | 3:8395f7ab6d3e | 23 | int cursorPos; // what selection the cursor points to |
foxbrianr | 3:8395f7ab6d3e | 24 | int cursorLine; // what line of the lcd the cursor is one |
foxbrianr | 3:8395f7ab6d3e | 25 | |
pyeh9 | 0:577f0ec71f4c | 26 | vector<Selection> selections; |
foxbrianr | 3:8395f7ab6d3e | 27 | string menuID; |
pyeh9 | 1:84d263c8932d | 28 | |
foxbrianr | 3:8395f7ab6d3e | 29 | Menu(char *id); |
foxbrianr | 3:8395f7ab6d3e | 30 | Menu(string id); |
foxbrianr | 3:8395f7ab6d3e | 31 | |
foxbrianr | 3:8395f7ab6d3e | 32 | |
pyeh9 | 0:577f0ec71f4c | 33 | |
pyeh9 | 0:577f0ec71f4c | 34 | void add(const Selection &toAdd); |
foxbrianr | 3:8395f7ab6d3e | 35 | |
foxbrianr | 3:8395f7ab6d3e | 36 | virtual void select(); |
foxbrianr | 3:8395f7ab6d3e | 37 | |
foxbrianr | 3:8395f7ab6d3e | 38 | //char * getText() { return menuID.c_str(); }; |
foxbrianr | 3:8395f7ab6d3e | 39 | |
foxbrianr | 3:8395f7ab6d3e | 40 | virtual void display(LCD * lcd); |
foxbrianr | 3:8395f7ab6d3e | 41 | |
foxbrianr | 3:8395f7ab6d3e | 42 | void moveUp(); |
foxbrianr | 3:8395f7ab6d3e | 43 | void moveDown(); |
foxbrianr | 3:8395f7ab6d3e | 44 | |
foxbrianr | 3:8395f7ab6d3e | 45 | virtual void pressClear(); |
foxbrianr | 3:8395f7ab6d3e | 46 | virtual void pressMode(); |
foxbrianr | 3:8395f7ab6d3e | 47 | virtual void pressSet(); |
foxbrianr | 3:8395f7ab6d3e | 48 | virtual void pressDown(); |
foxbrianr | 3:8395f7ab6d3e | 49 | virtual void pressUp(); |
foxbrianr | 3:8395f7ab6d3e | 50 | |
foxbrianr | 3:8395f7ab6d3e | 51 | void printMenu(); |
foxbrianr | 3:8395f7ab6d3e | 52 | void printCursor(); |
foxbrianr | 3:8395f7ab6d3e | 53 | |
pyeh9 | 0:577f0ec71f4c | 54 | }; |
pyeh9 | 0:577f0ec71f4c | 55 | #endif |