lv_group.h
API reference for lv_group.h
Functions
lv_group_set_default
Set default group. New Widgets will be added to this group if it's enabled in their class with add_to_def_group = true.
void lv_group_set_default(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group May be NULL.. When NULL no default group is set. |
lv_group_set_focus_cb
Set a function for a group which will be called when a new Widget has focus.
void lv_group_set_focus_cb(lv_group_t *group, lv_group_focus_cb_t focus_cb)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
focus_cb | lv_group_focus_cb_t | the call back function or NULL if unused |
lv_group_set_edge_cb
Set a function for a group which will be called when a focus edge is reached
void lv_group_set_edge_cb(lv_group_t *group, lv_group_edge_cb_t edge_cb)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
edge_cb | lv_group_edge_cb_t | the call back function or NULL if unused |
lv_group_set_refocus_policy
Set whether the next or previous Widget in a group gets focus when Widget that has focus is deleted.
void lv_group_set_refocus_policy(lv_group_t *group, lv_group_refocus_policy_t policy)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
policy | lv_group_refocus_policy_t | new refocus policy enum |
lv_group_set_editing
Manually set the current mode (edit or navigate).
void lv_group_set_editing(lv_group_t *group, bool edit)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to group |
edit | bool | true: edit mode; false: navigate mode |
lv_group_set_wrap
Set whether moving focus to next/previous Widget will allow wrapping from first->last or last->first Widget.
void lv_group_set_wrap(lv_group_t *group, bool en)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to group |
en | bool | true: wrapping enabled; false: wrapping disabled |
lv_group_set_external_data
Attaches external user data and destructor callback to a group.
Associates custom user data with an LVGL group and specifies a destructor function that will be automatically invoked when the group is deleted to properly clean up the associated resources.
void lv_group_set_external_data(lv_group_t *group, void *data, void(*free_cb)(void *data))| Name | Type | Description |
|---|---|---|
group | lv_group_t * | Pointer to a group |
data | void * | User-defined data pointer to associate with a group May be NULL. |
free_cb | void(*)(void *data) | Callback function for cleaning up ext_data when group is deleted. Receives data as parameter. May be NULL. When NULL no cleanup is performed. |
lv_group_set_user_data
Set user data to the group
void lv_group_set_user_data(lv_group_t *group, void *user_data)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
user_data | void * | pointer to user data May be NULL. |
lv_group_get_default
Get default group.
lv_group_t * lv_group_get_default(void)Returns: lv_group_t * — pointer to the default group
lv_group_get_focused
Get Widget that has focus, or NULL if there isn't one.
lv_obj_t * lv_group_get_focused(const lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | const lv_group_t * | pointer to a group |
Returns: lv_obj_t * — pointer to Widget with focus
lv_group_get_focus_cb
Get focus callback function of a group.
lv_group_focus_cb_t lv_group_get_focus_cb(const lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | const lv_group_t * | pointer to a group |
Returns: lv_group_focus_cb_t — the call back function or NULL if not set
lv_group_get_edge_cb
Get edge callback function of a group.
lv_group_edge_cb_t lv_group_get_edge_cb(const lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | const lv_group_t * | pointer to a group |
Returns: lv_group_edge_cb_t — the call back function or NULL if not set
lv_group_get_editing
Get current mode (edit or navigate).
bool lv_group_get_editing(const lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | const lv_group_t * | pointer to group |
Returns: bool — true: edit mode; false: navigate mode
lv_group_get_wrap
Get whether moving focus to next/previous Widget will allow wrapping from first->last or last->first Widget.
bool lv_group_get_wrap(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to group |
lv_group_get_obj_count
Get number of Widgets in group.
uint32_t lv_group_get_obj_count(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
Returns: uint32_t — number of Widgets in the group
lv_group_get_obj_by_index
Get nth Widget within group.
lv_obj_t * lv_group_get_obj_by_index(lv_group_t *group, uint32_t index)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
index | uint32_t | index of Widget within the group |
Returns: lv_obj_t * — pointer to Widget
lv_group_get_count
Get the number of groups.
uint32_t lv_group_get_count(void)Returns: uint32_t — number of groups
lv_group_get_user_data
Get a pointer to the user data of the group
void * lv_group_get_user_data(const lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | const lv_group_t * | pointer to a group |
Returns: void * — pointer to the user data or NULL if group is NULL
lv_group_create
Create new Widget group.
lv_group_t * lv_group_create(void)Returns: lv_group_t * — pointer to the new Widget group
lv_group_delete
Delete group object.
void lv_group_delete(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group May be NULL. |
lv_group_add_obj
Add an Widget to group.
void lv_group_add_obj(lv_group_t *group, lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
obj | lv_obj_t * | pointer to a Widget to add |
lv_group_swap_obj
Swap 2 Widgets in group. Widgets must be in the same group.
void lv_group_swap_obj(lv_obj_t *obj1, lv_obj_t *obj2)| Name | Type | Description |
|---|---|---|
obj1 | lv_obj_t * | pointer to a Widget |
obj2 | lv_obj_t * | pointer to another Widget |
lv_group_remove_obj
Remove a Widget from its group.
void lv_group_remove_obj(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Widget to remove |
lv_group_remove_all_objs
Remove all Widgets from a group.
void lv_group_remove_all_objs(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
lv_group_focus_obj
Focus on a Widget (defocus the current).
void lv_group_focus_obj(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to Widget to focus on |
lv_group_focus_next
Focus on next Widget in a group (defocus the current).
void lv_group_focus_next(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
lv_group_focus_prev
Focus on previous Widget in a group (defocus the current).
void lv_group_focus_prev(lv_group_t *group)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
lv_group_focus_freeze
Do not allow changing focus from current Widget.
void lv_group_focus_freeze(lv_group_t *group, bool en)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
en | bool | true: freeze, false: release freezing (normal mode) |
lv_group_send_data
Send a control character to Widget that has focus in a group.
lv_result_t lv_group_send_data(lv_group_t *group, uint32_t c)| Name | Type | Description |
|---|---|---|
group | lv_group_t * | pointer to a group |
c | uint32_t | a character (use LV_KEY_.. to navigate) |
Returns: lv_result_t — result of Widget with focus in group.
lv_group_by_index
Get a group by its index.
lv_group_t * lv_group_by_index(uint32_t index)| Name | Type | Description |
|---|---|---|
index | uint32_t | index of the group |
Returns: lv_group_t * — pointer to the group
Enums
lv_key_t
Predefined keys to control which Widget has focus via lv_group_send(group, c)
| Name | Value |
|---|---|
LV_KEY_UP | 17 |
LV_KEY_DOWN | 18 |
LV_KEY_RIGHT | 19 |
LV_KEY_LEFT | 20 |
LV_KEY_ESC | 27 |
LV_KEY_DEL | 127 |
LV_KEY_BACKSPACE | 8 |
LV_KEY_ENTER | 10 |
LV_KEY_NEXT | 9 |
LV_KEY_PREV | 11 |
LV_KEY_HOME | 2 |
LV_KEY_END | 3 |
lv_group_refocus_policy_t
| Name | Value |
|---|---|
LV_GROUP_REFOCUS_POLICY_NEXT | 0 |
LV_GROUP_REFOCUS_POLICY_PREV | 1 |
Used by 1 function
lv_group_set_refocus_policy— parampolicy
Typedefs
lv_group_focus_cb_t
typedef void(* lv_group_focus_cb_t) (lv_group_t *)Used by 1 function
lv_group_set_focus_cb— paramfocus_cb
lv_group_edge_cb_t
typedef void(* lv_group_edge_cb_t) (lv_group_t *, bool)Used by 1 function
lv_group_set_edge_cb— paramedge_cb
Dependencies
Last updated on