Loading...
Searching...
No Matches
submenu.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <gui/view.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
15typedef struct Submenu Submenu;
16typedef void (*SubmenuItemCallback)(void* context, uint32_t index);
17
25
30void submenu_free(Submenu* submenu);
31
39
50 Submenu* submenu,
51 const char* label,
52 uint32_t index,
53 SubmenuItemCallback callback,
54 void* callback_context);
55
62void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label);
63
68void submenu_reset(Submenu* submenu);
69
76uint32_t submenu_get_selected_item(Submenu* submenu);
77
83void submenu_set_selected_item(Submenu* submenu, uint32_t index);
84
90void submenu_set_header(Submenu* submenu, const char* header);
91
92#ifdef __cplusplus
93}
94#endif
Definition services/gui/modules/submenu.c:7
Definition view_i.h:16
void submenu_free(Submenu *submenu)
Deinitialize and free submenu.
Definition services/gui/modules/submenu.c:175
uint32_t submenu_get_selected_item(Submenu *submenu)
Get submenu selected item index.
Definition services/gui/modules/submenu.c:253
Submenu * submenu_alloc(void)
Allocate and initialize submenu.
Definition services/gui/modules/submenu.c:153
void submenu_set_header(Submenu *submenu, const char *header)
Set optional header for submenu.
Definition services/gui/modules/submenu.c:379
View * submenu_get_view(Submenu *submenu)
Get submenu view.
Definition services/gui/modules/submenu.c:190
void submenu_change_item_label(Submenu *submenu, uint32_t index, const char *label)
Change label of an existing item.
Definition services/gui/modules/submenu.c:218
void submenu_reset(Submenu *submenu)
Remove all items from submenu.
Definition services/gui/modules/submenu.c:238
void submenu_add_item(Submenu *submenu, const char *label, uint32_t index, SubmenuItemCallback callback, void *callback_context)
Add item to submenu.
Definition services/gui/modules/submenu.c:195
void submenu_set_selected_item(Submenu *submenu, uint32_t index)
Set submenu selected item by index.
Definition services/gui/modules/submenu.c:272
GUI: View API.