class

ANumericField

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

Properties

TypeNameDescription
float_MinValueDefault -FLT_MAX.
float_MaxValueDefault FLT_MAX.
bool_IsIntegerDefault false.
std::string_Units

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
WidgetArgsType&Decimals
WidgetArgsType&MinValue
WidgetArgsType&MaxValue
WidgetArgsType&IsInteger
WidgetArgsType&Units
ARC_WIDGET_ARGS_END
voidConstruct
voidSetValue
floatGetValue
voidSetDecimals
int32_tGetDecimals
std::stringGetDisplayTextThe value as the idle field shows it: integer or float formatting, then the unit suffix.
const std::string&GetEditTextThe text being typed, while editing; empty otherwise.
int32_tGetEditCursor
voidSetRangeCommitted values, scrubs and arrow steps are clamped to the range; an integer field rounds every one of them.
voidSetIsInteger
boolIsInteger
voidSetUnitsThe unit the value is stored in ("cm", "deg", "ms", ...).
const std::string&GetUnits
voidSetAxisStripe
voidSetAxisThe X/Y/Z/W axis chip (0..3) of numeric-field.json: 16 x 22 at the left inside the border, the axis token's fill and its letter.
int32_tGetAxis
const char*GetAxisLabel
voidSetHasErrorThe design's error state: Error border, ErrorText value.
boolHasError
voidSetRestingFillThe fill of the resting and hovered field when the host is not a panel (Surface0 in a toolbar, seed-field.json); nullptr = the spec's.
floatGetChipWidth
floatGetValueLeft
voidSetIsMixed
boolIsScrubbing
boolIsEditing
voidDragScrub
ArcVec2ComputeDesiredSize
voidArrangeChildren
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseButtonDoubleClick
CReplyOnMouseMove
CReplyOnKeyDown
CReplyOnKeyChar
voidOnMouseEnter
voidOnMouseLeave
voidOnFocusReceived
voidOnFocusLost
int32_tGetNumChildren
TSharedPtr<AWidget>GetChildAt
TSharedPtr<ANumericFieldText>GetTextWidgetThe text child, for the tests that pin which half paints and which half replays.
boolCanCacheDesiredSizeA fixed spinner box: the value is painted inside a constant frame, so scrubbing and typing never resize the field.
boolCanSkipArrangeThe child always covers the field's own rect, so arranging it is a pure function of the allotted geometry.
boolCanRetainPaintThe frame — background, border, state colours — is a pure function of its attributes; the moving parts live in the text child, which vetoes the slice only while it is being typed into or scrubbed.
const char*GetTypeName
EAccessibleRoleGetAccessibleRole
std::stringGetAccessibleValue
boolIsTextInputOnly while the caret is in the field: a scrub-only spinner has no claim on plain keystrokes, but one being typed into owns them the same way a text box does.
EFocusVisualGetFocusVisualtext-field.json's focused state, as the text box has it: tabbing in starts editing, and the base rule (no ring on a text input) left the commonest control of the details panel without a keyboard ring.
boolIsFocusableThe commonest control in the details panel; out of the Tab order it could only ever be reached with the mouse.
boolWantsTextInputFocus opens the text edit, so a focused field is a text field.

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(ANumericField) ARC_ATTR(float, Value) ARC_ATTR(ArcColor, AxisStripe) ARC_ARG(bool, IsMixed) ARC_ARG(float, ScrubStep) ARC_EVENT(COnFloatChanged, OnValueChanged) ARC_EVENT(COnFloatChanged, OnValueCommitted) ARC_EVENT(CSimpleDelegate, OnScrubBegin) ARC_EVENT(CSimpleDelegate, OnScrubEnd) int32_t _Decimals = -1

Decimals

C++
WidgetArgsType& Decimals(int32_t value)

MinValue

C++
WidgetArgsType& MinValue(float value)

MaxValue

C++
WidgetArgsType& MaxValue(float value)

IsInteger

C++
WidgetArgsType& IsInteger(bool value)

Units

C++
WidgetArgsType& Units(const std::string& value)

ARC_WIDGET_ARGS_END

C++
ARC_WIDGET_ARGS_END() ANumericField()

Construct

C++
void Construct(const CArguments& args)

SetValue

C++
void SetValue(float value)

GetValue

C++
float GetValue() const

SetDecimals

