Slider
A slider bar for selecting numerical value.
| Header | #include "nativeui/slider.h" |
| Namespace | namespace nu |
| Type | class (RefCounted) |
| Inherits | View |
The default range is between 0 and 100.
Constructors
Slider()
Create a new Slider view.
Class properties
const char* kClassName
The class name of this view.
Methods
void SetValue(float value)
Set the value.
Parameters
floatvalue
float GetValue() const
Return the value.
Return
floatvoid SetStep(float step)
Set the step value of the slider.
Parameters
floatstep
float GetStep() const
Return the step value of the slider.
Return
floatvoid SetRange(float min, float max)
Set the range of the slider.
Parameters
floatminfloatmax
std::tuple<float, float> GetRange() const
Return the range of the slider.
Return
std::tupleEvents
void on_value_change(Slider* self)
Emitted when user is changing the slider.
Parameters
Slider*self
Preventable
No.void on_sliding_complete(Slider* self)
Emitted when user releases the slider.
Note that this event only emits when user was dragging the slider with mouse or trackpad, it does not emit when user was moving the slider with keyboard.
Parameters
Slider*self