4 errors
Dependencies: KS0108_PCF8574 mbed
menbed/include/menbedMenuItem.h@0:936f1c020120, 2012-09-05 (annotated)
- Committer:
- GuiTwo
- Date:
- Wed Sep 05 07:21:59 2012 +0000
- Revision:
- 0:936f1c020120
With KS0108;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GuiTwo | 0:936f1c020120 | 1 | #ifndef _MENBEDMENUITEM_H_ |
GuiTwo | 0:936f1c020120 | 2 | #define _MENBEDMENUITEM_H_ |
GuiTwo | 0:936f1c020120 | 3 | |
GuiTwo | 0:936f1c020120 | 4 | #include <vector> |
GuiTwo | 0:936f1c020120 | 5 | #include "mbed.h" |
GuiTwo | 0:936f1c020120 | 6 | #include "menbedMenu.h" |
GuiTwo | 0:936f1c020120 | 7 | #include "menbedMenuParam.h" |
GuiTwo | 0:936f1c020120 | 8 | |
GuiTwo | 0:936f1c020120 | 9 | class MenbedMenu; |
GuiTwo | 0:936f1c020120 | 10 | |
GuiTwo | 0:936f1c020120 | 11 | class MenbedMenuItem { |
GuiTwo | 0:936f1c020120 | 12 | public: |
GuiTwo | 0:936f1c020120 | 13 | // Pointer to function that will be called when menu item selected. This |
GuiTwo | 0:936f1c020120 | 14 | // may be a null pointer if no function should be called. |
GuiTwo | 0:936f1c020120 | 15 | void (*selFcn)(); |
GuiTwo | 0:936f1c020120 | 16 | // New menu to display when item selected. This can be set to null if a |
GuiTwo | 0:936f1c020120 | 17 | // new menu item should not be called when the menu item is selected. |
GuiTwo | 0:936f1c020120 | 18 | MenbedMenu **childMenu; |
GuiTwo | 0:936f1c020120 | 19 | // If true, childMenuIsAncestor indicates that the child menu's parent menu |
GuiTwo | 0:936f1c020120 | 20 | // should be set to null. This will prevent the user from moving to the |
GuiTwo | 0:936f1c020120 | 21 | // from the child menu back to the current menu. This is useful when the |
GuiTwo | 0:936f1c020120 | 22 | // menu item is something like "Goto root menu". Once the user is in the |
GuiTwo | 0:936f1c020120 | 23 | // root menu, we don't want the user to press and hold the select key or |
GuiTwo | 0:936f1c020120 | 24 | // press the cancel key in order to return to the current menu. |
GuiTwo | 0:936f1c020120 | 25 | bool childMenuIsAncestor; |
GuiTwo | 0:936f1c020120 | 26 | // Pointer a structure which itself points to a float that will be displayed |
GuiTwo | 0:936f1c020120 | 27 | // in place of the %f in the text of the menu item. If the param struct |
GuiTwo | 0:936f1c020120 | 28 | // has an inc memeber that is non-zero, the parameter can be modified by the |
GuiTwo | 0:936f1c020120 | 29 | // user. In particular, when the user selects this menu item, the parameter |
GuiTwo | 0:936f1c020120 | 30 | // is highlighted and the user can then use the up and down buttons to |
GuiTwo | 0:936f1c020120 | 31 | // modify its value. |
GuiTwo | 0:936f1c020120 | 32 | MenbedMenuParam *param; |
GuiTwo | 0:936f1c020120 | 33 | // Array of char pointers to the strings that will be catenated to form |
GuiTwo | 0:936f1c020120 | 34 | // the text of the menu item. To insert either a menu parameter or state |
GuiTwo | 0:936f1c020120 | 35 | // variable into the menu item text, make one of the strings a printf-style |
GuiTwo | 0:936f1c020120 | 36 | // conversion specifier for a float. (Note: only floats are allowed, |
GuiTwo | 0:936f1c020120 | 37 | // integer are not.) The last string must be an empty string ("") to |
GuiTwo | 0:936f1c020120 | 38 | // indicate it is the last string in the array. If the empty string is |
GuiTwo | 0:936f1c020120 | 39 | // omitted, unpredictable behavior will result. |
GuiTwo | 0:936f1c020120 | 40 | char *text; |
GuiTwo | 0:936f1c020120 | 41 | |
GuiTwo | 0:936f1c020120 | 42 | MenbedMenuItem (void (*selFcn)(), MenbedMenu **childMenu, |
GuiTwo | 0:936f1c020120 | 43 | bool childMenuIsAncestor, MenbedMenuParam *param, |
GuiTwo | 0:936f1c020120 | 44 | char *text); |
GuiTwo | 0:936f1c020120 | 45 | }; |
GuiTwo | 0:936f1c020120 | 46 | |
GuiTwo | 0:936f1c020120 | 47 | #endif /* _MENBEDMENUITEM_H_ */ |