ANumericField
- Module
- Arc
- Header
#include "Arc/Widgets/ANumericField.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
float | _MinValue | Default -FLT_MAX. |
float | _MaxValue | Default FLT_MAX. |
bool | _IsInteger | Default false. |
std::string | _Units |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
WidgetArgsType& | Decimals | |
WidgetArgsType& | MinValue | |
WidgetArgsType& | MaxValue | |
WidgetArgsType& | IsInteger | |
WidgetArgsType& | Units | |
ARC_WIDGET_ARGS_END | ||
void | Construct | |
void | SetValue | |
float | GetValue | |
void | SetDecimals | |
int32_t | GetDecimals | |
std::string | GetDisplayText | The value as the idle field shows it: integer or float formatting, then the unit suffix. |
const std::string& | GetEditText | The text being typed, while editing; empty otherwise. |
int32_t | GetEditCursor | |
void | SetRange | Committed values, scrubs and arrow steps are clamped to the range; an integer field rounds every one of them. |
void | SetIsInteger | |
bool | IsInteger | |
void | SetUnits | The unit the value is stored in ("cm", "deg", "ms", ...). |
const std::string& | GetUnits | |
void | SetAxisStripe | |
void | SetAxis | 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. |
int32_t | GetAxis | |
const char* | GetAxisLabel | |
void | SetHasError | The design's error state: Error border, ErrorText value. |
bool | HasError | |
void | SetRestingFill | 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. |
float | GetChipWidth | |
float | GetValueLeft | |
void | SetIsMixed | |
bool | IsScrubbing | |
bool | IsEditing | |
void | DragScrub | |
ArcVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseButtonDoubleClick | |
CReply | OnMouseMove | |
CReply | OnKeyDown | |
CReply | OnKeyChar | |
void | OnMouseEnter | |
void | OnMouseLeave | |
void | OnFocusReceived | |
void | OnFocusLost | |
int32_t | GetNumChildren | |
TSharedPtr<AWidget> | GetChildAt | |
TSharedPtr<ANumericFieldText> | GetTextWidget | The text child, for the tests that pin which half paints and which half replays. |
bool | CanCacheDesiredSize | A fixed spinner box: the value is painted inside a constant frame, so scrubbing and typing never resize the field. |
bool | CanSkipArrange | The child always covers the field's own rect, so arranging it is a pure function of the allotted geometry. |
bool | CanRetainPaint | 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. |
const char* | GetTypeName | |
EAccessibleRole | GetAccessibleRole | |
std::string | GetAccessibleValue | |
bool | IsTextInput | 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. |
EFocusVisual | GetFocusVisual | 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. |
bool | IsFocusable | The commonest control in the details panel; out of the Tab order it could only ever be reached with the mouse. |
bool | WantsTextInput | Focus opens the text edit, so a focused field is a text field. |
Function details
ARC_WIDGET_ARGS
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 = -1Decimals
WidgetArgsType& Decimals(int32_t value)MinValue
WidgetArgsType& MinValue(float value)MaxValue
WidgetArgsType& MaxValue(float value)IsInteger
WidgetArgsType& IsInteger(bool value)Units
WidgetArgsType& Units(const std::string& value)ARC_WIDGET_ARGS_END
ARC_WIDGET_ARGS_END() ANumericField()Construct
void Construct(const CArguments& args)SetValue
void SetValue(float value)GetValue
float GetValue() constSetDecimals
void SetDecimals(int32_t decimals)GetDecimals
int32_t GetDecimals() constGetDisplayText
std::string GetDisplayText() constThe value as the idle field shows it: integer or float formatting, then the unit suffix.
GetEditText
const std::string& GetEditText() constThe text being typed, while editing; empty otherwise.
GetEditCursor
int32_t GetEditCursor() constSetRange
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
void SetIsInteger(bool isInteger)IsInteger
bool IsInteger() constSetUnits
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
const std::string& GetUnits() constSetAxisStripe
void SetAxisStripe(const ArcColor& color)SetAxis
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
int32_t GetAxis() constGetAxisLabel
const char* GetAxisLabel() constSetHasError
void SetHasError(bool hasError)The design's error state: Error border, ErrorText value.
HasError
bool HasError() constSetRestingFill
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
float GetChipWidth() constGetValueLeft
float GetValueLeft(const ArcRect& rect) constSetIsMixed
void SetIsMixed(bool mixed)IsScrubbing
bool IsScrubbing() constIsEditing
bool IsEditing() constDragScrub
void DragScrub(float pixelDelta)ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonDoubleClick
CReply OnMouseButtonDoubleClick(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideOnKeyChar
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) overrideOnMouseEnter
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseLeave
void OnMouseLeave(const CPointerEvent& event) overrideOnFocusReceived
void OnFocusReceived(const CFocusEvent& event) overrideOnFocusLost
void OnFocusLost(const CFocusEvent& event) overrideGetNumChildren
int32_t GetNumChildren() const overrideGetChildAt
TSharedPtr<AWidget> GetChildAt(int32_t index) const overrideGetTextWidget
TSharedPtr<ANumericFieldText> GetTextWidget() constThe text child, for the tests that pin which half paints and which half replays.
CanCacheDesiredSize
bool CanCacheDesiredSize() const overrideA fixed spinner box: the value is painted inside a constant frame, so scrubbing and typing never resize the field.
CanSkipArrange
bool CanSkipArrange() const overrideThe child always covers the field's own rect, so arranging it is a pure function of the allotted geometry.
CanRetainPaint
bool CanRetainPaint() const overrideThe 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
const char* GetTypeName() const overrideGetAccessibleRole
EAccessibleRole GetAccessibleRole() const overrideGetAccessibleValue
std::string GetAccessibleValue() const overrideIsTextInput
bool IsTextInput() const overrideOnly 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
EFocusVisual GetFocusVisual() const overridetext-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
bool IsFocusable() const overrideThe commonest control in the details panel; out of the Tab order it could only ever be reached with the mouse.
WantsTextInput
bool WantsTextInput(bool& outPassword) const overrideFocus opens the text edit, so a focused field is a text field.