AEditableTextBox
- Module
- Arc
- Header
#include "Arc/Widgets/AEditableTextBox.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | in the placeholder colour; it is not part of the value. | |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
EArcCursorType | OnCursorQuery | |
CReply | OnKeyChar | |
CReply | OnKeyDown | |
CReply | OnTextComposition | |
void | OnFocusReceived | |
bool | WantsTextInput | |
void | OnFocusLost | |
void | SetText | |
void | SetIsPassword | |
bool | IsPassword | |
CText | GetText | The edit buffer while focused: a bound Text keeps reporting the model until the owner applies the edit, so it cannot say what is typed. |
int32_t | GetCursorPosition | Caret and selection in bytes. |
std::string | GetSelectedText | |
ETextCommit | GetLastCommitReason | The reason the last commit carried. |
float | GetScrollOffset | How far the text is scrolled left to keep the caret inside the frame, in layout units. |
std::string | GetDisplayText | The string actually painted: the edit text, or one mask glyph per grapheme for a password. |
bool | CanCacheDesiredSize | The box is a fixed frame sized off the font — the text it holds scrolls inside it rather than growing it, so typing cannot change the measure. |
bool | CanRetainPaint | Refused: the caret blinks off a clock and the selection highlight follows a drag, neither of which has a write to invalidate on. |
const char* | GetTypeName | |
EAccessibleRole | GetAccessibleRole | A password's value is never handed to an assistive client. |
std::string | GetAccessibleValue | |
bool | IsFocusable | |
bool | IsTextInput | |
EFocusVisual | GetFocusVisual | text-field.json's focused state has the FocusRing border on any focus and the outer ring as well when the focus came from the keyboard, like every other control. |
void | SetHasError | The design's error state: ErrorTint fill, Error border, and the error text as a Dense helper line 4 px under the field. |
bool | HasError | |
void | SetErrorText | |
float | GetFieldHeight | 26 px, or the 24 px dense field of property rows. |
ArcMargin | GetTextPadding | The inset the text sits at: TextPadding when given, else the style's. |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(AEditableTextBox) ARC_ARG(ArcMargin, TextPadding) ARC_ATTR(CText, Text) ARC_ATTR(CText, HintText) ARC_ATTR(ArcColor, ForegroundColor) ARC_ATTR(ArcColor, BackgroundColor) ARC_ATTR(CArcFontInfo, Font) ARC_ARG(bool, IsReadOnly) ARC_ARG(bool, IsPassword) ARC_ARG(bool, ClearFocusOnCommit) ARC_EVENT(COnTextChanged, OnTextChanged) ARC_EVENT(CSimpleDelegate, OnTextCommitted) ARC_EVENT(COnTextCommittedWithReason, OnTextCommittedWithReason) ARC_ATTR(CText, ErrorText) ARC_ARG(bool, Dense) ARC_ARG(bool, AlignRight) ARC_ARG(std::string, Suffix) ARC_ARG(bool, Frameless) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)in the placeholder colour; it is not part of the value.
ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const 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) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnCursorQuery
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const overrideOnKeyChar
CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideOnTextComposition
CReply OnTextComposition(const CGeometry& geo, const CCompositionEvent& event) overrideOnFocusReceived
void OnFocusReceived(const CFocusEvent& event) overrideWantsTextInput
bool WantsTextInput(bool& outPassword) const overrideOnFocusLost
void OnFocusLost(const CFocusEvent& event) overrideSetText
void SetText(const CText& text)SetIsPassword
void SetIsPassword(bool password)IsPassword
bool IsPassword() constGetText
CText GetText() constThe edit buffer while focused: a bound Text keeps reporting the model until the owner applies the edit, so it cannot say what is typed.
GetCursorPosition
int32_t GetCursorPosition() constCaret and selection in bytes. The Text attribute cannot show either, so anything reasoning about the edit — a validator, a test — has no other way to see where the user is.
GetSelectedText
std::string GetSelectedText() constGetLastCommitReason
ETextCommit GetLastCommitReason() constThe reason the last commit carried. A focus session commits at most once per distinct text: Enter then the blur it causes is one commit, not two.
GetScrollOffset
float GetScrollOffset() constHow far the text is scrolled left to keep the caret inside the frame, in layout units. Zero while unfocused.
GetDisplayText
std::string GetDisplayText() constThe string actually painted: the edit text, or one mask glyph per grapheme for a password.
CanCacheDesiredSize
bool CanCacheDesiredSize() const overrideThe box is a fixed frame sized off the font — the text it holds scrolls inside it rather than growing it, so typing cannot change the measure.
CanRetainPaint
bool CanRetainPaint() const overrideRefused: the caret blinks off a clock and the selection highlight follows a drag, neither of which has a write to invalidate on.
GetTypeName
const char* GetTypeName() const overrideGetAccessibleRole
EAccessibleRole GetAccessibleRole() const overrideA password's value is never handed to an assistive client.
GetAccessibleValue
std::string GetAccessibleValue() const overrideIsFocusable
bool IsFocusable() const overrideIsTextInput
bool IsTextInput() const overrideGetFocusVisual
EFocusVisual GetFocusVisual() const overridetext-field.json's focused state has the FocusRing border on any focus and the outer ring as well when the focus came from the keyboard, like every other control.
SetHasError
void SetHasError(bool hasError)The design's error state: ErrorTint fill, Error border, and the error text as a Dense helper line 4 px under the field.
HasError
bool HasError() constSetErrorText
void SetErrorText(const CText& text)GetFieldHeight
float GetFieldHeight() const26 px, or the 24 px dense field of property rows.
GetTextPadding
ArcMargin GetTextPadding() constThe inset the text sits at: TextPadding when given, else the style's.