88template<
typename ItemType>
270 this->
OnClick = InArgs._OnMouseButtonClick;
278 this->ConsumeMouseWheel = InArgs._ConsumeMouseWheel;
279 this->AllowOverscroll = InArgs._AllowOverscroll;
281 this->WheelScrollMultiplier = InArgs._WheelScrollMultiplier;
287 ? InArgs._OnItemToString_Debug
289 this->OnEnteredBadState = InArgs._OnEnteredBadState;
293 this->bAllowInvisibleItemSelection = InArgs._AllowInvisibleItemSelection;
294 this->bHighlightParentNodesForSelection = InArgs._HighlightParentNodesForSelection;
298 this->bShouldStackHierarchyHeaders = InArgs._ShouldStackHierarchyHeaders;
300 this->
SetStyle(InArgs._TreeViewStyle);
305 this->MaxPinnedItems = InArgs._MaxPinnedItems;
313 ErrorString +=
TEXT(
"Please specify an OnGenerateRow. \n");
318 ErrorString +=
TEXT(
"Please specify a TreeItemsSource. \n");
323 ErrorString +=
TEXT(
"Please specify an OnGetChildren. \n");
327 if (ErrorString.Len() > 0)
353 , bTreeItemsAreDirty(
true )
385 if ( Private_DoesItemHaveChildren(SelectionIndex) && Private_IsItemExpanded(
RangeSelectionEndItem ) )
394 for (SelectionIndex--; SelectionIndex >= 0; --SelectionIndex)
416 if ( Private_DoesItemHaveChildren(SelectionIndex) )
447 virtual bool Private_IsItemExpanded(
const ItemType&
TheItem )
const override
492 bool bHasChildren =
false;
528 virtual void Private_UpdateParentHighlights()
562 if (bHighlightParentNodesForSelection)
564 this->Private_UpdateParentHighlights();
581 if ( bTreeItemsAreDirty )
587 bTreeItemsAreDirty =
false;
601 if( !bAllowInvisibleItemSelection &&
631 if (bHighlightParentNodesForSelection)
633 this->Private_UpdateParentHighlights();
688 const bool bHasChildren = ChildItems.
Num() > 0;
692 const bool bIsLastChild = (ItemIndex ==
InItemsSource.Num() - 1);
714 if ( bIsExpanded || bHasExpandedChildren )
722 if ( bIsExpanded || bHasExpandedChildren )
748 int32 CurrentItemIndex = StartIndex;
756 int32 ParentIndex = ItemIndex;
764 if (
InItemsSource.IsValidIndex(ParentIndex) && ParentIndex < StartIndex)
769 ItemIndex = ParentIndex;
796 for (
int32 ItemIndex = FirstItem; ItemIndex <=
LastItem; ItemIndex++)
805 int32 IndexOffset = ItemIndex - FirstItem;
817 MinIndex = ItemIndex;
828 CurrentItemIndex = MinIndex;
872 if (!bTreeItemsAreDirty)
874 bTreeItemsAreDirty =
true;
916 Private_SetItemExpansion(
InItem,
true);
927 return Private_IsItemExpanded(
InItem );
932 UE_DEPRECATED(5.3,
"SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
937 UE_DEPRECATED(5.3,
"SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
942 UE_DEPRECATED(5.3,
"SetItemsSource is deprecated. You probably want to use SetTreeItemsSource.")
947 UE_DEPRECATED(5.3,
"ClearItemsSource is deprecated. You probably want to use ClearRootItemsSource.")
952 UE_DEPRECATED(5.3,
"HasValidItemsSource is deprecated. You probably want to use HasValidRootItemsSource.")
957 UE_DEPRECATED(5.3,
"GetItems is deprecated. You probably want to use GetRootItems.")
981 if (TreeViewSource ==
nullptr || !TreeViewSource->IsSame(
reinterpret_cast<const void*
>(
InItemsSource)))
1000 if (TreeViewSource ==
nullptr || !TreeViewSource->IsSame(
reinterpret_cast<const void*
>(&
InItemsSource.Get())))
1012 TreeViewSource =
MoveTemp(Provider);
1023 return TreeViewSource !=
nullptr;
1059 if (bShouldStackHierarchyHeaders.
Get())
1083 UE_DEPRECATED(5.3,
"Protected access to TreeItemsSource is deprecated. Please use GetTreeItems, SetTreeItemsSource or HasValidTreeItemsSource.")
1110 bool bTreeItemsAreDirty =
false;
1113 bool bAllowInvisibleItemSelection =
false;
1116 bool bHighlightParentNodesForSelection =
false;
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
TSharedRef< InObjectType, InMode > MakeShared(InArgTypes &&... Args)
Definition SharedPointer.h:2009
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define TRACE_CPUPROFILER_EVENT_SCOPE(Name)
Definition CpuProfilerTrace.h:528
#define SLATE_STYLE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:280
#define SNew(WidgetType,...)
Definition DeclarativeSyntaxSupport.h:37
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_ATTRIBUTE_DEPRECATED(AttrType, AttrName, DeprecationVersion, DeprecationMessage)
Definition DeclarativeSyntaxSupport.h:199
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
EFocusCause
Definition Events.h:25
return true
Definition ExternalRpcRegistry.cpp:601
#define SLATE_ITEMS_SOURCE_ARGUMENT(ArgType, ArgName)
Definition IItemsSource.h:20
#define NSLOCTEXT(InNamespace, InKey, InTextLiteral)
Definition Internationalization.h:300
const bool
Definition NetworkReplayStreaming.h:178
float GetGlobalScrollAmount()
Definition SlateConstants.h:10
EConsumeMouseWheel
Definition SlateTypes.h:26
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
bool IsEventHandled() const
Definition ReplyBase.h:19
static FReply Handled()
Definition Reply.h:233
static SLATECORE_API const FSlateBrush * GetNoBrush()
Definition StyleDefaults.cpp:6
static CORE_API FText FromString(const ANSICHAR *String)
Definition Text.cpp:1081
Definition SListView.h:66
void SetShadowBoxStyle(const FScrollBoxStyle *InScrollBoxStyle)
Definition SListView.h:1334
bool IsItemSelected(const ItemType &InItem) const
Definition SListView.h:1819
bool HasValidItemsSource() const
Definition SListView.h:1790
TAttribute< int32 > DefaultMaxPinnedItems
Definition SListView.h:2742
TArrayView< const ItemType > GetItems() const
Definition SListView.h:1795
FOnGenerateRow OnGeneratePinnedRow
Definition SListView.h:2642
FOnKeyDown OnKeyDownHandler
Definition SListView.h:2703
FOnRefreshRow OnRefreshRow
Definition SListView.h:2645
virtual void Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) override
Definition SListView.h:1025
void ReGeneratePinnedItems(const TArray< ItemType > &InItems, const FGeometry &MyGeometry, int32 MaxPinnedItemsOverride=-1)
Definition SListView.h:1583
virtual void Private_ClearHighlightedItems() override
Definition SListView.h:1112
FOnItemToString_Debug OnItemToString_Debug
Definition SListView.h:2648
NullableItemType RangeSelectionStart
Definition SListView.h:2669
FIsSelectableOrNavigable OnIsSelectableOrNavigable
Definition SListView.h:2694
static FOnItemToString_Debug GetDefaultDebugDelegate()
Definition SListView.h:2145
FOnWidgetToBeRemoved OnRowReleased
Definition SListView.h:2654
FOnItemScrolledIntoView OnItemScrolledIntoView
Definition SListView.h:2657
NullableItemType SelectorItem
Definition SListView.h:2666
FOnMouseButtonClick OnClick
Definition SListView.h:2697
FOnMouseButtonDoubleClick OnDoubleClick
Definition SListView.h:2700
FOnTableViewBadState OnEnteredBadState
Definition SListView.h:2651
bool bHandleDirectionalNavigation
Definition SListView.h:2718
const TArray< ItemType > * ItemsSource
Definition SListView.h:2676
void SetItemsSource(const TArray< ItemType > *InListItemsSource)
Definition SListView.h:1721
virtual void Private_SetItemHighlighted(ItemType TheItem, bool bShouldBeHighlighted) override
Definition SListView.h:1100
FOnGenerateRow OnGenerateRow
Definition SListView.h:2639
TItemSet SelectedItems
Definition SListView.h:2663
FOnFinishedScrolling OnFinishedScrolling
Definition SListView.h:2660
FReply OnKeyDown_Internal(const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent)
Definition SListView.h:370
virtual void RebuildList() override
Definition SListView.h:1921
bool bReturnFocusToSelection
Definition SListView.h:2724
void ClearItemsSource()
Definition SListView.h:1772
FOnSelectionChanged OnSelectionChanged
Definition SListView.h:2691
virtual void NavigationSelect(const ItemType &InItemToSelect, const FInputEvent &InInputEvent)
Definition SListView.h:2566
bool bHandleGamepadEvents
Definition SListView.h:2715
TAttribute< int32 > MaxPinnedItems
Definition SListView.h:2739
virtual FReGenerateResults ReGenerateItems(const FGeometry &MyGeometry) override
Definition SListView.h:1395
bool bClearSelectionOnClick
Definition SListView.h:2712
Definition STableRow.h:87
TAttribute< ESelectionMode::Type > SelectionMode
Definition STableViewBase.h:526
const FScrollBoxStyle * ShadowBoxStyle
Definition STableViewBase.h:559
SLATE_API int32 GetNumPinnedItems() const
Definition STableViewBase.cpp:1390
TSharedPtr< SHeaderRow > HeaderRow
Definition STableViewBase.h:529
bool bShouldUseShadowBoxStyle
Definition STableViewBase.h:556
float WheelScrollMultiplier
Definition STableViewBase.h:541
FSimpleDelegate OnItemsRebuilt
Definition STableViewBase.h:523
virtual SLATE_API void RequestListRefresh()
Definition STableViewBase.cpp:837
EAllowOverscroll AllowOverscroll
Definition STableViewBase.h:589
TSharedPtr< SListPanel > ItemsPanel
Definition STableViewBase.h:437
virtual SLATE_API void Tick(const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
Definition STableViewBase.cpp:364
SLATE_API void ClearPinnedWidgets()
Definition STableViewBase.cpp:1209
FOnContextMenuOpening OnContextMenuOpening
Definition STableViewBase.h:520
virtual SLATE_API FReply OnMouseButtonDoubleClick(const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent) override
Definition STableViewBase.cpp:555
TSharedPtr< SScrollBar > ScrollBar
Definition STableViewBase.h:443
SLATE_API void SetBackgroundBrush(const TAttribute< const FSlateBrush * > &InBackgroundBrush)
Definition STableViewBase.cpp:1160
EConsumeMouseWheel ConsumeMouseWheel
Definition STableViewBase.h:592
bool bEnableAnimatedScrolling
Definition STableViewBase.h:471
SLATE_API void ConstructChildren(const TAttribute< float > &InItemWidth, const TAttribute< float > &InItemHeight, const TAttribute< EListItemAlignment > &InItemAlignment, const TSharedPtr< SHeaderRow > &InHeaderRow, const TSharedPtr< SScrollBar > &InScrollBar, EOrientation InScrollOrientation, const FOnTableViewScrolled &InOnTableViewScrolled, const FScrollBarStyle *InScrollBarStyle=nullptr, const bool bInPreventThrottling=false)
Definition STableViewBase.cpp:130
TOptional< double > FixedLineScrollOffset
Definition STableViewBase.h:468
Definition STextBlock.h:45
Definition STreeView.h:90
bool HasValidItemsSource() const
Definition STreeView.h:953
virtual void Private_SignalSelectionChanged(ESelectInfo::Type SelectInfo) override
Definition STreeView.h:558
TArrayView< const ItemType > GetItems() const
Definition STreeView.h:958
void SetRootItemsSource(const TArray< ItemType > *InItemsSource)
Definition STreeView.h:978
typename TListTypeTraits< ItemType >::MapKeyFuncsSparse MapKeyFuncsSparse
Definition STreeView.h:95
typename SListView< ItemType >::FOnWidgetToBeRemoved FOnWidgetToBeRemoved
Definition STreeView.h:113
int32 PopulatePinnedItems(const TArray< ItemType > &InItemsSource, TArray< ItemType > &InPinnedItems, const STableViewBase::FReGenerateResults &Results)
Definition STreeView.h:736
typename TListTypeTraits< ItemType >::NullableType NullableItemType
Definition STreeView.h:93
void SetItemsSource(const TArray< ItemType > *InListItemsSource)
Definition STreeView.h:933
typename TSlateDelegates< ItemType >::FOnGenerateRow FOnGenerateRow
Definition STreeView.h:101
bool IsItemExpanded(const ItemType &InItem) const
Definition STreeView.h:925
SLATE_BEGIN_ARGS(STreeView< ItemType >)
Definition STreeView.h:117
virtual STableViewBase::FReGenerateResults ReGenerateItems(const FGeometry &MyGeometry) override
Definition STreeView.h:1054
void SetItemExpansion(const ItemType &InItem, bool InShouldExpandItem)
Definition STreeView.h:902
FOnExpansionChanged OnExpansionChanged
Definition STreeView.h:1100
TSet< TObjectPtrWrapTypeOf< ItemType >, typename TListTypeTraits< TObjectPtrWrapTypeOf< ItemType > >::SetKeyFuncs > TItemSet
Definition STreeView.h:98
void SetSingleExpandedItem(const ItemType &InItem)
Definition STreeView.h:908
STreeView()
Definition STreeView.h:351
FOnGetChildren OnGetChildren
Definition STreeView.h:1078
virtual void Tick(const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
Definition STreeView.h:577
typename TSlateDelegates< ItemType >::FOnItemScrolledIntoView FOnItemScrolledIntoView
Definition STreeView.h:104
const TArray< ItemType > * TreeItemsSource
Definition STreeView.h:1085
typename TSlateDelegates< ItemType >::FIsSelectableOrNavigable FIsSelectableOrNavigable
Definition STreeView.h:106
void SetStyle(const FTableViewStyle *InStyle)
Definition STreeView.h:890
typename TSlateDelegates< ItemType >::FOnItemToString_Debug FOnItemToString_Debug
Definition STreeView.h:111
bool PopulateLinearizedItems(TArrayView< const ItemType > InItemsSource, TArray< ItemType > &InLinearizedItems, TArray< FItemInfo > &NewDenseItemInfos, TBitArray<> NeedsParentWire, TItemSet &OutNewSelectedItems, TSparseItemMap &NewSparseItemInfo, bool bAddingItems, int32 ParentIndex)
Definition STreeView.h:661
TArray< ItemType > LinearizedItems
Definition STreeView.h:1097
void GetExpandedItems(TItemSet &ExpandedItems) const
Definition STreeView.h:1036
typename TSlateDelegates< ItemType >::FOnGetChildren FOnGetChildren
Definition STreeView.h:100
void ClearRootItemsSource()
Definition STreeView.h:1016
typename TSlateDelegates< ItemType >::FOnSetExpansionRecursive FOnSetExpansionRecursive
Definition STreeView.h:103
virtual FReply OnKeyDown(const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent) override
Definition STreeView.h:362
virtual TSharedRef< ITableRow > GenerateNewWidget(ItemType InItem) override
Definition STreeView.h:847
virtual void RebuildList() override
Definition STreeView.h:884
void SetRootItemsSource(TUniquePtr< UE::Slate::ItemsSource::IItemsSource< ItemType > > Provider)
Definition STreeView.h:1010
typename TSlateDelegates< NullableItemType >::FOnSelectionChanged FOnSelectionChanged
Definition STreeView.h:105
bool HasValidRootItemsSource() const
Definition STreeView.h:1021
void SetRootItemsSource(TSharedRef< UE::Slate::Containers::TObservableArray< ItemType > > InItemsSource)
Definition STreeView.h:998
TArray< FItemInfo > DenseItemInfos
Definition STreeView.h:1091
TSparseItemMap SparseItemInfos
Definition STreeView.h:1088
typename TSlateDelegates< ItemType >::FOnExpansionChanged FOnExpansionChanged
Definition STreeView.h:109
typename TListTypeTraits< ItemType >::MapKeyFuncs MapKeyFuncs
Definition STreeView.h:94
typename TSlateDelegates< ItemType >::FOnRefreshRow FOnRefreshRow
Definition STreeView.h:102
void SetTreeItemsSource(const TArray< ItemType > *InItemsSource)
Definition STreeView.h:969
TArrayView< const ItemType > GetRootItems() const
Definition STreeView.h:1026
FOnSetExpansionRecursive OnSetExpansionRecursive
Definition STreeView.h:1081
void RequestTreeRefresh()
Definition STreeView.h:879
void ClearItemsSource()
Definition STreeView.h:948
typename TSlateDelegates< ItemType >::FOnMouseButtonClick FOnMouseButtonClick
Definition STreeView.h:107
void ClearExpandedItems()
Definition STreeView.h:1048
const FTableViewStyle * Style
Definition STreeView.h:1103
void Construct(const FArguments &InArgs)
Definition STreeView.h:253
typename TSlateDelegates< ItemType >::FOnMouseButtonDoubleClick FOnMouseButtonDoubleClick
Definition STreeView.h:108
virtual void RequestListRefresh() override
Definition STreeView.h:870
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_NODEBUG UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition Array.h:1122
UE_NODEBUG UE_FORCEINLINE_HINT bool Find(const ElementType &Item, SizeType &Index) const
Definition Array.h:1302
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition Attribute.h:17
const ObjectType & Get() const
Definition Attribute.h:241
UE_FORCEINLINE_HINT int32 Num() const
Definition BitArray.h:1466
TSharedRef< SWidget, Mode > AsShared()
Definition SharedPointer.h:1650
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis(OtherType *ThisPtr)
Definition SharedPointer.h:1780
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SharedPointer.h:153
Definition SlateDelegates.h:134
Definition UniquePtr.h:107
Definition IItemsSource.h:106
Definition IItemsSource.h:200
Definition IItemsSource.h:91
UE_REWRITE void Reverse(T(&Array)[ArraySize])
Definition Reverse.h:28
Type
Definition SlateEnums.h:311
@ Direct
Definition SlateEnums.h:319
Definition ITypedTableView.h:14
Definition ITypedTableView.h:35
const FName ParentIndex("ParentIndex")
Definition SkeletalMeshAttributes.h:33
Definition SScissorRectBox.cpp:10
SLATE_API const TBitArray & GetEmptyBitArray()
Definition STableViewBase.cpp:1402
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
static INPUTCORE_API const FKey Left
Definition InputCoreTypes.h:319
static INPUTCORE_API const FKey Right
Definition InputCoreTypes.h:321
Definition STreeView.h:45
int32 GetNestingLevel() const
Definition STreeView.h:65
TBitArray NeedsVerticalWire
Definition STreeView.h:63
uint32 bHasChildren
Definition STreeView.h:68
FItemInfo(TBitArray<> InNeedsVerticalWire, bool InHasChildren, bool InIsLastChild, int32 InParentIndex)
Definition STreeView.h:50
uint32 bIsLastChild
Definition STreeView.h:71
int32 ParentIndex
Definition STreeView.h:74
FItemInfo()
Definition STreeView.h:46
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition STreeView.h:22
FSparseItemInfo(bool InIsExpanded, bool InHasExpandedChildren)
Definition STreeView.h:29
bool bIsExpanded
Definition STreeView.h:36
bool bHasExpandedChildren
Definition STreeView.h:39
Definition SlateTypes.h:1606
FSlateBrush BackgroundBrush
Definition SlateTypes.h:1622
Definition STableViewBase.h:365
double NewScrollOffset
Definition STableViewBase.h:374
bool bGeneratedPastLastItem
Definition STableViewBase.h:383
Definition TableViewTypeTraits.h:121
Definition NumericLimits.h:41
Definition Optional.h:131
Definition ObservableArray.h:187