class
AToggleSwitch
- Module
- Arc
- Header
#include "Arc/Widgets/AToggleSwitch.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | SetIsChecked | |
bool | IsChecked | |
void | Toggle | |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
void | OnMouseEnter | |
void | OnMouseLeave | |
bool | CanCacheDesiredSize | The track dimensions are the desired size; the knob animates inside it without touching layout. |
bool | CanRetainPaint | Refused 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 | |
EAccessibleRole | GetAccessibleRole | |
std::string | GetAccessibleValue | |
bool | IsFocusable | |
float | GetFocusRadius | |
float | GetTrackWidth | toggle.json's track and knob unless the host passed its own. |
float | GetTrackHeight | |
float | GetKnobSize | |
float | GetKnobInset | |
bool | OnActivate |
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() constToggle
C++
void Toggle()ComputeDesiredSize
C++
ArcVec2 ComputeDesiredSize(float scale) const overrideOnPaint
C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseEnter
C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseLeave
C++
void OnMouseLeave(const CPointerEvent& event) overrideCanCacheDesiredSize
C++
bool CanCacheDesiredSize() const overrideThe track dimensions are the desired size; the knob animates inside it without touching layout.
CanRetainPaint
C++
bool CanRetainPaint() const overrideRefused 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 overrideGetAccessibleRole
C++
EAccessibleRole GetAccessibleRole() const overrideGetAccessibleValue
C++
std::string GetAccessibleValue() const overrideIsFocusable
C++
bool IsFocusable() const overrideGetFocusRadius
C++
float GetFocusRadius() const overrideGetTrackWidth
C++
float GetTrackWidth() consttoggle.json's track and knob unless the host passed its own.
GetTrackHeight
C++
float GetTrackHeight() constGetKnobSize
C++
float GetKnobSize() constGetKnobInset
C++
float GetKnobInset() constOnActivate
C++
bool OnActivate() overrideGenerated from Arc/Widgets/AToggleSwitch.h via arc.json · Nov 5, 2026Version 1.0.0