Originally posted by: Tim McGrath
From what Ive read here, the code enables drag and drop on a single tree view control. Could somebody post an example of how to drag from one tree view ctrl and drop on another?
Originally posted by: P�l Kristian T�nder
void CTreeCtrlX::OnMouseMove(UINT nFlags, CPoint point)
if (m_bLDragging)
Basically, the change is to redraw only if the HitTest
To avoid the flickering during the dragging, I suggest
the following code change in the OnMouseMove method
{
HTREEITEM hitem;
UINT flags;
{
POINT pt = point;
ClientToScreen( &pt );
CImageList::DragMove(pt);
hitem = HitTest(point, &flags);
if (hitem != m_hitemDrop)
{
CImageList::DragShowNolock(FALSE);
SelectDropTarget(hitem);
m_hitemDrop = hitem;
CImageList::DragShowNolock(TRUE);
}
}
CTreeCtrl::OnMouseMove(nFlags, point);
}
returns a different item than the current. Also, to allow
NULL hits, thereby clearing the selected drop item.
Originally posted by: Adam Freimark
I've encountered a problem ; You note in your source
that if the tree has no image list, you're SOL.
This appears to be the case, prompting this question:
I've got a tree with a TVSIL_STATE, but not TVSIL_NORMAL.
Can I drag-and-drop?
tnx
ReplyOriginally posted by: Pascal CABALLERO
Your code seem's to be fine (i did not use it yet) but I've a question :
why don't you use standard CView fonctions like OnDragEnter, OnDragOver, OnDragLeave... ?
thanks in advance for your answer.
best regards.
Originally posted by: Patric Sperling
I try to implement a tree with the following features: multi-select and drag'n'drop.
basically it works fine, but i seem not to be able to make the drag'n'drop work for multiple selected
files. when i begin dragging all but the last-clicked item are deselected.
i would be thankful for any suggestions,
patric sperling
Originally posted by: Paul Medlock
When the tree data exceeds the window's vertical extent, the
drag needs to "auto-scroll" the window when the mouse is motionless
over the bottom or top visible items. Otherwise, if you support
window scroll in just the MouseMove handler, your user will be
forced to jerk the mouse about nervously to send you the needed
events.
You can add auto-scroll, and allow your user to relax while
he/she waits, fairly easily by setting up a timer at the
beginning of the drag to let you periodically test for either
condition. Don't forget to shut the timer down at the end of the
drag, of course.
I can't provide example code for the auto-scroll function because
my code uses OWL, sorry.