![]() |
BSB Developer Docs
|
Widget that contains a list of variable items. More...
#include <gui/widget.h>Go to the source code of this file.
Data Structures | |
| struct | VarItemKeyValue |
Typedefs | |
| typedef struct VarItemList | VarItemList |
| VarItemList opaque structure. | |
| typedef struct VarItem | VarItem |
| VarItem opaque structure. | |
| typedef void(* | VarItemChangeCallback) (VarItem *item, void *context) |
| VarItemList item callback function type. | |
Enumerations | |
| enum | VarItemFlag { VarItemFlagMinIsInf = 1UL << 0 , VarItemFlagMaxIsInf = 1UL << 1 } |
| Flags to modify the item behaviour (can be combined). More... | |
Functions | |
| VarItemList * | var_item_list_alloc (Widget *parent) |
| Create a new VarItemList instance. | |
| void | var_item_list_free (VarItemList *instance) |
| Delete a VarItemList instance and all of its items. | |
| Widget * | var_item_list_get_base (VarItemList *instance) |
| Get a pointer to the base class instance. | |
| VarItem * | var_item_list_add_timebox (VarItemList *instance, const char *label, int32_t min_mn, int32_t max_mn, uint32_t step_mn, VarItemChangeCallback callback, void *context) |
| Add a time selection item. | |
| VarItem * | var_item_list_add_spinbox (VarItemList *instance, const char *label, const char *suffix, int32_t min, int32_t max, uint32_t step, VarItemChangeCallback callback, void *context) |
| Add a numeric value selection item. | |
| VarItem * | var_item_list_add_selector (VarItemList *instance, const char *label, const char *suffix, const char *choice_text[], uint32_t choice_count, VarItemChangeCallback callback, void *context) |
| Add a value list selection item. | |
| VarItem * | var_item_list_add_selector_key_value (VarItemList *instance, const char *label, const char *suffix, const VarItemKeyValue *choice_key_val, uint32_t choice_count, VarItemChangeCallback callback, void *context) |
| Add a key:value list select element. | |
| VarItem * | var_item_list_add_switch (VarItemList *instance, const char *label, VarItemChangeCallback callback, void *context) |
| Add a binary switch (on-off) item. | |
| void | var_item_set_value (VarItem *item, int32_t value) |
| Set the current item value. | |
| void | var_item_set_value_key_value (VarItem *item, const VarItemKeyValue *choice_key_val, int32_t value) |
| Set the current item value. | |
| int32_t | var_item_get_value (const VarItem *item) |
| Get the current item value. | |
| void | var_item_set_flags (VarItem *item, uint32_t flags) |
| Set extra item behaviours via flags. | |
| bool | var_item_list_exit_edit_mode (VarItemList *instance, bool apply_changes) |
| Exit edit mode and return to item selection mode. | |
| void | var_item_list_enter_edit_mode (VarItemList *instance, VarItem *item) |
| Focus an item and enter edit mode on it. | |
| void | var_item_focus (VarItem *item) |
| Focus on a list item. | |
Widget that contains a list of variable items.
| enum VarItemFlag |
| int32_t var_item_get_value | ( | const VarItem * | item | ) |
Get the current item value.
This function has a different meaning depending on the item type:
| [in] | item | pointer to the item to be queried |
| VarItem * var_item_list_add_selector | ( | VarItemList * | instance, |
| const char * | label, | ||
| const char * | suffix, | ||
| const char * | choice_text[], | ||
| uint32_t | choice_count, | ||
| VarItemChangeCallback | callback, | ||
| void * | context ) |
Add a value list selection item.
| [in,out] | instance | pointer to the VarItemList instance to be modified |
| [in] | label | zero-terminated string containing the item label |
| [in] | suffix | zero-terminated string containing the item suffix (may be NULL) |
| [in] | choice_text | pointer to an array of zero-terminated strings containing choice labels |
| [in] | choice_count | number of elements in the choice_text array |
| [in] | callback | pointer to the function to call upon value being changed |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
| VarItem * var_item_list_add_selector_key_value | ( | VarItemList * | instance, |
| const char * | label, | ||
| const char * | suffix, | ||
| const VarItemKeyValue * | choice_key_val, | ||
| uint32_t | choice_count, | ||
| VarItemChangeCallback | callback, | ||
| void * | context ) |
Add a key:value list select element.
| [in,out] | instance | pointer to the VarItemList instance to be modified |
| [in] | label | zero-terminated string containing the item label |
| [in] | suffix | zero-terminated string containing the item suffix (may be NULL) |
| [in] | choice_key_val | pointer to an array of VarItemKeyValue structures |
| [in] | choice_count | number of elements in the choice_text array |
| [in] | callback | pointer to the function to call upon value being changed |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
| VarItem * var_item_list_add_spinbox | ( | VarItemList * | instance, |
| const char * | label, | ||
| const char * | suffix, | ||
| int32_t | min, | ||
| int32_t | max, | ||
| uint32_t | step, | ||
| VarItemChangeCallback | callback, | ||
| void * | context ) |
Add a numeric value selection item.
| [in,out] | instance | pointer to the VarItemList instance to be modified |
| [in] | label | zero-terminated string containing the item label |
| [in] | suffix | zero-terminated string containing the item suffix (may be NULL) |
| [in] | min | minimum allowed value |
| [in] | max | maximum allowed value |
| [in] | step | step or increment |
| [in] | callback | pointer to the function to call upon value being changed |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
| VarItem * var_item_list_add_switch | ( | VarItemList * | instance, |
| const char * | label, | ||
| VarItemChangeCallback | callback, | ||
| void * | context ) |
Add a binary switch (on-off) item.
| [in,out] | instance | pointer to the VarItemList instance to be modified |
| [in] | label | zero-terminated string containing the item label |
| [in] | callback | pointer to the function to call upon value being changed |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
| VarItem * var_item_list_add_timebox | ( | VarItemList * | instance, |
| const char * | label, | ||
| int32_t | min_mn, | ||
| int32_t | max_mn, | ||
| uint32_t | step_mn, | ||
| VarItemChangeCallback | callback, | ||
| void * | context ) |
Add a time selection item.
| [in,out] | instance | pointer to the VarItemList instance to be modified |
| [in] | label | zero-terminated string containing the item label |
| [in] | min_mn | minimum allowed value, in minutes |
| [in] | max_mn | maximum allowed value, in minutes |
| [in] | step_mn | step or increment, in minutes |
| [in] | callback | pointer to the function to call upon value being changed |
| [in,out] | context | pointer to a user-specific object, will be passed to callback |
| VarItemList * var_item_list_alloc | ( | Widget * | parent | ) |
Create a new VarItemList instance.
| [in,out] | parent | pointer to the parent Widget instance |
| void var_item_list_enter_edit_mode | ( | VarItemList * | instance, |
| VarItem * | item ) |
Focus an item and enter edit mode on it.
If another item is being edited, it is exited first.
| [in,out] | instance | pointer to the VarItemList instance which contains the item |
| [in] | item | item to focus and edit |
| bool var_item_list_exit_edit_mode | ( | VarItemList * | instance, |
| bool | apply_changes ) |
Exit edit mode and return to item selection mode.
| [in,out] | instance | pointer to the VarItemList instance which contains the edited item |
| [in] | apply_changes | if false, VarItemChangeCallback will not be called |
| void var_item_list_free | ( | VarItemList * | instance | ) |
Delete a VarItemList instance and all of its items.
| [in,out] | instance | pointer to the VarItemList instance to be deleted |
| Widget * var_item_list_get_base | ( | VarItemList * | instance | ) |
Get a pointer to the base class instance.
The return value can be used in all Widget methods.
| [in,out] | instance | pointer to the VarItemList instance to be queried |
| void var_item_set_flags | ( | VarItem * | item, |
| uint32_t | flags ) |
Set extra item behaviours via flags.
| [in,out] | item | pointer to the item to be modified |
| [in] | flags | a bitmask of flags to be set (will replace current one) |
| void var_item_set_value | ( | VarItem * | item, |
| int32_t | value ) |
Set the current item value.
This function has a different meaning depending on the item type:
| [in,out] | item | pointer to the item to be modified |
| [in] | value | value to be set |
| void var_item_set_value_key_value | ( | VarItem * | item, |
| const VarItemKeyValue * | choice_key_val, | ||
| int32_t | value ) |
Set the current item value.
This function has a different meaning depending on the item type:
| [in,out] | item | pointer to the item to be modified |
| [in] | choice_key_val | pointer to the array of VarItemKeyValue structures |
| [in] | value | value to be set |