class

ATreeView

Module
Arc
Header
#include "Arc/Widgets/ATreeView.h"
Namespace
Arcf
Template
template<typename ItemType>

Type aliases

AliasDescription
using COnGenerateRow = std::function<TSharedPtr<AWidget>(const ItemType&, uint32_t )>
using COnRefreshRow = std::function<void(const TSharedPtr<AWidget>& , const ItemType&, uint32_t )>
using COnGetChildren = std::function<void(const ItemType& , std::vector<ItemType>& )>
using COnSelectionChanged = ArcDelegate<void(const ItemType& )>
using CItemHasher = std::function<size_t(const ItemType&)>
using COnCanAcceptDrop = std::function<bool(const ItemType& , const ItemType& )>
using COnHasChildren = std::function<bool(const ItemType&)>Optional: answers "does this item have children" without building the child list. Without it a rebuild asks OnGetChildren for every collapsed row too, only to decide whether to draw a chevron.

Properties

TypeNameDescription
COnSelectionChangedOnSelectionChanged
ArcDelegate<void()>OnSelectionCleared
ArcDelegate<void(const ItemType& , const ItemType& )>OnItemDroppedDrag-to-reorder/reparent. A row drag begins once the cursor moves past the threshold with the button held; OnItemDropped fires for a drop onto another row, OnItemDroppedOnVoid for a drop on the empty area below the last row. No delegates bound = no drag behavior.
ArcDelegate<void(const ItemType& )>OnItemDroppedOnVoid
COnSelectionChangedOnItemRenameRequestedF2 on the selected row (rename in place).

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetLeadingWidthLeading columns: a strip this wide at the left of every row that does not indent with depth (the outliner's eye and lock).
floatGetLeadingWidth
floatRowContentIndentWhere a row's label starts, measured from the row's own left edge, when leading columns are on.
voidSetEmptyTextContextual empty-state line ("no actors", "nothing matches") — settable at runtime so filters can explain themselves.
voidSetEmptyWidgetWhat the tree shows, filling it, while it has no rows: an AEmptyState or a panel's own hint.
TSharedPtr<AWidget>GetEmptyWidget
voidSetEmptyWidgetRowsThe empty widget also shows under this many rows, filling the space below them: a level whose only row is the level itself.
boolIsShowingEmptyWidgetWhether the empty widget is the tree's content right now.
voidSetRootItems
voidSetOnGenerateRow
voidSetOnRefreshRowRow recycling, as in AListView: with this bound, a row leaving the window (or orphaned by a rebuilt flat list) goes to a pool, and the next row needed is re-pointed at its item instead of built.
uint64_tGetRowsGeneratedRows built by OnGenerateRow / re-pointed by OnRefreshRow so far.
uint64_tGetRowsRefreshed
voidSetOnGetChildren
voidSetCanAcceptDrop
voidSetSelectedIndex
voidSetSelectedItemsReplaces the whole selection set; primary marks the row that gets the strong selected treatment (all others use the secondary color).
voidGetSelectedItemsSelected items in visible (flattened tree) order.
voidClearSelection
boolIsItemSelected
boolIsItemPrimary
voidSetSelectionRowColorsOptional row-color overrides.
voidSetDropTargetRowColors
int32_tGetSelectionCount
int32_tIndexAtPositionRow index under an absolute point, or -1 for the empty area below the last row and for points outside the tree.
boolGetItemAtIndex
ArcRectGetRowAbsoluteRect
int32_tGetRowCount
voidSetExternalDropTargetDrop feedback driven from outside the tree (a drag that started in another panel).
voidClearExternalDropTarget
int32_tGetExternalDropIndex
int32_tFindItemIndex
voidSetExpanded
voidBeginBatchUpdateEvery rebuild walks the whole visible tree.
voidEndBatchUpdate
voidSetOnHasChildren
uint64_tGetFlatRebuildCount
uint64_tGetChildQueryCount
boolIsExpanded
voidToggleExpansion
ArcVec2ComputeDesiredSize
boolCanCacheDesiredSizeA constant.
boolDesiredSizeDependsOnChildren
boolCanSkipArrangeRefused for the same reason as AListView: row recycling and scroll clamping live in the arrange body.
boolCanRetainPaintRefused for the same reason: recycled rows and a selection that moves with nothing to invalidate on.
voidArrangeChildren
int32_tOnPainttree-row.json: rows are 4 px-radius pills across the tree, hover SurfaceHover, pressed Surface4, selected Selection, the keyboard row a 1 px FocusRing inset, the 12 px Lucide chevron in a 12 px slot at 4 px + 16 px per level, and a hidden or disabled row in TextDisabled.
CReplyOnMouseWheel
CReplyOnMouseButtonDown
CReplyOnKeyDownKeyboard model (U1): Up/Down walk the visible rows, Left collapses (or jumps to the parent), Right expands, Home/End jump, Enter re-broadcasts the selection as an activation.
CReplyOnMouseButtonUp
CReplyOnMouseMove
voidOnMouseLeave
voidOnMouseCaptureLost
EArcCursorTypeOnCursorQuery
int32_tGetNumChildren
TSharedPtr<AWidget>GetChildAt
const char*GetTypeName
boolIsFocusable
EFocusVisualGetFocusVisualThe keyboard row carries tree-row.json's inset ring, not the tree.
boolPaintsOwnFocus
voidSetOnIsItemDimmedRows this answers true for paint in the Disabled state: the outliner's hidden actors (eye-off) read as TextDisabled.

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(ATreeView) ARC_ARG(float, ItemHeight) ARC_ARG(float, IndentStep) ARC_ARG(float, ChevronWidth) ARC_ARG(float, RowPaddingX) ARC_ARG(float, LeadingWidth) ARC_ARG(bool, OverlayScrollbar) ARC_ARG(CText, EmptyText) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetLeadingWidth

C++
void SetLeadingWidth(float width)

Leading columns: a strip this wide at the left of every row that does not indent with depth (the outliner's eye and lock). With it set, each row is arranged across the whole row width and the chevron and indent start after the strip, so the row lays its own label out at RowContentIndent(depth).

GetLeadingWidth

C++
float GetLeadingWidth() const

RowContentIndent

C++
float RowContentIndent(uint32_t depth) const

Where a row's label starts, measured from the row's own left edge, when leading columns are on.

SetEmptyText

C++
void SetEmptyText(const CText& text)

Contextual empty-state line ("no actors", "nothing matches") — settable at runtime so filters can explain themselves.

SetEmptyWidget

C++
void SetEmptyWidget(TSharedPtr<AWidget> widget)

What the tree shows, filling it, while it has no rows: an AEmptyState or a panel's own hint. Takes the empty text's place.

GetEmptyWidget

C++
TSharedPtr<AWidget> GetEmptyWidget() const

SetEmptyWidgetRows

C++
void SetEmptyWidgetRows(int32_t rows)

The empty widget also shows under this many rows, filling the space below them: a level whose only row is the level itself.

IsShowingEmptyWidget

C++
bool IsShowingEmptyWidget() const

Whether the empty widget is the tree's content right now.

SetRootItems

C++
void SetRootItems(const std::vector<ItemType>& roots)

SetOnGenerateRow

C++
void SetOnGenerateRow(COnGenerateRow func)

SetOnRefreshRow

C++
void SetOnRefreshRow(COnRefreshRow func)

Row recycling, as in AListView: with this bound, a row leaving the window (or orphaned by a rebuilt flat list) goes to a pool, and the next row needed is re-pointed at its item instead of built. The callback must leave the row exactly what OnGenerateRow would have built for that item and depth.

GetRowsGenerated

C++
uint64_t GetRowsGenerated() const

Rows built by OnGenerateRow / re-pointed by OnRefreshRow so far.

GetRowsRefreshed

C++
uint64_t GetRowsRefreshed() const

SetOnGetChildren

C++
void SetOnGetChildren(COnGetChildren func)

SetCanAcceptDrop

C++
void SetCanAcceptDrop(COnCanAcceptDrop func)

SetSelectedIndex

C++
void SetSelectedIndex(int32_t idx)

SetSelectedItems

C++
void SetSelectedItems(const std::vector<ItemType>& items, const ItemType& primary)

Replaces the whole selection set; primary marks the row that gets the strong selected treatment (all others use the secondary color).

GetSelectedItems

C++
void GetSelectedItems(std::vector<ItemType>& outItems) const

Selected items in visible (flattened tree) order.

ClearSelection

C++
void ClearSelection()

IsItemSelected

C++
bool IsItemSelected(const ItemType& item) const

IsItemPrimary

C++
bool IsItemPrimary(const ItemType& item) const

SetSelectionRowColors

C++
void SetSelectionRowColors(const ArcColor& primary, const ArcColor& secondary)

Optional row-color overrides. When unset, the active style set's TableRowStyle.SelectedColor paints every selected row.

SetDropTargetRowColors

C++
void SetDropTargetRowColors(const ArcColor& background, const ArcColor& border)

GetSelectionCount

C++
int32_t GetSelectionCount() const

IndexAtPosition

C++
int32_t IndexAtPosition(const ArcVec2& absolutePosition) const

Row index under an absolute point, or -1 for the empty area below the last row and for points outside the tree. External drop targets need this because the drag source owns the mouse for the whole gesture.

GetItemAtIndex

C++
bool GetItemAtIndex(int32_t index, ItemType& outItem) const

GetRowAbsoluteRect

C++
ArcRect GetRowAbsoluteRect(int32_t index) const

GetRowCount

C++
int32_t GetRowCount() const

SetExternalDropTarget

C++
void SetExternalDropTarget(int32_t index, bool onVoid)

Drop feedback driven from outside the tree (a drag that started in another panel). index >= 0 paints the drop-into treatment on that row; onVoid paints the insertion line under the last row.

ClearExternalDropTarget

C++
void ClearExternalDropTarget()

GetExternalDropIndex

C++
int32_t GetExternalDropIndex() const

FindItemIndex

C++
int32_t FindItemIndex(const ItemType& item) const

SetExpanded

C++
void SetExpanded(const ItemType& item, bool expanded)

BeginBatchUpdate

C++
void BeginBatchUpdate()

Every rebuild walks the whole visible tree. A caller that changes roots and many expansions at once (a filter refresh opening each ancestor of every hit) brackets the edits so the walk runs once at the end instead of once per SetExpanded — the Outliner on a large scene stalled on exactly that.

EndBatchUpdate

C++
void EndBatchUpdate()

SetOnHasChildren

C++
void SetOnHasChildren(COnHasChildren func)

GetFlatRebuildCount

C++
uint64_t GetFlatRebuildCount() const

GetChildQueryCount

C++
uint64_t GetChildQueryCount() const

IsExpanded

C++
bool IsExpanded(const ItemType& item) const

ToggleExpansion

C++
void ToggleExpansion(const ItemType& item)

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float ) const override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

A constant. Rows are generated during arrange and never enter this widget's own measure, so scrolling, expansion and regeneration cannot move it.

DesiredSizeDependsOnChildren

C++
bool DesiredSizeDependsOnChildren() const override

CanSkipArrange

C++
bool CanSkipArrange() const override

Refused for the same reason as AListView: row recycling and scroll clamping live in the arrange body.

CanRetainPaint

C++
bool CanRetainPaint() const override

Refused for the same reason: recycled rows and a selection that moves with nothing to invalidate on.

ArrangeChildren

C++
void ArrangeChildren(const CGeometry& allottedGeo) override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

tree-row.json: rows are 4 px-radius pills across the tree, hover SurfaceHover, pressed Surface4, selected Selection, the keyboard row a 1 px FocusRing inset, the 12 px Lucide chevron in a 12 px slot at 4 px + 16 px per level, and a hidden or disabled row in TextDisabled.

OnMouseWheel

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

OnMouseButtonDown

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

OnKeyDown

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

Keyboard model (U1): Up/Down walk the visible rows, Left collapses (or jumps to the parent), Right expands, Home/End jump, Enter re-broadcasts the selection as an activation.

OnMouseButtonUp

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

OnMouseMove

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

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

OnMouseCaptureLost

C++
void OnMouseCaptureLost() override

OnCursorQuery

C++
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const override

GetNumChildren

C++
int32_t GetNumChildren() const override

GetChildAt

C++
TSharedPtr<AWidget> GetChildAt(int32_t index) const override

GetTypeName

C++
const char* GetTypeName() const override

IsFocusable

C++
bool IsFocusable() const override

GetFocusVisual

C++
EFocusVisual GetFocusVisual() const override

The keyboard row carries tree-row.json's inset ring, not the tree.

PaintsOwnFocus

C++
bool PaintsOwnFocus() const override

SetOnIsItemDimmed

C++
void SetOnIsItemDimmed(std::function<bool(const ItemType&)> func)

Rows this answers true for paint in the Disabled state: the outliner's hidden actors (eye-off) read as TextDisabled.

Generated from Arc/Widgets/ATreeView.h via arc.json · Nov 5, 2026Version 1.0.0