Forum Discussion
YMinaev
Staff
14 years agoHi,
The function I posted should grab the target item and place the mouse pointer to the destination control with the left button down. Then, release the button. It actually doesn't produce any visual movement. However, it is strange that it doesn't drag anything, probably, the function doesn't suit here.
What happens if you try something like this?
Also, if you need to drag an item to another node in the same tree, you can modify this code to get coordinates of the destination item. You can do this in the same way - call ClickItem on it and convert window coordinates to screen with the WindowToScreen method. Does this above function change the mouse position (if it still doesn't help)?
BTW, is the destination point visible when dragging?
The function I posted should grab the target item and place the mouse pointer to the destination control with the left button down. Then, release the button. It actually doesn't produce any visual movement. However, it is strange that it doesn't drag anything, probably, the function doesn't suit here.
What happens if you try something like this?
function DragTreeItem(treeControl, itemName, deltaX, deltaX)
{
treeControl.ClickItem(itemName);
var destPoint = treeControl.WindowToScreen(Sys.Desktop.MouseX + deltaX, Sys.Desktop.MouseY + deltaX);
LLPlayer.MouseDown(MK_LBUTTON, Sys.Desktop.MouseX, Sys.Desktop.MouseY, 0);
LLPlayer.MouseMove(destPoint.x, destPoint.y, 200);
LLPlayer.MouseUp(MK_LBUTTON, destPoint.x, destPoint.y, 200);
}
Also, if you need to drag an item to another node in the same tree, you can modify this code to get coordinates of the destination item. You can do this in the same way - call ClickItem on it and convert window coordinates to screen with the WindowToScreen method. Does this above function change the mouse position (if it still doesn't help)?
BTW, is the destination point visible when dragging?