class

AToggleSwitch

Module
Arc
Header
#include "Arc/Widgets/AToggleSwitch.h"
Namespace
Arcf

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetIsChecked
boolIsChecked
voidToggle
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
voidOnMouseEnter
voidOnMouseLeave
boolCanCacheDesiredSizeThe track dimensions are the desired size; the knob animates inside it without touching layout.
boolCanRetainPaintRefused while the knob slides — that is a clock, and every frame of it is a different picture with nothing to invalidate on.
const char*GetTypeName
EAccessibleRoleGetAccessibleRole
std::stringGetAccessibleValue
boolIsFocusable
floatGetFocusRadius
floatGetTrackWidthtoggle.json's track and knob unless the host passed its own.
floatGetTrackHeight
floatGetKnobSize
floatGetKnobInset
boolOnActivate

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AToggleSwitch) ARC_ATTR(bool, IsChecked) ARC_ATTR(ArcColor, OnColor) ARC_ATTR(ArcColor, OffColor) ARC_ATTR(ArcColor, OnKnobColor) ARC_ATTR(ArcColor, OffKnobColor) ARC_ARG(float, TrackWidth) ARC_ARG(float, TrackHeight) ARC_ARG(float, KnobSize) ARC_ARG(float, KnobInset) ARC_EVENT(COnBoolChanged, OnCheckStateChanged) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetIsChecked

C++
void SetIsChecked(bool checked)

IsChecked

C++
bool IsChecked() const

Toggle

C++
void Toggle()

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseEnter

C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) override

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

The track dimensions are the desired size; the knob animates inside it without touching layout.

CanRetainPaint

C++
bool CanRetainPaint() const override

Refused while the knob slides — that is a clock, and every frame of it is a different picture with nothing to invalidate on. SetChecked and the hover handlers already invalidate, so the settled frame after the slide cannot replay the knob from before it.

GetTypeName

C++
const char* GetTypeName() const override

GetAccessibleRole

C++
EAccessibleRole GetAccessibleRole() const override

GetAccessibleValue

C++
std::string GetAccessibleValue() const override

IsFocusable

C++
bool IsFocusable() const override

GetFocusRadius

C++
float GetFocusRadius() const override

GetTrackWidth

C++
float GetTrackWidth() const

toggle.json's track and knob unless the host passed its own.

GetTrackHeight

C++
float GetTrackHeight() const

GetKnobSize

C++
float GetKnobSize() const

GetKnobInset

C++
float GetKnobInset() const

OnActivate

C++
bool OnActivate() override
Generated from Arc/Widgets/AToggleSwitch.h via arc.json · Nov 5, 2026Version 1.0.0