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.
Dependencies: Terminal
Diff: menuitem.h
- Revision:
- 0:907d2d5e77f7
- Child:
- 3:f308cd7a34ed
diff -r 000000000000 -r 907d2d5e77f7 menuitem.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/menuitem.h Fri May 01 03:56:34 2015 +0000
@@ -0,0 +1,32 @@
+#ifndef __MENUITEM_H
+#define __MENUITEM_H
+
+#include "Terminal.h"
+
+extern Terminal term;
+
+typedef enum {menu, heading, display, control} MenuType;
+typedef char * (*callback_function)(bool); // type for conciseness
+
+#define MAX_NAME_LEN (80-10-10)
+
+class MenuItem{
+ public:
+ MenuItem();
+ MenuItem(const char * Name_p, callback_function callback_p, int level, MenuType type_p, int target_page = -1);
+ MenuItem(const char * Name_p, int target_page); //construct a menu selection item this way
+ const char *Name; //reference to the name
+ int level; //0 if primary 1 or greater if this is a sub-menu
+ MenuType type; //are we displaying something or controlling something
+
+ callback_function callback; //callback for getting the data
+
+ int name_len;
+
+ int data_col; //column where the data is shown
+ int target_page; //the page to go to if called
+
+};
+
+
+#endif
\ No newline at end of file