Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Menu by
Menu.h@11:6814cbc83ae0, 2016-01-13 (annotated)
- Committer:
- charly
- Date:
- Wed Jan 13 19:59:21 2016 +0000
- Revision:
- 11:6814cbc83ae0
- Parent:
- 9:c9df0b33d176
added show_longtext() to display a long text. With scrollbars.
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 |
