Class UGKWidgetDraggable
Defined in File GKWidgetDraggable.h
Inheritance Relationships
Base Type
public UUserWidget
Class Documentation
-
class UGKWidgetDraggable : public UUserWidget
Simple Draggable widget, set DragKey, DragVisualClass & implement IsDraggable()
failure. Nevertheless, failure to restore the parent will make the dragged widget disappear.
Note
In design time, it is possible to place
UGKWidgetDraggableoutside of aUGKWidgetDropZone. Nevertheless, this use is not well supported as on drag and drop failure the widget position & size will reset to something different from its design time position and size, making the user experience less than ideal.Warning
If you use
UPanelWidget::AddChildonUGKWidgetDraggableit will lose its previous parent.UGKWidgetDragVisualwill try to restore the parent ofUGKWidgetDraggableon dragPublic Functions
-
virtual void NativeConstruct() override
-
bool IsDraggable()
Return true to enable Dragging the widget.
-
bool IsDraggable_Native()
-
FReply NativeOnMouseButtonDown(const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
Compute the drag offset and call NativeOnDragDetected.
-
void NativeOnDragDetected(const FGeometry &InGeometry, const FPointerEvent &InMouseEvent, UDragDropOperation *&OutOperation) override
Create the Drag Widget visual & Create a new DragDrop operation.
-
void OnDropCancelled_Native(class UDragDropOperation *Operation)
-
void OnDropCancelled(class UDragDropOperation *Operation)
-
void OnDropSuccess_Native(class UDragDropOperation *Operation)
-
void OnDropSuccess(class UDragDropOperation *Operation)
Public Members
-
FKey DragKey
Key press used to create Drag and Drop operation.
-
TSubclassOf<UGKWidgetDragVisual> DragVisualClass
Widget to use to visualize the Dragging operation Usually people use the same widget
-
virtual void NativeConstruct() override