class
MToggleSwitch
- Module
- Miri
- Header
#include "Miri/Widgets/MToggleSwitch.h"- Namespace
Miri
Public functions
| Returns | Name | Description |
|---|---|---|
MIRI_WIDGET_ARGS | ||
void | SetIsChecked | |
bool | IsChecked | |
void | Toggle | |
MiriVec2 | 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
MIRI_WIDGET_ARGS
C++
MIRI_WIDGET_ARGS(MToggleSwitch) MIRI_ATTR(bool, IsChecked) MIRI_ATTR(MiriColor, OnColor) MIRI_ATTR(MiriColor, OffColor) MIRI_ATTR(MiriColor, OnKnobColor) MIRI_ATTR(MiriColor, OffKnobColor) MIRI_ARG(float, TrackWidth) MIRI_ARG(float, TrackHeight) MIRI_ARG(float, KnobSize) MIRI_ARG(float, KnobInset) MIRI_EVENT(COnBoolChanged, OnCheckStateChanged) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)SetIsChecked
C++
void SetIsChecked(bool checked)IsChecked
C++
bool IsChecked() constToggle
C++
void Toggle()ComputeDesiredSize
C++
MiriVec2 ComputeDesiredSize(float scale) const overrideOnPaint
C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& 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 Miri/Widgets/MToggleSwitch.h via miri.json · Dec 5, 2026Version 1.1.0