|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The draggable value with presets. See ui_slider.h. More...
Macros | |
| #define | SLIDER_SHADOW_DROP 2 |
Functions | |
| static float | clampf (float v, float lo, float hi) |
| void | ui_slider_init (ui_slider_t *s, gfx_rect_t track, float min, float max, gfx_color_t color) |
| void | ui_slider_set_ticks (ui_slider_t *s, int n) |
| void | ui_slider_set_presets (ui_slider_t *s, const float *values, const char *const *labels, int count, gfx_rect_t row) |
Sets the presets, laid out in a row inside row with 4px gaps. | |
| void | ui_slider_set (ui_slider_t *s, float value) |
| void | ui_slider_set_tap_to_set (ui_slider_t *s, bool on) |
| void | ui_slider_release (ui_slider_t *s) |
| static bool | by_delta (ui_slider_t *s, int x) |
| bool | ui_slider_event (ui_slider_t *s, const touch_event_t *evt) |
| gfx_rect_t | ui_slider_painted_rect (const ui_slider_t *s) |
| void | ui_slider_render (const ui_slider_t *s, gfx_canvas_t *c) |
The draggable value with presets. See ui_slider.h.
SPDX-License-Identifier: MIT
| bool ui_slider_event | ( | ui_slider_t * | s, |
| const touch_event_t * | evt ) |
Returns true when the value changed as a result of this event.
| gfx_rect_t ui_slider_painted_rect | ( | const ui_slider_t * | s | ) |
Every pixel ui_slider_render may touch, the thumb's overhang and its shadow included. A caller that repaints the slider without repainting everything around it clears this and not the track, or the thumb's old positions stay on the screen.
| void ui_slider_release | ( | ui_slider_t * | s | ) |
Abandon a drag that will get no release, on leaving a screen.
| void ui_slider_set_presets | ( | ui_slider_t * | s, |
| const float * | values, | ||
| const char *const * | labels, | ||
| int | count, | ||
| gfx_rect_t | row ) |
Sets the presets, laid out in a row inside row with 4px gaps.
| s | the slider |
| values | the presets' values |
| labels | their labels |
| count | how many |
| row | the row they take |
| void ui_slider_set_tap_to_set | ( | ui_slider_t * | s, |
| bool | on ) |
Let a press set the value under it. Off by default; a throttle must not take a value from one contact.
| void ui_slider_set_ticks | ( | ui_slider_t * | s, |
| int | n ) |
Draw n scale divisions across the track. 0 turns them off.