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

Files at this revision

API Documentation at this revision

Comitter:
pyeh9
Date:
Thu Feb 28 22:19:37 2013 +0000
Child:
1:84d263c8932d
Commit message:
First commit

Changed in this revision

Menu.cpp Show annotated file Show diff for this revision Revisions of this file
Menu.h Show annotated file Show diff for this revision Revisions of this file
Selection.cpp Show annotated file Show diff for this revision Revisions of this file
Selection.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Menu.cpp	Thu Feb 28 22:19:37 2013 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "Menu.h"
+#include "Selection.h"
+
+Menu::Menu()
+{
+    selections.clear();
+}
+
+void Menu::add(const Selection &toAdd)
+{
+    selections.push_back(toAdd);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Menu.h	Thu Feb 28 22:19:37 2013 +0000
@@ -0,0 +1,18 @@
+#ifndef MENU_H
+#define MENU_H
+
+#include "mbed.h"
+#include "Selection.h"
+#include <vector>
+
+class Menu {
+    private:
+               
+    public:
+        vector<Selection> selections;
+        Menu();
+        
+        void add(const Selection &toAdd);
+        char *getText(int);
+};
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Selection.cpp	Thu Feb 28 22:19:37 2013 +0000
@@ -0,0 +1,10 @@
+#include "mbed.h"
+#include "Selection.h"
+#include "TextLCD.h"
+
+Selection::Selection(void (*fun)(), int position, char* text)
+{
+    fun = fun;
+    selText = text;
+    pos = position;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Selection.h	Thu Feb 28 22:19:37 2013 +0000
@@ -0,0 +1,17 @@
+#ifndef SELECTION_H
+#define SELECTION_H
+
+class Selection {
+    private:
+        
+    public:
+        void (*fun)(); // pointer to a function to execute 
+        char* selText; // selection text
+        int pos; // selection position
+        
+        Selection(void (*)(), int, char *); 
+        
+        //debug functions 
+};
+
+#endif 
\ No newline at end of file