GUI: SubMenu view module API. More...
#include <gui/view.h>
Go to the source code of this file.
Typedefs | |
typedef struct Submenu | Submenu |
Submenu anonymous structure. | |
typedef void(* | SubmenuItemCallback) (void *context, uint32_t index) |
Functions | |
Submenu * | submenu_alloc (void) |
Allocate and initialize submenu. | |
void | submenu_free (Submenu *submenu) |
Deinitialize and free submenu. | |
View * | submenu_get_view (Submenu *submenu) |
Get submenu view. | |
void | submenu_add_item (Submenu *submenu, const char *label, uint32_t index, SubmenuItemCallback callback, void *callback_context) |
Add item to submenu. | |
void | submenu_change_item_label (Submenu *submenu, uint32_t index, const char *label) |
Change label of an existing item. | |
void | submenu_reset (Submenu *submenu) |
Remove all items from submenu. | |
uint32_t | submenu_get_selected_item (Submenu *submenu) |
Get submenu selected item index. | |
void | submenu_set_selected_item (Submenu *submenu, uint32_t index) |
Set submenu selected item by index. | |
void | submenu_set_header (Submenu *submenu, const char *header) |
Set optional header for submenu. | |
GUI: SubMenu view module API.
void submenu_add_item | ( | Submenu * | submenu, |
const char * | label, | ||
uint32_t | index, | ||
SubmenuItemCallback | callback, | ||
void * | callback_context ) |
Add item to submenu.
submenu | Submenu instance |
label | menu item label |
index | menu item index, used for callback, may be the same with other items |
callback | menu item callback |
callback_context | menu item callback context |
Submenu * submenu_alloc | ( | void | ) |
Allocate and initialize submenu.
This submenu is used to select one option
void submenu_change_item_label | ( | Submenu * | submenu, |
uint32_t | index, | ||
const char * | label ) |
Change label of an existing item.
submenu | Submenu instance |
index | The index of the item |
label | The new label |
void submenu_free | ( | Submenu * | submenu | ) |
Deinitialize and free submenu.
submenu | Submenu instance |
uint32_t submenu_get_selected_item | ( | Submenu * | submenu | ) |
Get submenu selected item index.
submenu | Submenu instance |
Get submenu view.
submenu | Submenu instance |
void submenu_reset | ( | Submenu * | submenu | ) |
Remove all items from submenu.
submenu | Submenu instance |
void submenu_set_header | ( | Submenu * | submenu, |
const char * | header ) |
Set optional header for submenu.
submenu | Submenu instance |
header | header to set |
void submenu_set_selected_item | ( | Submenu * | submenu, |
uint32_t | index ) |
Set submenu selected item by index.
submenu | Submenu instance |
index | The index of the selected item |