Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9

Fork of Menu by Peihsun Yeh

Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9

Committer:
charly
Date:
Fri Jan 02 20:49:59 2015 +0000
Revision:
6:819049708d51
Parent:
1:84d263c8932d
Child:
8:fbaeab73fe1a
addes Method to Chnage Text of an MenuItem

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pyeh9 0:577f0ec71f4c 1 #include "mbed.h"
pyeh9 0:577f0ec71f4c 2 #include "Menu.h"
pyeh9 0:577f0ec71f4c 3 #include "Selection.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();
pyeh9 0:577f0ec71f4c 8 }
pyeh9 0:577f0ec71f4c 9
pyeh9 0:577f0ec71f4c 10 void Menu::add(const Selection &toAdd)
pyeh9 0:577f0ec71f4c 11 {
pyeh9 0:577f0ec71f4c 12 selections.push_back(toAdd);
pyeh9 0:577f0ec71f4c 13 }
pyeh9 0:577f0ec71f4c 14
charly 6:819049708d51 15 void Menu::changeText(int position, char *newText)
charly 6:819049708d51 16 {
charly 6:819049708d51 17 if ((position >=0) && (position <= selections.size())) {
charly 6:819049708d51 18 selections[position].selText = newText;
charly 6:819049708d51 19 }
charly 6:819049708d51 20 }
pyeh9 0:577f0ec71f4c 21