TCustomRichViewEdit.OnOleDrop [VCL and LCL]

<< Click to display table of contents >>

TCustomRichViewEdit.OnOleDrop [VCL and LCL]

OLE drag&drop event. It occurs when the user completes drag&drop operation into the editor.This event allows you to insert data in your own format.

type

  TRVOleDropEvent = procedure (Sender: TCustomRichView;

    const DataObject: IDataObject; Shift: TShiftState; X, Y: Integer;

    PossibleDropEffects: TRVOleDropEffects;

    var DropEffect: TRVOleDropEffect; var DoDefault: Boolean) of object;

property OnOleDrop: TRVOleDropEvent;

(introduced in version 10)

This is a low level event. Do not use it if you are not familiar with OLE drag&drop

The first event in sequence is OnOleDragEnter, it occurs when the user moves the mouse pointer into the editor while dragging. After that, OnOleDragOver is called while the user moves the mouse inside the editor. Dragging is finished either by calling this event (successfully) or by calling OnOleDragLeave (canceled, or mouse left the editor).

Input Parameters:

DataObject dragged data (IDataObject is declared in ActiveX unit).

Shift keyboard state.

X,Y mouse cursor coordinates, relative to the top left corner of Sender.

PossibleDropEffects a list of allowed operations, set of rvdeCopy, rvdeMove, rvdeLink.

DropEffect operation that the editor would choose by default.

 

Output Parameters:

DropEffect the operation that you have performed (one of PossibleDropEffects, or rvdeNone if you canceled the insertion). If it is rvdeMove, it instructs to delete the dragged object from its source location. The value of this parameter is used only if you set DoDefault=False, otherwise the editor does the default processing. If you inserted some data in editor in this event, they are automatically selected afterwards.

Limitation: when dragging from the same editor, it decides by itself whether it should move or copy data, and it ignores DropEffect.

 

This event occurs between OnBeforeOleDrop and OnAfterOleDrop events.

 

See also events:

OnOleDragEnter;

OnOleDragOver;

OnOleDragLeave;

OnDropFiles.

See also:

Drag&drop in TRichView';

How to make one line, plain text editor.