Notifications
Clear all

[Closed] Implementing Drag&Drop in Treeview or Listview

Hi all

Starting with the
‘How To … Develop a Scene Browser using TreeView ActiveX Control – Part Two’ Maxscript example, I am trying to implement a drag&drop functionality to reparent objects in the scene.

Basically, drag&dropping DragItem onto DropItem would reparent DragItem to DropItem
DropItem would be the parent of DragItem, keeping the children of DragItem intact. ie.they shoul still be children of DragItem.

I can’t see any example of drag&drop anywhere, and What I dont understand is :
How to get the drag item and the drop item ???

Drag&Drop is enabled with:
tv.OLEDragMode = #ccOLEDragAutomatic
tv.OLEDropMode = #ccOLEDropManual

tried using the methods
on tv OLEStartDrag, on tv OLEDragDrop, on tv OLECompleteDrag
with no results…
because tv.selecteditem is not changed when drag&dropping
[size=2][/size]
[size=2][/size]
[size=2]
[/size]

also, tried using the HitTest as described in the Listview but again with no luck.

example:
on tv MouseDown Button Shift x y do
(
format “X:% Y:% HitTest:%
” x y (tv.HitTest x y)
)
-> x and y are read OK but ‘tv.HitTest x y’ always returns undefined … ???

So the real questions I have are:
How to make the hitTest return the correct item ?
How to get the drag item and the drop item in a Treeview ActiveX control ?

Any Help, example, hints would be great !!!
Thanks in advance