59template <
typename ItemType>
95 bAllowDragging = InArgs._bAllowDragging;
96 bAllowDragDrop = InArgs._bAllowDragDrop;
97 bAllowKeepPreselectedItems = InArgs._bAllowKeepPreselectedItems;
106 ContentWidget = InArgs._Content.Widget;
111 .Text(
NSLOCTEXT(
"SObjectTableRow",
"InvalidWidgetClass",
"Any UserWidget generated as a table row must implement the IUserListEntry interface"));
114 SObjectWidget::Construct(
115 SObjectWidget::FArguments()
198 return OwnerTable ? OwnerTable->Private_GetNestingDepth(IndexInList) : 0;
203 return OwnerTable ? OwnerTable->Private_DoesItemHaveChildren(IndexInList) : 0;
225 return OwnerTable->Private_IsItemExpanded(*
MyItemPtr);
234 if (OwnerTable && OwnerTable->Private_DoesItemHaveChildren(IndexInList))
238 OwnerTable->Private_SetItemExpansion(*
MyItemPtr, !OwnerTable->Private_IsItemExpanded(*
MyItemPtr));
249 return OwnerTable->Private_IsItemSelected(*
MyItemPtr);
258 return OwnerTable ? OwnerTable->Private_GetWiresNeededByDepth(IndexInList) :
TBitArray<>();
264 return OwnerTable ? OwnerTable->Private_IsLastChild(IndexInList) :
true;
301 OwnerTable->Private_OnItemDoubleClicked(*
MyItemPtr);
311 bProcessingSelectionTouch =
true;
321 if (bProcessingSelectionTouch)
323 bProcessingSelectionTouch =
false;
333 const bool bIsSelected = OwnerTable->Private_IsItemSelected(*
MyItemPtr);
338 OwnerTable->Private_ClearSelection();
340 OwnerTable->Private_SetItemSelection(*
MyItemPtr,
true,
true);
347 OwnerTable->Private_SetItemSelection(*
MyItemPtr,
true,
true);
355 if (OwnerTable->Private_OnItemClicked(*
MyItemPtr))
369 if (bAllowDragging || bAllowDragDrop)
373 if (bProcessingSelectionTouch)
375 bProcessingSelectionTouch =
false;
382 bDragWasDetected =
true;
414 IUserObjectListEntry::SetListItemObject(*DragVisualWidget, Operation->
Payload);
423 bProcessingSelectionTouch =
false;
456 const float Size =
Orientation == EOrientation::Orient_Horizontal ? LocalSize.
X : LocalSize.
Y;
552 OwnerTable->Private_SetItemExpansion(*
MyItemPtr,
true);
600 bChangedSelectionOnMouseDown =
false;
601 bDragWasDetected =
false;
619 const bool bIsSelected = OwnerTable->Private_IsItemSelected(MyItem);
625 OwnerTable->Private_SelectRangeFromCurrentTo(MyItem);
626 bChangedSelectionOnMouseDown =
true;
631 OwnerTable->Private_SetItemSelection(MyItem, !bIsSelected,
true);
632 bChangedSelectionOnMouseDown =
true;
636 if (!bIsSelected && !bChangedSelectionOnMouseDown)
640 OwnerTable->Private_ClearSelection();
642 OwnerTable->Private_SetItemSelection(MyItem,
true,
true);
643 bChangedSelectionOnMouseDown =
true;
685 OwnerTable->Private_ClearSelection();
689 OwnerTable->Private_GetNumSelectedItems() > 1 &&
690 OwnerTable->Private_IsItemSelected(*
MyItemPtr))
695 OwnerTable->Private_ClearSelection();
696 OwnerTable->Private_SetItemSelection(*
MyItemPtr,
true,
true);
708 if (OwnerTable->Private_OnItemClicked(*
MyItemPtr))
724 OwnerTable->Private_ClearSelection();
725 OwnerTable->Private_SetItemSelection(*
MyItemPtr,
true,
true);
742 return bAllowDragDrop;
757 OwnerTable->Private_SetItemSelection(*
MyItemPtr,
false,
false);
764 bIsAppearingSelected =
false;
781 if (bIsAppearingSelected != OwnerTable->Private_IsItemSelected(*
MyItemPtr))
783 bIsAppearingSelected = !bIsAppearingSelected;
812 checkf(OwnerTable->Private_IsPendingRefresh(),
TEXT(
"We were unable to find the item for this widget. If it was removed from the source collection, the list should be pending a refresh. %s"), *
FReflectionMetaData::GetWidgetPath(
this,
false,
false));
834 bool bChangedSelectionOnMouseDown =
false;
835 bool bIsAppearingSelected =
false;
837 bool bProcessingSelectionTouch =
false;
840 bool bAllowKeepPreselectedItems =
true;
849 bool bDragWasDetected =
false;
860 IUserObjectListEntry::SetListItemObject(*WidgetObject,
ListItemObject);
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
@ INDEX_NONE
Definition CoreMiscDefines.h:150
constexpr FNullOpt NullOpt
Definition Optional.h:15
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SNew(WidgetType,...)
Definition DeclarativeSyntaxSupport.h:37
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_DEFAULT_SLOT(DeclarationType, SlotName)
Definition DeclarativeSyntaxSupport.h:444
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
#define DECLARE_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:57
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
#define DECLARE_DELEGATE_RetVal_ThreeParams(ReturnValueType, DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:72
return true
Definition ExternalRpcRegistry.cpp:601
#define NSLOCTEXT(InNamespace, InKey, InTextLiteral)
Definition Internationalization.h:300
typename UE::Core::Private::TObjectPtrWrapTypeOf< T >::Type TObjectPtrWrapTypeOf
Definition ObjectPtr.h:1761
EItemDropZone
Definition STableRow.h:59
EActiveTimerReturnType
Definition SlateEnums.h:329
EOrientation
Definition SlateEnums.h:261
uint32 Size
Definition VulkanMemory.cpp:4034
Definition DragAndDrop.h:141
Definition NameTypes.h:617
bool IsEventHandled() const
Definition ReplyBase.h:19
FReply & BeginDragDrop(TSharedRef< FDragDropOperation > InDragDropContent)
Definition Reply.h:143
FReply & ReleaseMouseCapture()
Definition Reply.h:114
FReply & DetectDrag(const TSharedRef< SWidget > &DetectDragInMe, FKey MouseButton)
Definition Reply.h:129
static FReply Unhandled()
Definition Reply.h:241
FReply & EndDragDrop()
Definition Reply.h:150
SLATECORE_API FReply & SetUserFocus(TSharedRef< SWidget > GiveMeFocus, EFocusCause ReasonFocusIsChanging=EFocusCause::SetDirectly, bool bInAllUsers=false)
Definition Reply.cpp:40
FReply & CaptureMouse(TSharedRef< SWidget > InMouseCaptor)
Definition Reply.h:28
static FReply Handled()
Definition Reply.h:233
static UMG_API TSharedRef< FUMGDragDropOp > New(UDragDropOperation *Operation, const int32 PointerIndex, const FVector2D &CursorPosition, const FVector2D &ScreenPositionOfNode, float DPIScale, TSharedPtr< SObjectWidget > SourceUserWidget)
Definition UMGDragDropOp.cpp:170
Definition SObjectTableRow.h:18
virtual UUserWidget * GetUserWidget() const =0
static TSharedPtr< const IObjectTableRow > ObjectRowFromUserWidget(const UUserWidget *RowUserWidget)
Definition SObjectTableRow.h:23
virtual UListViewBase * GetOwningListView() const =0
static UMG_API TMap< TWeakObjectPtr< const UUserWidget >, TWeakPtr< const IObjectTableRow > > ObjectRowsByUserWidget
Definition SObjectTableRow.h:36
Definition ITableRow.h:15
Definition ITypedTableView.h:48
Definition IUserListEntry.h:28
static UMG_API void UpdateEntryDragOverState(UUserWidget &ListEntryWidget, bool bIsDraggingOver)
Definition IUserListEntry.cpp:62
static UMG_API void HandleEntryDropped(UUserWidget &ListEntryWidget, UDragDropOperation *Operation)
Definition IUserListEntry.cpp:86
static UMG_API void UpdateItemSelection(UUserWidget &ListEntryWidget, bool bIsSelected)
Definition IUserListEntry.cpp:30
static UMG_API void UpdateItemExpansion(UUserWidget &ListEntryWidget, bool bIsExpanded)
Definition IUserListEntry.cpp:42
static UMG_API void EndEntryDropOperation(UUserWidget &ListEntryWidget, bool bSuccess)
Definition IUserListEntry.cpp:70
static UMG_API void ReleaseEntry(UUserWidget &ListEntryWidget)
Definition IUserListEntry.cpp:18
static UMG_API void HandleEntryDragged(UUserWidget &ListEntryWidget, UDragDropOperation *Operation)
Definition IUserListEntry.cpp:78
static UMG_API void UpdateEntryDropIndicator(UUserWidget &ListEntryWidget, TOptional< EItemDropZone > DropZone)
Definition IUserListEntry.cpp:54
Definition SObjectTableRow.h:61
bool GetAllowDragDrop() const
Definition SObjectTableRow.h:740
virtual bool IsItemSelected() const override
Definition SObjectTableRow.h:243
bool IsItemSelectable() const
Definition SObjectTableRow.h:797
virtual void Private_OnExpanderArrowShiftClicked() override
Definition SObjectTableRow.h:205
virtual FReply OnTouchStarted(const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
Definition SObjectTableRow.h:308
virtual void OnMouseEnter(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SObjectTableRow.h:275
FOnObjectRowAcceptDrop OnRowAcceptDrop
Definition SObjectTableRow.h:821
FOnObjectRowCanAcceptDrop OnRowCanAcceptDrop
Definition SObjectTableRow.h:820
FOnObjectRowDragLeave OnRowDragLeave
Definition SObjectTableRow.h:824
virtual ESelectionMode::Type GetSelectionMode() const override
Definition SObjectTableRow.h:209
const TObjectPtrWrapTypeOf< ItemType > * GetItemForThis(const TSharedRef< ITypedTableView< ItemType > > &OwnerTable) const
Definition SObjectTableRow.h:803
virtual void HandleEntryDragged(UDragDropOperation *Operation)
Definition SObjectTableRow.h:590
virtual int32 GetIndexInList() override
Definition SObjectTableRow.h:187
virtual void OnMouseLeave(const FPointerEvent &MouseEvent) override
Definition SObjectTableRow.h:284
virtual FReply OnTouchEnded(const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
Definition SObjectTableRow.h:317
void OnDragCancelled(const FDragDropEvent &DragDropEvent, UDragDropOperation *Operation) override
Definition SObjectTableRow.h:571
void Construct(const FArguments &InArgs, const TSharedRef< STableViewBase > &InOwnerTableView, UUserWidget &InWidgetObject, UListViewBase *InOwnerListView=nullptr)
Definition SObjectTableRow.h:84
virtual FReply OnMouseButtonUp(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SObjectTableRow.h:664
virtual UListViewBase * GetOwningListView() const
Definition SObjectTableRow.h:138
TWeakObjectPtr< UListViewBase > OwnerListView
Definition SObjectTableRow.h:827
TWeakPtr< ITypedTableView< ItemType > > OwnerTablePtr
Definition SObjectTableRow.h:828
virtual void OnDragEnter(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
Definition SObjectTableRow.h:427
FOnRowHovered OnUnhovered
Definition SObjectTableRow.h:819
virtual void ToggleExpansion() override
Definition SObjectTableRow.h:231
virtual void ResetRow() override final
Definition SObjectTableRow.h:171
virtual FReply OnDragOver(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
Definition SObjectTableRow.h:473
virtual FReply OnDragDetected(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SObjectTableRow.h:365
SLATE_BEGIN_ARGS(SObjectTableRow< ItemType >)
Definition SObjectTableRow.h:63
virtual TSharedRef< SWidget > AsWidget() override
Definition SObjectTableRow.h:179
virtual void ResetObjectRow()
Definition SObjectTableRow.h:762
FOnRowHovered OnHovered
Definition SObjectTableRow.h:818
FOnObjectRowDragEnter OnRowDragEnter
Definition SObjectTableRow.h:823
virtual FReply OnMouseButtonDown(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SObjectTableRow.h:598
FOnObjectRowDragDetected OnRowDragDetected
Definition SObjectTableRow.h:822
virtual ~SObjectTableRow()
Definition SObjectTableRow.h:127
virtual void HandleEntryDropped(UDragDropOperation *Operation)
Definition SObjectTableRow.h:582
virtual int32 GetIndentLevel() const override
Definition SObjectTableRow.h:195
EActiveTimerReturnType DetectItemSelectionChanged(double InCurrentTime, float InDeltaTime)
Definition SObjectTableRow.h:147
FOnObjectRowDragCancelled OnRowDragCancelled
Definition SObjectTableRow.h:825
virtual bool IsLastChild() const override
Definition SObjectTableRow.h:261
virtual bool IsItemExpanded() const override
Definition SObjectTableRow.h:219
virtual void OnItemSelectionChanged(bool bIsItemSelected)
Definition SObjectTableRow.h:789
EItemDropZone ZoneFromPointerPosition(UE::Slate::FDeprecateVector2DParameter LocalPointerPos, UE::Slate::FDeprecateVector2DParameter LocalSize, EOrientation Orientation)
Definition SObjectTableRow.h:453
virtual FVector2D GetRowSizeForColumn(const FName &InColumnName) const override
Definition SObjectTableRow.h:214
virtual TBitArray GetWiresNeededByDepth() const override
Definition SObjectTableRow.h:255
virtual TSharedPtr< SWidget > GetContent() override
Definition SObjectTableRow.h:191
virtual void OnDragLeave(FDragDropEvent const &DragDropEvent) override
Definition SObjectTableRow.h:438
virtual void SetIndexInList(int32 InIndexInList) override
Definition SObjectTableRow.h:183
virtual void NotifyItemExpansionChanged(bool bIsExpanded)
Definition SObjectTableRow.h:153
virtual bool SupportsKeyboardFocus() const override
Definition SObjectTableRow.h:270
virtual void DetectItemSelectionChanged()
Definition SObjectTableRow.h:771
virtual FReply OnDrop(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
Definition SObjectTableRow.h:501
virtual void InitializeRow() override final
Definition SObjectTableRow.h:162
virtual FReply OnMouseButtonDoubleClick(const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent) override
Definition SObjectTableRow.h:293
virtual int32 DoesItemHaveChildren() const override
Definition SObjectTableRow.h:200
virtual UUserWidget * GetUserWidget() const
Definition SObjectTableRow.h:133
virtual void InitializeObjectRow()
Definition SObjectTableRow.h:746
Definition STableViewBase.h:110
Definition STextBlock.h:45
Definition UnrealString.h.inl:34
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis(OtherType *ThisPtr)
Definition SharedPointer.h:1780
Definition SharedPointer.h:692
TSharedRef< ObjectType, Mode > ToSharedRef() const &
Definition SharedPointer.h:1028
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
UE_FORCEINLINE_HINT TSharedPtr< ObjectType, Mode > Pin() const &
Definition SharedPointer.h:1512
Definition DragDropOperation.h:55
TObjectPtr< class UWidget > DefaultDragVisual
Definition DragDropOperation.h:78
TObjectPtr< UObject > Payload
Definition DragDropOperation.h:71
Definition ListViewBase.h:546
bool Implements() const
Definition Class.h:5202
Definition IUserListEntry.h:23
Definition IUserObjectListEntry.h:14
@ OnMouseClick
Definition SlateEnums.h:317
Type
Definition ITypedTableView.h:16
@ None
Definition ITypedTableView.h:18
@ Multi
Definition ITypedTableView.h:27
@ SingleToggle
Definition ITypedTableView.h:24
@ false
Definition radaudio_common.h:23
static INPUTCORE_API const FKey RightMouseButton
Definition InputCoreTypes.h:301
static INPUTCORE_API const FKey LeftMouseButton
Definition InputCoreTypes.h:300
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
FORCEINLINE T * Get() const
Definition ObjectPtr.h:664
Definition Optional.h:131
Definition WeakObjectPtrTemplates.h:25
FORCEINLINE T * Get(bool bEvenIfPendingKill) const
Definition WeakObjectPtrTemplates.h:132
FORCEINLINE bool IsValid(bool bEvenIfPendingKill, bool bThreadsafeTest=false) const
Definition WeakObjectPtrTemplates.h:232
T Y
Definition Vector2D.h:52
T X
Definition Vector2D.h:49
static CORE_API const TVector2< double > ZeroVector
Definition Vector2D.h:63
Definition SlateVector2.h:485