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.cpp@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 | #include "mbed.h" |
| pyeh9 | 0:577f0ec71f4c | 2 | #include "Menu.h" |
| charly | 9:c9df0b33d176 | 3 | #include "MenuItem.h" |
| pyeh9 | 0:577f0ec71f4c | 4 | |
| pyeh9 | 1:84d263c8932d | 5 | Menu::Menu(char *id) : menuID(id) |
| pyeh9 | 0:577f0ec71f4c | 6 | { |
| pyeh9 | 0:577f0ec71f4c | 7 | selections.clear(); |
| charly | 8:fbaeab73fe1a | 8 | CurrentSelection = 0; |
| pyeh9 | 0:577f0ec71f4c | 9 | } |
| pyeh9 | 0:577f0ec71f4c | 10 | |
| charly | 9:c9df0b33d176 | 11 | void Menu::add(const MenuItem &toAdd) |
| pyeh9 | 0:577f0ec71f4c | 12 | { |
| pyeh9 | 0:577f0ec71f4c | 13 | selections.push_back(toAdd); |
| pyeh9 | 0:577f0ec71f4c | 14 | } |
| pyeh9 | 0:577f0ec71f4c | 15 | |
| charly | 6:819049708d51 | 16 | void Menu::changeText(int position, char *newText) |
| charly | 6:819049708d51 | 17 | { |
| charly | 6:819049708d51 | 18 | if ((position >=0) && (position <= selections.size())) { |
| charly | 6:819049708d51 | 19 | selections[position].selText = newText; |
| charly | 6:819049708d51 | 20 | } |
| charly | 6:819049708d51 | 21 | } |
| pyeh9 | 0:577f0ec71f4c | 22 |
