Radio box widget.
More...
|
| gui_handle_p | gui_radio_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags) |
| | Create new radio widget. More...
|
| |
| uint8_t | gui_radio_setcolor (gui_handle_p h, gui_radio_color_t index, gui_color_t color) |
| | Set color to specific part of widget. More...
|
| |
| uint8_t | gui_radio_setgroup (gui_handle_p h, uint8_t groupId) |
| | Set radio group for widget. More...
|
| |
| uint8_t | gui_radio_getgroup (gui_handle_p h) |
| | Get radio group for widget. More...
|
| |
| uint8_t | gui_radio_setvalue (gui_handle_p h, uint32_t value) |
| | Set value for widget when pressed. More...
|
| |
| uint32_t | gui_radio_getvalue (gui_handle_p h) |
| | Get value for specific widget. More...
|
| |
| uint32_t | gui_radio_getselectedvalue (gui_handle_p h) |
| | Get value of selected widget from widget group. More...
|
| |
| uint8_t | gui_radio_setdisabled (gui_handle_p h, uint8_t disabled) |
| | Disable widget to prevent state change. More...
|
| |
| uint8_t | gui_radio_isdisabled (gui_handle_p h) |
| | Check if radio is disabled. More...
|
| |
| uint8_t | gui_radio_setselected (gui_handle_p h) |
| | Set radio widget selected in radio group. More...
|
| |
Radio box widget.
Radiobox widget acts in a group of radio widgets to have support for single selection from multiple available choices
Radiobox widgets in different states
Sample code to create example image above
◆ gui_radio_color_t
List of radio colors.
| Enumerator |
|---|
| GUI_RADIO_COLOR_BG | Background color index
|
| GUI_RADIO_COLOR_FG | Foreground color index
|
| GUI_RADIO_COLOR_BORDER | Border color index
|
| GUI_RADIO_COLOR_DISABLED_BG | Background color index when disabled
|
| GUI_RADIO_COLOR_TEXT | Text color index
|
◆ gui_radio_create()
| gui_handle_p gui_radio_create |
( |
gui_id_t |
id, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height, |
|
|
gui_handle_p |
parent, |
|
|
gui_widget_evt_fn |
evt_fn, |
|
|
uint16_t |
flags |
|
) |
| |
Create new radio widget.
- Parameters
-
| [in] | id | Widget unique ID to use for identity for callback processing |
| [in] | x | Widget X position relative to parent widget |
| [in] | y | Widget Y position relative to parent widget |
| [in] | width | Widget width in units of pixels |
| [in] | height | Widget height in units of pixels |
| [in] | parent | Parent widget handle. Set to NULL to use current active parent widget |
| [in] | evt_fn | Custom widget callback function. Set to NULL to use default callback |
| [in] | flags | flags for widget creation |
- Returns
- Widget handle on success,
NULL otherwise
◆ gui_radio_getgroup()
| uint8_t gui_radio_getgroup |
( |
gui_handle_p |
h | ) |
|
Get radio group for widget.
- Parameters
-
- Returns
- Widget group
◆ gui_radio_getselectedvalue()
| uint32_t gui_radio_getselectedvalue |
( |
gui_handle_p |
h | ) |
|
Get value of selected widget from widget group.
- Note
- If
3 widgets share the same group ID, no matter which widget is used in this function, result will be always the same
- Parameters
-
- Returns
- Widget selected value
◆ gui_radio_getvalue()
| uint32_t gui_radio_getvalue |
( |
gui_handle_p |
h | ) |
|
Get value for specific widget.
- Parameters
-
- Returns
- Widget value
◆ gui_radio_isdisabled()
| uint8_t gui_radio_isdisabled |
( |
gui_handle_p |
h | ) |
|
Check if radio is disabled.
- Parameters
-
- Returns
1 on success, 0 otherwise
< Indicates radio is currently disabled
< Indicates radio is currently disabled
◆ gui_radio_setcolor()
Set color to specific part of widget.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | Color index |
| [in] | color | Color value |
- Returns
1 on success, 0 otherwise
◆ gui_radio_setdisabled()
| uint8_t gui_radio_setdisabled |
( |
gui_handle_p |
h, |
|
|
uint8_t |
disabled |
|
) |
| |
Disable widget to prevent state change.
- Parameters
-
| [in] | h | Widget handle |
| [in] | disabled | Set to 1 to disable, 0 otherwise |
- Returns
1 on success, 0 otherwise
◆ gui_radio_setgroup()
| uint8_t gui_radio_setgroup |
( |
gui_handle_p |
h, |
|
|
uint8_t |
groupId |
|
) |
| |
Set radio group for widget.
- Note
- Radio widgets with the same group must be on the same parent widget
- Parameters
-
| [in] | h | Widget handle |
| [in] | groupId | Group ID for widget |
- Returns
1 on success, 0 otherwise
◆ gui_radio_setselected()
| uint8_t gui_radio_setselected |
( |
gui_handle_p |
h | ) |
|
Set radio widget selected in radio group.
- Parameters
-
- Returns
1 on success, 0 otherwise
◆ gui_radio_setvalue()
| uint8_t gui_radio_setvalue |
( |
gui_handle_p |
h, |
|
|
uint32_t |
value |
|
) |
| |
Set value for widget when pressed.
- Parameters
-
| [in] | h | Widget handle |
| [in] | value | Value of widget group when specific widget is selected |
- Returns
1 on success, 0 otherwise
< Indicates radio is currently checked