Simple slider widget for user interaction.
More...
|
| gui_handle_p | gui_slider_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 slider widget. More...
|
| |
| uint8_t | gui_slider_setcolor (gui_handle_p h, gui_slider_color_t index, gui_color_t color) |
| | Set color to specific part of widget. More...
|
| |
| uint8_t | gui_slider_setmode (gui_handle_p h, gui_slider_mode_t mode) |
| | Set slider mode (orientation) More...
|
| |
| uint8_t | gui_slider_setmin (gui_handle_p h, int32_t val) |
| | Set slider minimal value. More...
|
| |
| uint8_t | gui_slider_setmax (gui_handle_p h, int32_t val) |
| | Set slider maximal value. More...
|
| |
| uint8_t | gui_slider_setvalue (gui_handle_p h, int32_t val) |
| | Set slider current value. More...
|
| |
| int32_t | gui_slider_getmin (gui_handle_p h) |
| | Get slider minimal value. More...
|
| |
| int32_t | gui_slider_getmax (gui_handle_p h) |
| | Get slider maximal value. More...
|
| |
| int32_t | gui_slider_getvalue (gui_handle_p h) |
| | Get slider current value. More...
|
| |
Simple slider widget for user interaction.
Simple slider widget to select range between 2 (min, max) values.
Slider widget in different states. On top is passive state (touch not active) and bottom is when touch is active
Example code of image above:
◆ gui_slider_color_t
List of slider colors.
| Enumerator |
|---|
| GUI_SLIDER_COLOR_BG_NONACTIVE | Background color index on slider part of non-active area
|
| GUI_SLIDER_COLOR_BG_ACTIVE | Background color index on slider part of active area
|
| GUI_SLIDER_COLOR_FG | Foreground color index for foreground (circle, ...) part
|
| GUI_SLIDER_COLOR_BORDER | Border color index for bottom part
|
◆ gui_slider_mode_t
List of slider modes.
| Enumerator |
|---|
| GUI_SLIDER_MODE_LEFT_RIGHT | Slider is horizontal, min on the left, max on the right
|
| GUI_SLIDER_MODE_RIGHT_LEFT | Slider is horizontal, min on the right, max on the left
|
| GUI_SLIDER_MODE_BOTTOM_TOP | Slider is horizontal, min on the bottom, max on the top
|
| GUI_SLIDER_MODE_TOP_BOTTOM | Slider is horizontal, min on the top, max on the bottom
|
◆ gui_slider_create()
| gui_handle_p gui_slider_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 slider 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 create procedure |
- Returns
- Widget handle on success,
NULL otherwise
◆ gui_slider_getmax()
| int32_t gui_slider_getmax |
( |
gui_handle_p |
h | ) |
|
Get slider maximal value.
- Parameters
-
- Returns
- Maximal value
◆ gui_slider_getmin()
| int32_t gui_slider_getmin |
( |
gui_handle_p |
h | ) |
|
Get slider minimal value.
- Parameters
-
- Returns
- Minimal value
◆ gui_slider_getvalue()
| int32_t gui_slider_getvalue |
( |
gui_handle_p |
h | ) |
|
Get slider current value.
- Parameters
-
- Returns
- Current value
◆ gui_slider_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_slider_setmax()
| uint8_t gui_slider_setmax |
( |
gui_handle_p |
h, |
|
|
int32_t |
val |
|
) |
| |
Set slider maximal value.
- Parameters
-
| [in] | h | Widget handle |
| [in] | val | New maximal value |
- Returns
1 on success, 0 otherwise
◆ gui_slider_setmin()
| uint8_t gui_slider_setmin |
( |
gui_handle_p |
h, |
|
|
int32_t |
val |
|
) |
| |
Set slider minimal value.
- Parameters
-
| [in] | h | Widget handle |
| [in] | val | New minimal value |
- Returns
1 on success, 0 otherwise
◆ gui_slider_setmode()
Set slider mode (orientation)
- Parameters
-
| [in] | h | Widget handle |
| [in] | mode | Slider mode |
- Returns
1 on success, 0 otherwise
◆ gui_slider_setvalue()
| uint8_t gui_slider_setvalue |
( |
gui_handle_p |
h, |
|
|
int32_t |
val |
|
) |
| |
Set slider current value.
- Parameters
-
| [in] | h | Widget handle |
| [in] | val | New current value |
- Returns
1 on success, 0 otherwise