Plain text menu widget.
More...
Go to the source code of this file.
|
|
typedef struct Submenu | Submenu |
| | Submenu opaque structure.
|
| |
| typedef void(* | SubmenuItemCallback) (uint32_t index, void *context) |
| | Submenu item callback function type.
|
| |
◆ SubmenuItemCallback
| typedef void(* SubmenuItemCallback) (uint32_t index, void *context) |
Submenu item callback function type.
- Parameters
-
| [in] | index | index value that the item was created with |
| [in,out] | context | pointer to a user-specific object |
◆ submenu_add_item()
| void submenu_add_item |
( |
Submenu * | instance, |
|
|
const char * | primary_text, |
|
|
const char * | auxiliary_text, |
|
|
uint32_t | index, |
|
|
SubmenuItemCallback | callback, |
|
|
void * | context ) |
Add an item to a Submenu instance.
- Parameters
-
| [in,out] | instance | pointer to the Submenu instance to be modified |
| [in] | primary_text | zero-terminated string for the item's primary label |
| [in] | auxiliary_text | zero-terminated string for the item's auxiliary label, passing NULL hides the label |
| [in] | index | item identifier, doesn't have to be unique |
| [in] | callback | pointer to the function to be called when the item is clicked |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
◆ submenu_alloc()
Create a new Submenu instance.
- Parameters
-
| [in,out] | parent | pointer to the parent Widget instance |
- Returns
- pointer to the newly created Submenu instance
◆ submenu_free()
| void submenu_free |
( |
Submenu * | instance | ) |
|
Delete a Submenu instance.
- Parameters
-
| [in,out] | instance | pointer to the Submenu instance to be deleted |
◆ submenu_get_base()
Get a pointer to the base class instance.
The return value can be used in all Widget methods.
- Parameters
-
| [in,out] | instance | pointer to the Submenu instance to be queried |
- Returns
- pointer to the base class instance
◆ submenu_get_selected_item_index()
| uint32_t submenu_get_selected_item_index |
( |
const Submenu * | instance | ) |
|
Get the index of the selected item in a Submenu instance.
- Parameters
-
| [in] | instance | pointer to the Submenu instance to be queried |
- Returns
- index of the selected item that was provided when adding it
◆ submenu_reset()
| void submenu_reset |
( |
Submenu * | instance | ) |
|
Remove all items from a Submenu instance.
- Parameters
-
| [in,out] | instance | pointer to the Submenu instance to be modified |
◆ submenu_set_selected_item_index()
| void submenu_set_selected_item_index |
( |
Submenu * | instance, |
|
|
uint32_t | index ) |
Select the item in a Submenu instance with a matching index.
- Note
- If two or more items share the same index, only the first of them will be selected.
- Parameters
-
| [in,out] | instance | pointer to the Submenu instance to be modified |
| [in] | index | the index of the item to be selected |