OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: copter on March 15, 2017, 12:48:32 PM

Title: Drag n drop on listview - OnMouseDown ?
Post by: copter on March 15, 2017, 12:48:32 PM

Since the OnMouseDown event  is triggered only if the mouse comes from outside the listview but not if the mouse comes from the listview, how can I catch a DragNDrop inside a listview ?
Title: Re: Drag n drop on listview - OnMouseDown ?
Post by: owenwengerd on March 15, 2017, 04:30:08 PM
You might check whether DragnDropFromControl (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Event/DragnDropFromControl.htm) also gets called when dragging from the same control.
Title: Re: Drag n drop on listview - OnMouseDown ?
Post by: copter on March 16, 2017, 03:01:43 PM
If  this event is triggered the droped image is deleted.
Dont understand why.
I give up.
Thanks anyway for your help.
Title: Re: Drag n drop on listview - OnMouseDown ?
Post by: Fred Tomke on March 18, 2017, 04:01:39 AM
Hi, copter I recommend you to search the forum for drag and drop and to have a look at the samples.
You'll find at least two different ways to use drag'ndrop functionality in OpenDCL.

Automatic way:
The behaviour you mentioned works as designed: the dragged item will be moved off the source control. The idea was to move the selected item from one to another or within a control.
Have a look at the opendcldemo command and check out the Drag&Drop sample.

I do never use this, because I always have a database in the background (access or sqlite or mysql) which has to update structures or object relationships. Thats why I alsways use the

Manual way:
I can activate some events to control the behaviour when start dragging, while dragging and when dropping. But because I can do this, I have to do this. This might cause some researches and test but you will recognize the necessity to do this.

Maybe I find the time today to rewrite a small sample.

Regards, Fred
Title: Re: Drag n drop on listview - OnMouseDown ?
Post by: copter on March 20, 2017, 10:25:54 AM
Thanks Fred
Yes it should be very helpful if you have any sample.