AListView
- Module
- Arc
- Header
#include "Arc/Widgets/AListView.h"- Namespace
Arcf- Template
template<typename ItemType>
Type aliases
| Alias | Description |
|---|---|
using COnGenerateRow = std::function<TSharedPtr<AWidget>(const ItemType&, uint32_t )> | |
using COnRefreshRow = std::function<void(const TSharedPtr<AWidget>& , const ItemType&, uint32_t )> | |
using COnSelectionChanged = ArcDelegate<void(const ItemType& , uint32_t )> |
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | SCROLLBAR_GUTTER | Default 12.0f. |
COnSelectionChanged | OnSelectionChanged | |
COnSelectionChanged | OnItemActivated | Enter / double-click on a row (U1) — "open" semantics. |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | SetEmptyText | Contextual empty-state line ("no actors", "nothing matches") — settable at runtime so filters can explain themselves. |
void | SetEmptyWidget | What the list shows, filling it, while it has no items: an AEmptyState or a panel's own hint. |
TSharedPtr<AWidget> | GetEmptyWidget | |
bool | IsShowingEmptyWidget | Whether the empty widget is the list's content right now. |
void | SetItems | |
int32_t | UpdateItems | SetItems for a list whose shape stayed: with the same item count, every row unchanged(old, new) accepts keeps the widget it has and only the others are built again. |
void | SetItemHeightFn | Each item's own height; null puts every row back on ItemHeight. |
void | SetRowPaintsOwnStates | Rows the predicate names paint their own hover, press and selection (APropertyRow does, by its own spec); the list keeps only the keyboard ring under them. |
float | GetRowTop | |
float | GetRowHeight | |
float | ContentHeight | |
int32_t | IndexAtY | The row under a content-space y; the item count past the last row. |
void | SetOnGenerateRow | |
void | SetOnRefreshRow | Re-points a pooled row at a new item. |
uint64_t | GetGeneratedRowCount | Rows built by OnGenerateRow / re-pointed by OnRefreshRow so far. |
uint64_t | GetRefreshedRowCount | |
void | SetItemHeight | |
float | GetItemHeight | |
int32_t | GetSelectedIndex | |
const ItemType* | GetSelectedItem | |
void | SetSelectedIndex | The painted set follows the anchor: setting only the anchor left the old highlight on screen. |
void | ClearSelection | |
void | ScrollToEnd | |
void | EnsureIndexVisible | |
ArcVec2 | ComputeDesiredSize | |
bool | CanCacheDesiredSize | A constant. |
bool | DesiredSizeDependsOnChildren | |
bool | CanSkipArrange | Refused: rows are recycled here. |
bool | CanRetainPaint | Refused for the same reason: the rows a replay would reproduce are the ones the previous window recycled, and the selection highlight moves without a write anyone can see. |
void | ArrangeChildren | |
int32_t | OnPaint | |
CReply | OnMouseWheel | |
bool | IsFocusable | |
CReply | OnKeyDown | Keyboard model (U1): arrows move the anchor, Home/End jump, PageUp/Down step a viewport, Enter activates. |
CReply | OnMouseButtonDoubleClick | |
CReply | OnMouseButtonDown | |
CReply | OnMouseMove | |
CReply | OnMouseButtonUp | |
void | OnMouseLeave | |
EFocusVisual | GetFocusVisual | The keyboard row carries list-row.json's inset ring, not the list. |
bool | PaintsOwnFocus | |
int32_t | GetNumChildren | |
TSharedPtr<AWidget> | GetChildAt | |
const char* | GetTypeName |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(AListView) ARC_ARG(float, ItemHeight) ARC_ARG(CText, EmptyText) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)SetEmptyText
void SetEmptyText(const CText& text)Contextual empty-state line ("no actors", "nothing matches") — settable at runtime so filters can explain themselves.
SetEmptyWidget
void SetEmptyWidget(TSharedPtr<AWidget> widget)What the list shows, filling it, while it has no items: an AEmptyState or a panel's own hint. Takes the empty text's place.
GetEmptyWidget
TSharedPtr<AWidget> GetEmptyWidget() constIsShowingEmptyWidget
bool IsShowingEmptyWidget() constWhether the empty widget is the list's content right now.
SetItems
void SetItems(const std::vector<ItemType>& items)UpdateItems
template<typename FUnchanged> int32_t UpdateItems(const std::vector<ItemType>& items, FUnchanged&& unchanged)SetItems for a list whose shape stayed: with the same item count, every row unchanged(old, new) accepts keeps the widget it has and only the others are built again. A different count is a different list and is replaced whole. Returns how many rows were rebuilt, or -1 when the list was replaced.
SetItemHeightFn
void SetItemHeightFn(std::function<float(const ItemType&)> fn)Each item's own height; null puts every row back on ItemHeight.
SetRowPaintsOwnStates
void SetRowPaintsOwnStates(std::function<bool(const ItemType&)> fn)Rows the predicate names paint their own hover, press and selection (APropertyRow does, by its own spec); the list keeps only the keyboard ring under them.
GetRowTop
float GetRowTop(int32_t index) constGetRowHeight
float GetRowHeight(int32_t index) constContentHeight
float ContentHeight() constIndexAtY
int32_t IndexAtY(float y) constThe row under a content-space y; the item count past the last row.
SetOnGenerateRow
void SetOnGenerateRow(COnGenerateRow func)SetOnRefreshRow
void SetOnRefreshRow(COnRefreshRow func)Re-points a pooled row at a new item. Must leave the row showing exactly what OnGenerateRow would have built for that item.
GetGeneratedRowCount
uint64_t GetGeneratedRowCount() constRows built by OnGenerateRow / re-pointed by OnRefreshRow so far.
GetRefreshedRowCount
uint64_t GetRefreshedRowCount() constSetItemHeight
void SetItemHeight(float height)GetItemHeight
float GetItemHeight() constGetSelectedIndex
int32_t GetSelectedIndex() constGetSelectedItem
const ItemType* GetSelectedItem() constSetSelectedIndex
void SetSelectedIndex(int32_t idx)The painted set follows the anchor: setting only the anchor left the old highlight on screen.
ClearSelection
void ClearSelection()ScrollToEnd
void ScrollToEnd()EnsureIndexVisible
void EnsureIndexVisible(const CGeometry& geo, int32_t index)ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float ) const overrideCanCacheDesiredSize
bool CanCacheDesiredSize() const overrideA constant. Rows are generated during arrange and never enter this widget's own measure, so scrolling and regeneration cannot move it.
DesiredSizeDependsOnChildren
bool DesiredSizeDependsOnChildren() const overrideCanSkipArrange
bool CanSkipArrange() const overrideRefused: rows are recycled here. The visible window, the row widgets bound to it and the scrollbar state are all produced by the arrange body, so a skipped pass shows the previous window.
CanRetainPaint
bool CanRetainPaint() const overrideRefused for the same reason: the rows a replay would reproduce are the ones the previous window recycled, and the selection highlight moves without a write anyone can see.
ArrangeChildren
void ArrangeChildren(const CGeometry& allottedGeo) overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseWheel
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) overrideIsFocusable
bool IsFocusable() const overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideKeyboard model (U1): arrows move the anchor, Home/End jump, PageUp/Down step a viewport, Enter activates. Shift extends the range the same way a shift-click does.
OnMouseButtonDoubleClick
CReply OnMouseButtonDoubleClick(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
CReply OnMouseButtonUp(const CGeometry& , const CPointerEvent& ) overrideOnMouseLeave
void OnMouseLeave(const CPointerEvent& event) overrideGetFocusVisual
EFocusVisual GetFocusVisual() const overrideThe keyboard row carries list-row.json's inset ring, not the list.
PaintsOwnFocus
bool PaintsOwnFocus() const overrideGetNumChildren
int32_t GetNumChildren() const overrideGetChildAt
TSharedPtr<AWidget> GetChildAt(int32_t index) const overrideGetTypeName
const char* GetTypeName() const override