Skip to main content

ControlSlider

The ControlSlider class represents a slider control that allows the user to select a value within a specified range. It offers customization options such as setting the slider color, digits, step size, and base for exponential conversion. The class supports constraints, text enablement, and custom formatting for value display.

#include <interface/TellusimControls.h>

Inheritance

Constructors

ControlSlider()
explicit ControlSlider(Control *parent)
ControlSlider(Control *parent, const char *text)
ControlSlider(Control *parent, const String &text)
ControlSlider(Control *parent, const char *text, uint32_t digits)
ControlSlider(Control *parent, const char *text, uint32_t digits, float64_t value)
ControlSlider(Control *parent, const char *text, uint32_t digits, float64_t value, float64_t min, float64_t max)
ControlSlider(Control *parent, const char *text, float64_t value, float64_t min, float64_t max)
ControlSlider(Control *parent, const char *text, uint32_t value, uint32_t min, uint32_t max)
ControlSlider(Control *parent, const char *text, int32_t value, int32_t min, int32_t max)

Methods

Constrained flag.

void setConstrained(bool constrained)
bool isConstrained() const

Text enabled flag.

void setTextEnabled(bool enabled)
bool isTextEnabled() const

Slider color.

void setSliderColor(Color color)
const Color getSliderColor() const

Slider digits.

void setDigits(uint32_t digits)
uint32_t getDigits() const

Slider step.

void setStep(float64_t step)
float64_t getStep() const

Exponent base.

void setBase(float64_t base)
float64_t getBase() const

Slider format.

void setFormat(const char *format)
void setFormat(const String &format)
String getFormat() const

Slider value.

void setValue(float64_t value, bool callback = false, bool exponent = false)
float64_t getValue(bool exponent = false) const
float32_t getValuef32(bool exponent = false) const
uint32_t getValueu32(bool exponent = false) const
int32_t getValuei32(bool exponent = false) const
TypeNameDescription
boolcallbackRun changed callback on value change.
boolexponentperform exponential conversion.

Slider range.

void setRange(float64_t min, float64_t max, bool exponent = false)
float64_t getMinRange(bool exponent = false) const
float64_t getMaxRange(bool exponent = false) const
TypeNameDescription
boolexponentperform exponential conversion.

Handle size.

void setHandleSize(float32_t size)
float32_t getHandleSize() const

Format callback.

void setFormatCallback(const FormatCallback &func)
FormatCallback getFormatCallback() const

Pressed callback.

void setPressedCallback(const PressedCallback &func)
PressedCallback getPressedCallback() const
bool isPressed()

Released callback.

void setReleasedCallback(const ReleasedCallback &func)
ReleasedCallback getReleasedCallback() const
bool isReleased()

Clicked callback.

void setClickedCallback(const ClickedCallback &func)
void setClicked2Callback(const ClickedCallback &func)
void setClickedRightCallback(const ClickedCallback &func)
ClickedCallback getClickedCallback() const
ClickedCallback getClicked2Callback() const
ClickedCallback getClickedRightCallback() const
bool isClicked()

Changed callback.

void setChangedCallback(const ChangedCallback &func)
ChangedCallback getChangedCallback() const
bool isChanged(bool clear = true)

Canvas elements.

CanvasMesh getCanvasMesh()

Types

using FormatCallback = Function<String(ControlSlider)>
using PressedCallback = Function<void(ControlSlider)>
using ReleasedCallback = Function<void(ControlSlider)>
using ClickedCallback = Function<void(ControlSlider)>
using ChangedCallback = Function<void(ControlSlider)>