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
Library to display menus on TextLCDs. Interaction with functions Up,Down and Select (Buttons or RPG) Based on menu-library from pyeh9
Revision 6:819049708d51, committed 2015-01-02
- Comitter:
- charly
- Date:
- Fri Jan 02 20:49:59 2015 +0000
- Parent:
- 5:91b1bc68290b
- Child:
- 7:12f2b3b7975f
- Commit message:
- addes Method to Chnage Text of an MenuItem
Changed in this revision
--- a/Menu.cpp Fri Jan 02 15:41:09 2015 +0000
+++ b/Menu.cpp Fri Jan 02 20:49:59 2015 +0000
@@ -12,4 +12,10 @@
selections.push_back(toAdd);
}
+void Menu::changeText(int position, char *newText)
+{
+ if ((position >=0) && (position <= selections.size())) {
+ selections[position].selText = newText;
+ }
+}
--- a/Menu.h Fri Jan 02 15:41:09 2015 +0000
+++ b/Menu.h Fri Jan 02 20:49:59 2015 +0000
@@ -17,6 +17,7 @@
Menu(char *);
void add(const Selection &toAdd);
+ void changeText(int position, char *newText);
char *getText(int);
};
#endif
\ No newline at end of file
--- a/Navigator.cpp Fri Jan 02 15:41:09 2015 +0000
+++ b/Navigator.cpp Fri Jan 02 20:49:59 2015 +0000
@@ -56,6 +56,9 @@
if(activeMenu->selections[_cursorPos].fun != NULL) {
//execute function
(activeMenu->selections[_cursorPos].fun)();
+ // refresh the Menu
+ printMenu();
+ printCursor();
}
if(activeMenu->selections[_cursorPos].childMenu != NULL) {
activeMenu = activeMenu->selections[_cursorPos].childMenu;
