TRVOleDropEffect rvdeCopy

General TRichView support forum. Please post your questions here
Post Reply
tothpaul
Posts: 42
Joined: Fri Feb 06, 2015 10:41 am

TRVOleDropEffect rvdeCopy

Post by tothpaul »

Hello,

I've tried to change de D&D behavior; in certain conditions I want the drop inside the same RV to be a copy/paste instead a cut/paste (like with the Ctrl key).

the "var" parameter DropEffect: TRVOleDropEffect of OleDrop event seems a good candidate but it doesn't change anything.

I've tried also to Undo the deletion and then paste the selection but the cursor position is lost, and I'm not sure it is a good option.

Regards
tothpaul
Posts: 42
Joined: Fri Feb 06, 2015 10:41 am

Post by tothpaul »

ok, in fact the problem is elsewhere...

when I drag&drop a selection with a Bullet inside, it is duplicated and inserted at a wrong place.

I've tried the last release with XE8, in the Emoticons demo, if you drag&drop a emoticons, it is lost ! :roll:
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

In this demo, emoticons are inserted as images from TImageList.
They are inserted from RVF format (which is used by default when dragging within TRichViewEdit), you need to process OnRVFImageListNeeded:

Code: Select all

procedure TForm1.rve1RVFImageListNeeded(Sender: TCustomRichView;
  ImageListTag: Integer; var il: TCustomImageList);
begin
  il := ImageList1;
end;
As for the original question - sorry, it is not possible in the current version of TRichView. Please read the help file:
- you can use this even to insert dropped data yourself, then assign DropEffect and DoDefault=False. Otherwise, value assigned to DropEffect is ignored
- value assigned to DropEffect is ignored when dragging within the editor.
Post Reply