AComboBox
- Module
- Arc
- Header
#include "Arc/Widgets/AComboBox.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
ArcDelegate<void(int32_t, const std::string&)> | OnSelectionChanged |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | Shown in TextSecondary while nothing is selected. | |
void | SetItems | |
void | SetSelectedIndex | |
bool | SetSelectedItem | |
int32_t | GetSelectedIndex | |
const std::string& | GetSelectedItem | |
const std::vector<std::string>& | GetItems | |
bool | IsOpen | |
void | OpenPopup | |
void | ClosePopup | |
int32_t | GetHighlightedIndex | The 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 | |
bool | IsSearchVisible | |
void | SetHasError | The design's error state: ErrorTint fill, Error border. |
bool | HasError | |
const ArcRect& | GetPopupRect | Popup geometry as last placed, valid while the popup is open. |
bool | IsPopupFlippedUp | |
void | SetPopupBounds | Bounds the popup is placed and flipped inside. |
float | GetScrollOffset | List scroll in content pixels, valid while the popup is open. |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
CReply | OnMouseWheel | |
CReply | OnKeyDown | |
CReply | OnKeyChar | |
void | OnMouseEnter | |
void | OnMouseLeave | |
void | OnFocusLost | |
bool | CanCacheDesiredSize | As wide as its widest item measures; the item list only moves through SetItems, and the open popup is a separate widget. |
bool | CanRetainPaint | Closed, the picture is the selected item, the state tint and the chevron, and every one of those announces itself. |
const char* | GetTypeName | |
EAccessibleRole | GetAccessibleRole | |
bool | IsFocusable | |
bool | IsTextInput | Only while the list is down. |
bool | OnActivate |
Function details
ARC_WIDGET_ARGS
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
void SetItems(const std::vector<std::string>& items)SetSelectedIndex
void SetSelectedIndex(int32_t index)SetSelectedItem
bool SetSelectedItem(const std::string& item)GetSelectedIndex
int32_t GetSelectedIndex() constGetSelectedItem
const std::string& GetSelectedItem() constGetItems
const std::vector<std::string>& GetItems() constIsOpen
bool IsOpen() constOpenPopup
void OpenPopup()ClosePopup
void ClosePopup()GetHighlightedIndex
int32_t GetHighlightedIndex() constThe entry the keyboard is sitting on, as an index into the full item list — not into the filtered rows the popup is showing.
GetFilterText
const std::string& GetFilterText() constIsSearchVisible
bool IsSearchVisible() constSetHasError
void SetHasError(bool hasError)The design's error state: ErrorTint fill, Error border.
HasError
bool HasError() constGetPopupRect
const ArcRect& GetPopupRect() constPopup 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
bool IsPopupFlippedUp() constSetPopupBounds
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
float GetScrollOffset() constList scroll in content pixels, valid while the popup is open.
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) 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) overrideOnFocusLost
void OnFocusLost(const CFocusEvent& event) overrideCanCacheDesiredSize
bool CanCacheDesiredSize() const overrideAs wide as its widest item measures; the item list only moves through SetItems, and the open popup is a separate widget.
CanRetainPaint
bool CanRetainPaint() const overrideClosed, 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
const char* GetTypeName() const overrideGetAccessibleRole
EAccessibleRole GetAccessibleRole() const overrideIsFocusable
bool IsFocusable() const overrideIsTextInput
bool IsTextInput() const overrideOnly 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
bool OnActivate() override