Loading...
Searching...
No Matches
button_menu.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <stdint.h>
9#include <gui/view.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
16typedef struct ButtonMenu ButtonMenu;
17
20
22typedef void (*ButtonMenuItemCallback)(void* context, int32_t index, InputType type);
23
25typedef enum {
26 ButtonMenuItemTypeCommon,
27 ButtonMenuItemTypeControl,
29
37
42void button_menu_reset(ButtonMenu* button_menu);
43
59 ButtonMenu* button_menu,
60 const char* label,
61 int32_t index,
64 void* callback_context);
65
71
76void button_menu_free(ButtonMenu* button_menu);
77
83void button_menu_set_header(ButtonMenu* button_menu, const char* header);
84
90void button_menu_set_selected_item(ButtonMenu* button_menu, uint32_t index);
91
92#ifdef __cplusplus
93}
94#endif
ButtonMenuItem * button_menu_add_item(ButtonMenu *button_menu, const char *label, int32_t index, ButtonMenuItemCallback callback, ButtonMenuItemType type, void *callback_context)
Add item to button menu instance.
Definition button_menu.c:327
void(* ButtonMenuItemCallback)(void *context, int32_t index, InputType type)
Callback for any button menu actions.
Definition button_menu.h:22
void button_menu_free(ButtonMenu *button_menu)
Free ButtonMenu element.
Definition button_menu.c:377
void button_menu_set_selected_item(ButtonMenu *button_menu, uint32_t index)
Set selected item.
Definition button_menu.c:389
ButtonMenu * button_menu_alloc(void)
Allocate and initialize new instance of ButtonMenu model.
Definition button_menu.c:354
void button_menu_reset(ButtonMenu *button_menu)
Clean button menu.
Definition button_menu.c:307
View * button_menu_get_view(ButtonMenu *button_menu)
Get button menu view.
Definition button_menu.c:302
ButtonMenuItemType
Type of button.
Definition button_menu.h:25
void button_menu_set_header(ButtonMenu *button_menu, const char *header)
Set ButtonMenu header on top of canvas.
Definition button_menu.c:321
InputType
Input Types Some of them are physical events and some logical.
Definition input.h:21
Definition button_menu.c:29
Definition button_menu.c:19
Definition view_i.h:16
GUI: View API.