C++
void SetDecimals(int32_t decimals)

GetDecimals

C++
int32_t GetDecimals() const

GetDisplayText

C++
std::string GetDisplayText() const

The value as the idle field shows it: integer or float formatting, then the unit suffix.

GetEditText

C++
const std::string& GetEditText() const

The text being typed, while editing; empty otherwise.

GetEditCursor

C++
int32_t GetEditCursor() const

SetRange

C++
void SetRange(float minValue, float maxValue)

Committed values, scrubs and arrow steps are clamped to the range; an integer field rounds every one of them.

SetIsInteger

C++
void SetIsInteger(bool isInteger)

IsInteger

C++
bool IsInteger() const

SetUnits

C++
void SetUnits(const std::string& units)

The unit the value is stored in ("cm", "deg", "ms", ...). Typed numbers may carry any unit of the same dimension and are converted into it; see CArcNumericExpression.

GetUnits

C++
const std::string& GetUnits() const

SetAxisStripe

C++
void SetAxisStripe(const ArcColor& color)

SetAxis

C++
void SetAxis(int32_t axis)

The X/Y/Z/W axis chip (0..3) of numeric-field.json: 16 x 22 at the left inside the border, the axis token's fill and its letter.

GetAxis

C++
int32_t GetAxis() const

GetAxisLabel

C++
const char* GetAxisLabel() const

SetHasError

C++
void SetHasError(bool hasError)

The design's error state: Error border, ErrorText value.

HasError

C++
bool HasError() const

SetRestingFill

C++
void SetRestingFill(const ArcColor* token)

The fill of the resting and hovered field when the host is not a panel (Surface0 in a toolbar, seed-field.json); nullptr = the spec's.

GetChipWidth

C++
float GetChipWidth() const

GetValueLeft

C++
float GetValueLeft(const ArcRect& rect) const

SetIsMixed

C++
void SetIsMixed(bool mixed)

IsScrubbing

C++
bool IsScrubbing() const

IsEditing

C++
bool IsEditing() const

DragScrub

C++
void DragScrub(float pixelDelta)

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

ArrangeChildren

C++
void ArrangeChildren(const CGeometry& geo) 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

OnMouseButtonDoubleClick

C++
CReply OnMouseButtonDoubleClick(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

OnKeyChar

C++
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) override

OnMouseEnter

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

OnMouseLeave

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

OnFocusReceived

C++
void OnFocusReceived(const CFocusEvent& event) override

OnFocusLost

C++
void OnFocusLost(const CFocusEvent& event) override

GetNumChildren

C++
int32_t GetNumChildren() const override

GetChildAt

C++
TSharedPtr<AWidget> GetChildAt(int32_t index) const override

GetTextWidget

C++
TSharedPtr<ANumericFieldText> GetTextWidget() const

The text child, for the tests that pin which half paints and which half replays.

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A fixed spinner box: the value is painted inside a constant frame, so scrubbing and typing never resize the field.

CanSkipArrange

C++
bool CanSkipArrange() const override

The child always covers the field's own rect, so arranging it is a pure function of the allotted geometry.

CanRetainPaint

C++
bool CanRetainPaint() const override

The frame — background, border, state colours — is a pure function of its attributes; the moving parts live in the text child, which vetoes the slice only while it is being typed into or scrubbed. A stripe is painted under a clip, and a clip cannot live inside a slice.

GetTypeName

C++
const char* GetTypeName() const override

GetAccessibleRole

C++
EAccessibleRole GetAccessibleRole() const override

GetAccessibleValue

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

IsTextInput

C++
bool IsTextInput() const override

Only while the caret is in the field: a scrub-only spinner has no claim on plain keystrokes, but one being typed into owns them the same way a text box does.

GetFocusVisual

C++
EFocusVisual GetFocusVisual() const override

text-field.json's focused state, as the text box has it: tabbing in starts editing, and the base rule (no ring on a text input) left the commonest control of the details panel without a keyboard ring.

IsFocusable

C++
bool IsFocusable() const override

The commonest control in the details panel; out of the Tab order it could only ever be reached with the mouse.

WantsTextInput

C++
bool WantsTextInput(bool& outPassword) const override

Focus opens the text edit, so a focused field is a text field.

Generated from Arc/Widgets/ANumericField.h via arc.json · Nov 5, 2026Version 1.0.0