class

AComboBox

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

Properties

TypeNameDescription
ArcDelegate<void(int32_t, const std::string&)>OnSelectionChanged

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGSShown in TextSecondary while nothing is selected.
voidSetItems
voidSetSelectedIndex
boolSetSelectedItem
int32_tGetSelectedIndex
const std::string&GetSelectedItem
const std::vector<std::string>&GetItems
boolIsOpen
voidOpenPopup
voidClosePopup
int32_tGetHighlightedIndexThe entry the keyboard is sitting on, as an index into the full item list — not into the filtered rows the popup is showing.
const std::string&GetFilterText
boolIsSearchVisible
voidSetHasErrorThe design's error state: ErrorTint fill, Error border.
boolHasError
const ArcRect&GetPopupRectPopup geometry as last placed, valid while the popup is open.
boolIsPopupFlippedUp
voidSetPopupBoundsBounds the popup is placed and flipped inside.
floatGetScrollOffsetList scroll in content pixels, valid while the popup is open.
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
CReplyOnMouseWheel
CReplyOnKeyDown
CReplyOnKeyChar
voidOnMouseEnter
voidOnMouseLeave
voidOnFocusLost
boolCanCacheDesiredSizeAs wide as its widest item measures; the item list only moves through SetItems, and the open popup is a separate widget.
boolCanRetainPaintClosed, the picture is the selected item, the state tint and the chevron, and every one of those announces itself.
const char*GetTypeName
EAccessibleRoleGetAccessibleRole
boolIsFocusable
boolIsTextInputOnly while the list is down.
boolOnActivate

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AComboBox) ARC_ATTR(ArcColor, BackgroundColor) ARC_ATTR(ArcColor, TextColor) ARC_ATTR(float, ItemHeight) ARC_ATTR(int32_t, MaxVisibleItems) ARC_ATTR(int32_t, SearchThreshold) ARC_ARG(std::string, Placeholder) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

Shown in TextSecondary while nothing is selected.

SetItems

C++
void SetItems(const std::vector<std::string>& items)

SetSelectedIndex

C++
void SetSelectedIndex(int32_t index)

SetSelectedItem

C++
bool SetSelectedItem(const std::string& item)

GetSelectedIndex

C++
int32_t GetSelectedIndex() const

GetSelectedItem

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

GetItems

C++
const std::vector<std::string>& GetItems() const

IsOpen

C++
bool IsOpen() const

OpenPopup

C++
void OpenPopup()

ClosePopup

C++
void ClosePopup()

GetHighlightedIndex

C++
int32_t GetHighlightedIndex() const

The entry the keyboard is sitting on, as an index into the full item list — not into the filtered rows the popup is showing.

GetFilterText

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

IsSearchVisible

C++
bool IsSearchVisible() const

SetHasError

C++
void SetHasError(bool hasError)

The design's error state: ErrorTint fill, Error border.

HasError

C++
bool HasError() const

GetPopupRect

C++
const ArcRect& GetPopupRect() const

Popup geometry as last placed, valid while the popup is open. The flip flag is what a host needs to align anything it draws beside it.

IsPopupFlippedUp

C++
bool IsPopupFlippedUp() const

SetPopupBounds

C++
void SetPopupBounds(const ArcVec2& size)

Bounds the popup is placed and flipped inside. Defaults to the widget's own window; a host that renders Arc into a sub-region — and the headless tests, which have no window at all — must set it or the popup is treated as unbounded and never flips.

GetScrollOffset

C++
float GetScrollOffset() const

List scroll in content pixels, valid while the popup is open.

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

OnMouseButtonUp

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

OnMouseMove

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

OnMouseWheel

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

OnFocusLost

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

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

As wide as its widest item measures; the item list only moves through SetItems, and the open popup is a separate widget.

CanRetainPaint

C++
bool CanRetainPaint() const override

Closed, the picture is the selected item, the state tint and the chevron, and every one of those announces itself. Open, the popup is painted from inside OnPaint and carries a hold-to-repeat clock that nothing invalidates on, so the list down is the one case that has to keep painting.

GetTypeName

C++
const char* GetTypeName() const override

GetAccessibleRole

C++
EAccessibleRole GetAccessibleRole() const override

IsFocusable

C++
bool IsFocusable() const override

IsTextInput

C++
bool IsTextInput() const override

Only while the list is down. Every plain keystroke then belongs to the dropdown — type-ahead or the filter field — and must not also fire whatever the surrounding panel binds that letter to.

OnActivate

C++
bool OnActivate() override
Generated from Arc/Widgets/AComboBox.h via arc.json · Nov 5, 2026Version 1.0.0