Page 1 of 1

Both Drag and Drop on Same Control

PostPosted: Wed Mar 18, 2015 3:55 pm
by krappold
I have DM 2.x with Delphi XE6.

I have pretty much figured out how to drag a filename from Delphi onto explorer and copy it. I have also figured out how to drag a filename from explorer onto a Delphi control and store it.

But I am trying to do both from the same control (a list of files stored) and the control mousedown event confuses wehter a drag or drop is occuring when I just do regular mousedowns.

Is there an example of having a DM source and Target both pointing to the same control?

Re: Both Drag and Drop on Same Control

PostPosted: Wed Mar 18, 2015 4:04 pm
by DropMaster
Make sure you use DragDetect() inside your OnMouseDown handler. That way you have to click AND drag inside the control to start a drag. The drag sensitivity is the sensitivity set by the user in the Windows control panel. If you want to make sure you don't drop a drag inside the same control, you can test by setting a flag.

You can find a demo of both of these concepts in the ...Demos\Delphi\RichEdits\RichEditTest2 project.

Hope this helps.

Re: Both Drag and Drop on Same Control

PostPosted: Wed Mar 18, 2015 7:07 pm
by krappold
Thanks, I am using DragDetect and still having the issue.

But I will check out your code.