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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Menu.cpp Source File

Menu.cpp

00001 #include "mbed.h"
00002 #include "Menu.h"
00003 #include "MenuItem.h"
00004 
00005 Menu::Menu(char *id) : menuID(id)
00006 {
00007     selections.clear();
00008     CurrentSelection = 0;
00009 }
00010 
00011 void Menu::add(const MenuItem &toAdd)
00012 {
00013     selections.push_back(toAdd);
00014 }
00015 
00016 void Menu::changeText(int position, char *newText)
00017 {
00018     if ((position >=0) && (position <= selections.size())) {
00019         selections[position].selText = newText;
00020     }
00021 }
00022