Forum Discussion
YMinaev
Staff
14 years agoHi,
How exactly do you call Drag and what coordinates do you pass to it? Also, do you drag within the same control, or do you drag to a different control?
Try using the function below. Does it work?
How exactly do you call Drag and what coordinates do you pass to it? Also, do you drag within the same control, or do you drag to a different control?
Try using the function below. Does it work?
function DragTreeItem(treeControl, itemName, destControl)
{
var destX = destControl.Width / 2;
var destY = destControl.Height / 2;
var destPoint = destControl.WindowToScreen(destX, destY);
treeControl.ClickItem(itemName); // You may need to insert your code which gets item bounds here instead of ClickItem
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);
}
...
var tree = ...//Obtain the tree view
var target = ...//Obtain the dragging action's target
DragTreeItem(tree, "|RootNode1|SubNode1|SubNode2", target);
...