Both Drag and Drop on Same Control

Support forum for our inter-application drag-n-drop components.

Both Drag and Drop on Same Control

Postby krappold » Wed Mar 18, 2015 3:55 pm

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?
krappold
 
Posts: 2
Joined:
Wed Mar 18, 2015 2:04 pm

Re: Both Drag and Drop on Same Control

Postby DropMaster » Wed Mar 18, 2015 4:04 pm

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.
_________________________
DropMaster Support
DropMaster
 
Posts: 23
Joined:
Fri Apr 15, 2011 6:32 am

Re: Both Drag and Drop on Same Control

Postby krappold » Wed Mar 18, 2015 7:07 pm

Thanks, I am using DragDetect and still having the issue.

But I will check out your code.
krappold
 
Posts: 2
Joined:
Wed Mar 18, 2015 2:04 pm


Return to DropMaster

Who is online

Users browsing this forum: No registered users and 1 guest