Vinícius Alves / Mbed 2 deprecated MenuLCD_copy

Dependencies:   MenuLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers menbedMenuItem.h Source File

menbedMenuItem.h

00001 #ifndef _MENBEDMENUITEM_H_
00002 #define _MENBEDMENUITEM_H_
00003 
00004 #include <vector>
00005 #include "mbed.h"
00006 #include "menbedMenu.h"
00007 #include "menbedMenuParam.h"
00008 
00009 class MenbedMenu;
00010 
00011 class MenbedMenuItem {
00012 public:
00013     // Pointer to function that will be called when menu item selected.  This
00014     // may be a null pointer if no function should be called.
00015     void (*selFcn)();
00016     // New menu to display when item selected.  This can be set to null if a
00017     // new menu item should not be called when the menu item is selected.
00018     MenbedMenu **childMenu;
00019     // If true, childMenuIsAncestor indicates that the child menu's parent menu
00020     // should be set to null.  This will prevent the user from moving to the
00021     // from the child menu back to the current menu.  This is useful when the
00022     // menu item is something like "Goto root menu".   Once the user is in the
00023     // root menu, we don't want the user to press and hold the select key or
00024     // press the cancel key in order to return to the current menu.
00025     bool childMenuIsAncestor;
00026     // Pointer a structure which itself points to a float that will be displayed
00027     // in place of the %f in the text of the menu item.  If the param struct
00028     // has an inc memeber that is non-zero, the parameter can be modified by the
00029     // user.  In particular, when the user selects this menu item, the parameter
00030     // is highlighted and the user can then use the up and down buttons to
00031     // modify its value.
00032     MenbedMenuParam *param;
00033     // Array of char pointers to the strings that will be catenated to form
00034     // the text of the menu item.  To insert either a menu parameter or state
00035     // variable into the menu item text, make one of the strings a printf-style
00036     // conversion specifier for a float.  (Note: only floats are allowed,
00037     // integer are not.)  The last string must be an empty string ("") to
00038     // indicate it is the last string in the array.  If the empty string is
00039     // omitted, unpredictable behavior will result.
00040     char *text;
00041     
00042     MenbedMenuItem (void (*selFcn)(), MenbedMenu **childMenu, 
00043         bool childMenuIsAncestor, MenbedMenuParam *param, 
00044         char *text);
00045 };
00046 
00047 #endif /* _MENBEDMENUITEM_H_ */