Page 1 of 1

TRVOleDropEffect rvdeCopy

Posted: Fri Jun 05, 2015 3:56 pm
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

Posted: Mon Jul 06, 2015 2:41 pm
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:

Posted: Tue Jul 07, 2015 10:21 am
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.