AMultiLineEditableTextBox
- Module
- Arc
- Header
#include "Arc/Widgets/AMultiLineEditableTextBox.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
int32_t | _MinDesiredLines | Default 3. |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | report field at 10 px sides); all zero keeps the style. | |
WidgetArgsType& | WrapText | |
WidgetArgsType& | MinDesiredLines | |
ARC_ARG | control, instead of trapping the keyboard in the box. | |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
CReply | OnMouseWheel | |
EArcCursorType | OnCursorQuery | |
CReply | OnKeyChar | |
CReply | OnKeyDown | |
CReply | OnTextComposition | |
void | OnFocusReceived | |
void | OnFocusLost | |
void | SetText | |
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. |
void | SetSelectionRange | Selection as a BYTE range into the text — what a host needs to drive a find (select the match, scroll it into view) without owning the caret machinery. |
bool | GetSelectionRange | |
void | SelectWordAt | What a double-click selects: the UAX #29 word, punctuation run or whitespace run under the byte, as the single-line box picks it. |
float | GetScrollOffset | Vertical scroll in content pixels, the same units the scrollbar and the caret-reveal work in. |
const std::string& | GetDisplayedText | The text the widget is actually showing — the edit buffer while focused, the bound attribute otherwise. |
bool | CanRetainPaint | Refused: caret, selection highlight and a scroll offset the body clamps against the content — all of them move with no write behind them. |
const char* | GetTypeName | |
EAccessibleRole | GetAccessibleRole | |
std::string | GetAccessibleValue | |
bool | IsFocusable | |
bool | IsTextInput | |
bool | ConsumesTab | An editable body types Tab; a read-only view has nothing to indent and must let Tab move on like any other control. |
bool | WantsTextInput | |
ArcMargin | GetTextPadding | The inset the text sits at: TextPadding when given, else the style's. |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(AMultiLineEditableTextBox) 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) bool _WrapText = truereport field at 10 px sides); all zero keeps the style.
WrapText
WidgetArgsType& WrapText(bool value)MinDesiredLines
WidgetArgsType& MinDesiredLines(int32_t value)ARC_ARG
ARC_ARG(bool, RevertOnEscape) ARC_ARG(bool, TabNavigates) ARC_EVENT(COnTextChanged, OnTextChanged) ARC_EVENT(CSimpleDelegate, OnTextCommitted) ARC_EVENT(COnTextCommittedWithReason, OnTextCommittedWithReason) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)control, instead of trapping the keyboard in the box.
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) overrideOnMouseWheel
CReply OnMouseWheel(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) overrideOnFocusLost
void OnFocusLost(const CFocusEvent& event) overrideSetText
void SetText(const CText& text)GetText
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.
SetSelectionRange
void SetSelectionRange(int32_t startByte, int32_t endByte, bool reveal = true)Selection as a BYTE range into the text — what a host needs to drive a find (select the match, scroll it into view) without owning the caret machinery. The range is clamped to the text and snapped to UTF-8 boundaries, so a byte offset from a raw std::string::find is safe to pass in. Revealing happens at the next paint: the scroll needs the widget's rect, which only the paint knows.
GetSelectionRange
bool GetSelectionRange(int32_t& outStart, int32_t& outEnd) constSelectWordAt
void SelectWordAt(int32_t byte)What a double-click selects: the UAX #29 word, punctuation run or whitespace run under the byte, as the single-line box picks it.
GetScrollOffset
float GetScrollOffset() constVertical scroll in content pixels, the same units the scrollbar and the caret-reveal work in.
GetDisplayedText
const std::string& GetDisplayedText() constThe text the widget is actually showing — the edit buffer while focused, the bound attribute otherwise. A host searching the content must look at the same bytes the selection indexes.
CanRetainPaint
bool CanRetainPaint() const overrideRefused: caret, selection highlight and a scroll offset the body clamps against the content — all of them move with no write behind them.
GetTypeName
const char* GetTypeName() const overrideGetAccessibleRole
EAccessibleRole GetAccessibleRole() const overrideGetAccessibleValue
std::string GetAccessibleValue() const overrideIsFocusable
bool IsFocusable() const overrideIsTextInput
bool IsTextInput() const overrideConsumesTab
bool ConsumesTab() const overrideAn editable body types Tab; a read-only view has nothing to indent and must let Tab move on like any other control.
WantsTextInput
bool WantsTextInput(bool& outPassword) const overrideGetTextPadding
ArcMargin GetTextPadding() constThe inset the text sits at: TextPadding when given, else the style's.