TDragObject class
Base class for managing drag operations and user feedback.
Declaration
TDragObject = classDescends from it: TDragControlObject TDragDockObject TDragObjectEx
Description
Every dragging operation has an associated DragObject, holding references to the source and target controls, and other parameters for the customization of the visual user feedback.
A default DragObject is created automatically when a dragging
operation starts, and is destroyed when the operation has ended; you do not
need to maintain it. But an application can provide a customized
DragObject in the OnStartDrag or OnStartDock handlers for the source control (the one being
dragged).
TDragObject is the ancestor of a whole tree of dragging objects,
with the main branches supporting either drag-drop or drag-dock operations.
The type of the operation is determined using the
DragKind property in the source control.
A Lazarus DragObject mainly supplies the cursor and images, used in visual user feedback. Drag-drop operations typically signal acceptance of an possible drop by variations of the mouse cursor, and optionally can attach to it shapes of the dragged object(s). Drag-dock operations instead show a docking rectangle, that snaps to possible target locations when the mouse moves over docksites.
See also
Properties
AlwaysShowDragImages | public | Should the image of dragged objects always be shown? |
AutoCreated | public | Was the drag object created automatically? |
AutoFree | public | Indicates whether the object shall be destroyed at the end of the dragging operation. |
Control | public | The control that is dragged (source). |
DragPos | public | Current mouse position in screen coordinates. |
DragTarget | public | The control over which the object currently is dragged (target). |
DragTargetPos | public | Mouse position in client coordinates of the DragTarget. |
Dropped | public | Indicates whether the drag object has been dropped yet. |
Methods
EndDrag | protected | Called when a dragging operation ends. |
GetDragImages | protected | Returns a list of images for dragging. |
GetDragCursor | protected | Returns the dragging cursor type (shape). |
Create | public | Constructor for the class instance. |
AutoCreate | public | Special constructor which enforces destruction of the object at the end of the dragging operation. |
HideDragImage | public | Asks the image list to hide the drag image. |
ShowDragImage | public | Asks the image list to show the drag image. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
