class

MSlider

Module
Miri
Header
#include "Miri/Widgets/MSlider.h"
Namespace
Miri

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
CReplyOnKeyDownArrows step a hundredth of the range, PageUp/PageDown a tenth, Home/End jump to the ends.
voidOnMouseCaptureLost
voidOnMouseEnter
EMiriCursorTypeOnCursorQuery
MiriRectGetTrackRectslider.json's track: a thumb's travel stays inside it, so the thumb at 0 and at 1 sits flush with the track's ends.
MiriRectGetThumbRect
EFocusVisualGetFocusVisualThe ring goes round the thumb, not the slot the slider is stretched across: the paint draws it there, concentric with the thumb.
boolPaintsOwnFocus
voidSetValue
floatGetValue
boolCanCacheDesiredSizeA fixed track; the handle position is a paint-time concern.
boolCanRetainPaintA leaf whose whole picture is the value, the drag tint and four colours.
const char*GetTypeName
EAccessibleRoleGetAccessibleRole
std::stringGetAccessibleValue
boolIsFocusable

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MSlider) MIRI_ATTR(float, Value) MIRI_ARG(float, MinValue) MIRI_ARG(float, MaxValue) MIRI_EVENT(COnFloatChanged, OnValueChanged) MIRI_ATTR(MiriColor, TrackColor) MIRI_ATTR(MiriColor, FillColor) MIRI_ATTR(MiriColor, ThumbColor) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& 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

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

Arrows step a hundredth of the range, PageUp/PageDown a tenth, Home/End jump to the ends. A key at the limit it would push past is declined so the panel around the slider can use it.

OnMouseCaptureLost

C++
void OnMouseCaptureLost() override

OnMouseEnter

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

OnCursorQuery

C++
EMiriCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const override

GetTrackRect

C++
MiriRect GetTrackRect(const CGeometry& geo) const

slider.json's track: a thumb's travel stays inside it, so the thumb at 0 and at 1 sits flush with the track's ends.

GetThumbRect

C++
MiriRect GetThumbRect(const CGeometry& geo) const

GetFocusVisual

C++
EFocusVisual GetFocusVisual() const override

The ring goes round the thumb, not the slot the slider is stretched across: the paint draws it there, concentric with the thumb.

PaintsOwnFocus

C++
bool PaintsOwnFocus() const override

SetValue

C++
void SetValue(float value)

GetValue

C++
float GetValue() const

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A fixed track; the handle position is a paint-time concern.

CanRetainPaint

C++
bool CanRetainPaint() const override

A leaf whose whole picture is the value, the drag tint and four colours. The value and the drag flag both announce themselves; a bound attribute can hand back a new one with no write to see, which is the only case that has to refuse.

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
Generated from Miri/Widgets/MSlider.h via miri.json · Dec 5, 2026Version 1.1.0