Forum Discussion

meenakshiyadav1's avatar
meenakshiyadav1
Contributor
10 years ago

Not able to Drag object . Getting Error : There was an action performed at point(354,318) which is ot of window bound.


 



 



Need to Drag object (GrpLink) to  a destination Object (dragDropPanel) but I am  getting error that There was an action performed at point(354,318) which is ot of window bound.



Additional info in Log: The window size is (249, 29); screen rectangle: the left top corner is (230, 304), the right bottom corner is (479, 333). The screen coordinates of the point is (584, 622).



Please find my script below:



As per my script Xpos comes as= 354.5

YPos=318.5

dx=435

dy= - 16



Can any please let me know how to resolve this error.



 





PropArray3 = Array("ContentText","RowIndex","ObjectType")



 



 



ValuesArray3 = Array(GrpParam,"0","Cell")



set GrpClm=



 



Aliases.IeIms_BR.Dashboard_PG.IMSframe_FM.Progress_PN.RptDatatabstrip_PN.RptDatatabstrip1_PN.GridColumnHeader.Headertable_TB.FindChild(PropArray3, ValuesArray3,2)



PropArray4 = Array("ContentText","ObjectType")



ValuesArray4 = Array(GrpParam,"Link")



set GrpLink=GrpClm.FindChild(PropArray4, ValuesArray4,2)



XPos = GrpLink.ScreenLeft+GrpLink.Width/2



YPos = GrpLink.ScreenTop+GrpLink.Height/2



set DragdropPanel=



 



Aliases.IeIms_BR.Dashboard_PG.IMSframe_FM.Progress_PN.RptDatatabstrip_PN.RptDatatabstrip1_PN.Reportgrid_PN.DragDrop_PN





 



dX = DragdropPanel.ScreenLeft-GrpLink.ScreenLeft+DragdropPanel.Width/2



dY = DragdropPanel.ScreenTop-GrpLink.ScreenTop+DragdropPanel.Height/2



DragdropPanel.Click



GrpLink.Drag XPos,YPos,dX,dY,skNoShift


4 Replies

  • can any one please reply to this thread. or suggest an alternative way of dragging an object from one place to another.
  • Hi Tanya,



    Thanks for replying on this post. I have tried Int function and converted all four postions parameter in to an intiger. but it still the same.



    I have used:


    XPos=Int(XPos)




    similarly I did for Ypos,dX and dY. 



    But I am still getting the same error.
    • taisapi's avatar
      taisapi
      Occasional Contributor

      A bit late for meenakshiyadav1 , but for anyone else, like me, who found this script to be useful -  

       

      The problem is that the variable XPos, which is used later in the drag operation, should only reflect the centrepoint of the source object, and not include the value of the screen position.

       

      So,  instead of XPos = GrpLink.ScreenLeft+GrpLink.Width/2

       

      Try XPos = GrpLink.Width/2

       

      (Similarly for YPos)