GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A radio button widget. More...
#include <widgets/gp_widget_class_choice.h>
Go to the source code of this file.
Functions | |
static gp_widget * | gp_widget_radiobutton_new (const char *choices[], size_t cnt, size_t sel) |
Allocates and initializes new radiobutton widget. | |
static gp_widget * | gp_widget_radiobutton_ops_new (const struct gp_widget_choice_ops *ops) |
Creates a radiobutton widget based on widget ops. | |
static gp_widget * | gp_widget_radiobutton_arr_new (const void *array, size_t memb_cnt, uint16_t memb_size, uint16_t memb_off, size_t sel, enum gp_widget_choice_flags flags) |
Creates a radiobutton widget based on a static array. | |
A radio button widget.
Radio button is a choice class widget, after it's created it's acessed by the class functions such as gp_widget_choice_sel_set().
Attribute | Type | Default | Description |
---|---|---|---|
choices | array of strings | List of choices. | |
ops | string | The gp_widget_choice_ops structure id. | |
selected | uint or string | 0 | Currently selected choice name or index. |
Only one of the choices or ops can be present for a widget. If choices is present all the choices are statically defined in the widget JSON description. If ops is set it points to a gp_widget_choice_ops structure with callbacks to retrieve the choices at a runtime, this is usally used when the choices are produced by another library e.g. hardware discovery.
Definition in file gp_widget_radiobutton.h.
|
inlinestatic |
Creates a radiobutton widget based on a static array.
Example use:
array | A pointer an array. |
memb_cnt | An array size, i.e. number of elements. |
memb_size | An array member size, e.g. sizeof(struct foo) |
memb_off | An offset of the string for the choice in the array, e.g. offsetof(struct foo, str_elem) |
sel | A selected choice. |
flags | A bitwise combination of flags. |
Definition at line 103 of file gp_widget_radiobutton.h.
References gp_widget_choice_arr_new(), and GP_WIDGET_RADIOBUTTON.
|
inlinestatic |
Allocates and initializes new radiobutton widget.
choices | An array of strings describing available choices. |
cnt | Size of the choices array. |
sel | Initially selected choice. |
Definition at line 49 of file gp_widget_radiobutton.h.
References gp_widget_choice_new(), and GP_WIDGET_RADIOBUTTON.
|
inlinestatic |
Creates a radiobutton widget based on widget ops.
ops | A pointer to the choice widget ops. |
Definition at line 63 of file gp_widget_radiobutton.h.
References gp_widget_choice_ops_new(), and GP_WIDGET_RADIOBUTTON.