class

ASearchBox

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

Properties

TypeNameDescription
ArcDelegate<void(const std::string&)>OnTextChangedEvery edit, immediately.
ArcDelegate<void(const std::string&)>OnFilterChangedThe query to filter by: 150 ms after the last keystroke, and at once when the text is cleared or set from code.
static constexpr int32_tkFilterDebounceMsDefault 150.

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
WidgetArgsType&DrawBorder
ARC_ARG
voidSetText
const std::string&GetText
std::stringGetSelectedText
int32_tGetCursorPosition
voidClearText
voidSelectWordAtWhat a double-click selects: the UAX #29 word, punctuation run or whitespace run under the byte, as the single-line box picks it.
voidFlushFilterFires a pending OnFilterChanged now (Enter, a test).
boolIsFilterPending
voidSetHasError
boolHasError
EFocusVisualGetFocusVisual
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseMove
CReplyOnMouseButtonUp
CReplyOnKeyChar
CReplyOnKeyDown
voidOnFocusReceived
voidOnFocusLost
boolCanCacheDesiredSizeA fixed field sized off its font; the query text scrolls inside it.
boolCanRetainPaintRefused: it hosts an editable field, caret and all.
const char*GetTypeName
EAccessibleRoleGetAccessibleRole
std::stringGetAccessibleValue
boolIsTextInput
boolIsFocusable
boolWantsTextInput

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(ASearchBox) ARC_ATTR(CText, HintText) ARC_ATTR(ArcColor, BackgroundColor) ARC_ATTR(ArcColor, TextColor) ARC_ARG(CArcFontInfo, Font) bool _DrawBorder = true

DrawBorder

C++
WidgetArgsType& DrawBorder(bool value)

ARC_ARG

C++
ARC_ARG(std::string, ShortcutHint) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetText

C++
void SetText(const std::string& text)

GetText

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

GetSelectedText

C++
std::string GetSelectedText() const

GetCursorPosition

C++
int32_t GetCursorPosition() const

ClearText

C++
void ClearText()

SelectWordAt

C++
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.

FlushFilter

C++
void FlushFilter()

Fires a pending OnFilterChanged now (Enter, a test).

IsFilterPending

C++
bool IsFilterPending() const

SetHasError

C++
void SetHasError(bool hasError)

HasError

C++
bool HasError() const

GetFocusVisual

C++
EFocusVisual GetFocusVisual() const override

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const 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

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnKeyChar

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

OnKeyDown

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

OnFocusReceived

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

OnFocusLost

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

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A fixed field sized off its font; the query text scrolls inside it.

CanRetainPaint

C++
bool CanRetainPaint() const override

Refused: it hosts an editable field, caret and all.

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

IsFocusable

C++
bool IsFocusable() const override

WantsTextInput

C++
bool WantsTextInput(bool& outPassword) const override
Generated from Arc/Widgets/ASearchBox.h via arc.json · Nov 5, 2026Version 1.0.0