View Full Version : Implementing Drag&Drop in Treeview or Listview

02 February 2006, 11:05 PM
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

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

on tv MouseDown Button Shift x y do
format "X:%\tY:% HitTest:%\n" 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

CGTalk Moderation
02 February 2006, 11:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.