CArcDragDropManager
- Module
- Arc
- Header
#include "Arc/DragDrop/CDragDropOperation.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | DRAG_THRESHOLD | Pixels of movement before a drag starts Default 4.0f. |
static constexpr float | DECORATOR_OFFSET | Where the ghost sits relative to the pointer, clear of the cursor glyph Default 14.0f. |
Public functions
| Returns | Name | Description |
|---|---|---|
CArcDragDropManager& | Get | |
void | BeginDrag | |
void | UpdateDrag | Called every frame while dragging |
void | UpdateDrag | |
void | EndDrag | |
bool | IsDragging | |
CDragDropOperation* | GetActiveOperation | |
void | RouteHover | The candidate path under the cursor, ordered root to leaf. |
TSharedPtr<AWidget> | GetDropTarget | The widget currently holding the drag, and whether it says yes to a drop right now. |
bool | HasDropTarget | |
bool | IsTargetAccepting | |
bool | WasLastDropDelivered | Whether the last EndDrag's target reported the drop consumed (OnDrop returned true). |
bool | PaintDecorator | Paints the active operation's DecoratorWidget beside the cursor, on top of everything the window drew. |
Function details
Get
static CArcDragDropManager& Get()BeginDrag
void BeginDrag(Ref<CDragDropOperation> operation, const ArcVec2& startPos)UpdateDrag
void UpdateDrag(const ArcVec2& cursorPos)Called every frame while dragging
UpdateDrag
void UpdateDrag(const ArcVec2& cursorPos, EModifierKey modifiers)EndDrag
void EndDrag(bool cancelled = false)IsDragging
bool IsDragging() constGetActiveOperation
CDragDropOperation* GetActiveOperation() constRouteHover
void RouteHover(const std::vector<TSharedPtr<AWidget>>& path, const ArcVec2& cursorPos, EModifierKey modifiers)The candidate path under the cursor, ordered root to leaf. The input processor hands this over on every move; the manager resolves the target from it and never hit-tests on its own.
GetDropTarget
TSharedPtr<AWidget> GetDropTarget() constThe widget currently holding the drag, and whether it says yes to a drop right now. A source that keeps its own validity query must leave IsAllowed alone while a target owns the answer.
HasDropTarget
bool HasDropTarget() constIsTargetAccepting
bool IsTargetAccepting() constWasLastDropDelivered
bool WasLastDropDelivered() constWhether the last EndDrag's target reported the drop consumed (OnDrop returned true). False after a cancel or a rejection.
PaintDecorator
bool PaintDecorator(class CArcUIRenderer& renderer, const CGeometry& windowRoot, float deltaTime)Paints the active operation's DecoratorWidget beside the cursor, on top of everything the window drew. Returns false when there is no drag or no decorator. The field existed and nothing ever read it, so every source painted its own ghost or showed none.