Skip to main content

ControlCheck

The ControlCheck class provides a UI control for a checkable text element, typically rendered as a checkbox with an associated label. It allows customization of check and checked colors, handles checked state toggling, and supports a ClickedCallback to respond to user interaction. It inherits from ControlText, enabling full styling and text layout capabilities, and uses CanvasMesh for rendering the checkbox graphic.

#include <interface/TellusimControls.h>

Inheritance

Constructors

ControlCheck()
explicit ControlCheck(Control *parent)
ControlCheck(Control *parent, const char *text)
ControlCheck(Control *parent, const String &text)
ControlCheck(Control *parent, const char *text, bool checked)
ControlCheck(Control *parent, const String &text, bool checked)

Methods

Check text.

void setCheckText(const char *text)
void setCheckText(const String &text)
String getCheckText() const

Check color.

void setCheckColor(Color color)
const Color getCheckColor() const

Checked color.

void setCheckedColor(Color color)
const Color getCheckedColor() const

Checked state.

bool switchChecked(bool callback = false)
void setChecked(bool checked, bool callback = false)
bool isChecked() const

Clicked callback.

void setClickedCallback(const ClickedCallback &func)
ClickedCallback getClickedCallback() const
bool isClicked()

Canvas elements.

CanvasMesh getCanvasMesh()

Types

using ClickedCallback = Function<void(ControlCheck)>