[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TDragImageList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TDragImageList - a list of Images to be dragged

## Declaration

Source position: controls.pp line 288

`type TDragImageList = class(TCustomImageList)`
``
`class procedure WSRegisterClass; override;`
`protected`
`procedure Initialize; override;` |  | Initialize the list of images for dragging
`public`
`function BeginDrag();` |  | BeginDrag - start the drag process; returns True if successful
`function DragLock();` |  | DragLock - returns True if dragging has been locked for the specifies window at given location
`function DragMove();` |  | DragMove - move dragged images to specified location and return True if successful
`procedure DragUnlock;` |  | DragUnlock - unlock the list of images for dragging
`function EndDrag;` |  | EndDrag - retuns True if the drag process has ended
`function GetHotSpot; override;` |  | GetHotSpot - returns the co-ordinates for the hotspot of the drag image
`procedure HideDragImage;` |  | HideDragImage - method for making dragged image invisible
`function SetDragImage();` |  | Determines the image to be shown
`procedure ShowDragImage;` |  | ShowDragImage - display the dragged image
`property DragCursor: TCursor; [rw]` |  | DragCursor - the cursor for use during the dragging process
`property DragHotspot: TPoint; [rw]` |  | DragHotspot - the position of the HotSpot (usually the pointer of the cursor)
`property Dragging: Boolean; [r]` |  | Dragging - True if dragging is proceeding
`end;`

## Inheritance

`TDragImageList` |  | TDragImageList - a list of Images to be dragged
`TCustomImageList` |  | Base class for TImageList (not the same as a TBitmap collection)
`TLCLReferenceComponent` |  | Base class for all components having a handle.
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

A drag image is shown when a DragImageList is supplied at all, and when no accepting target is under the mouse, or the source control style includes csDisplayDragImage, or AlwaysShowDragImage is set in the DragObject.

In drag-dock operations typically no drag image is shown, since the DockRect frame already gives all required visual feedback.

    This is a vague idea of the usage of this class:

    SetDragImage selects an image from the list, and defines the hotspot within this image.

    DragLock specifies a window (handle), to which the image should be attached [what exactly does this mean?]

    ShowDragImage shows the image, combined with the mouse cursor. The HotSpot indicates the shift of the image, relative to the current mouse position.

    HideDragImage hides the image, shown at its last position.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .