![]() |
BSB Developer Docs
|
Simple two options selection widget. More...
Go to the source code of this file.
Typedefs | |
| typedef struct Dialog | Dialog |
| Dialog opaque structure. | |
| typedef void(* | DialogCallback) (uint8_t result, void *context) |
| Dialog callback function type. | |
Functions | |
| Dialog * | dialog_alloc (Widget *parent) |
| Create a new Dialog instance. | |
| void | dialog_free (Dialog *instance) |
| Delete a Dialog instance. | |
| Widget * | dialog_get_base (Dialog *instance) |
| Get a pointer to the base class instance. | |
| void | dialog_set_callback (Dialog *instance, DialogCallback callback, void *context) |
| Set a dialog selection callback. | |
| void | dialog_set_icon (Dialog *instance, const char *icon_source) |
| Set the icon displayed by the Dialog. | |
| void | dialog_set_text (Dialog *instance, const char *text) |
| Set a main text label value. | |
| void | dialog_set_text_sub (Dialog *instance, const char *text) |
| Set an extra text label value. | |
| void | dialog_set_options (Dialog *instance, const char *text_0, const char *text_1) |
| Set options text. | |
| void | dialog_set_option_colors (Dialog *instance, Color color_0, Color color_1) |
| Set options color. | |
| void | dialog_select_option (Dialog *instance, uint8_t index) |
| Set dialog option selection. | |
Simple two options selection widget.
| typedef void(* DialogCallback) (uint8_t result, void *context) |
Dialog callback function type.
| [in] | result | selected option (0/1) |
| [in,out] | context | pointer to a user-specific object |
Create a new Dialog instance.
| [in,out] | parent | pointer to the parent Widget instance |
| void dialog_free | ( | Dialog * | instance | ) |
Delete a Dialog instance.
| [in,out] | instance | pointer to the Dialog instance to be deleted |
Get a pointer to the base class instance.
The return value can be used in all Widget methods.
| [in,out] | instance | pointer to the Dialog instance to be queried |
| void dialog_select_option | ( | Dialog * | instance, |
| uint8_t | index ) |
Set dialog option selection.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | index | selected option (0/1) |
| void dialog_set_callback | ( | Dialog * | instance, |
| DialogCallback | callback, | ||
| void * | context ) |
Set a dialog selection callback.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | callback | callback function pointer |
| [in] | context | callback context |
| void dialog_set_icon | ( | Dialog * | instance, |
| const char * | icon_source ) |
Set the icon displayed by the Dialog.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | icon_source | zero-terminated string containing the icon file path (NULL to hide) |
Set options color.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | color_0 | color of the first option |
| [in] | color_1 | color of the second option |
| void dialog_set_options | ( | Dialog * | instance, |
| const char * | text_0, | ||
| const char * | text_1 ) |
Set options text.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | text_0 | text of the first option |
| [in] | text_1 | text of the second option |
| void dialog_set_text | ( | Dialog * | instance, |
| const char * | text ) |
Set a main text label value.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | text | zero-terminated string containing the text |
| void dialog_set_text_sub | ( | Dialog * | instance, |
| const char * | text ) |
Set an extra text label value.
| [in,out] | instance | pointer to the Dialog instance to be modified |
| [in] | text | zero-terminated string containing the text (NULL to disable this label) |