DIAdem Help

Object: DropPosition

  • Updated2024-09-12
  • 2 minute(s) read

Object: DropPosition

The DropPosition object provides information about the position onto which you dragged and dropped an object.

Note  To test the example script, you must first save the script and register the script as a user command in the dialog box that opens when you select Settings»Extensions»User Commands.

The example executes the user command MyOnDropPageEvent when dragging groups, channels, or properties onto a worksheet. The user command displays the names of the elements that you dragged onto an object. In addition the user command displays to which position you dragged the elements. The user command receives two parameters. The first parameter corresponds to a PageDropContext object and provides information about the worksheet onto which you dragged and dropped an object. The second parameter corresponds to a DropInformation object and provides information about the object which you dragged and dropped onto another object:

Call AddUserCommandToEvent("Report.Events.OnDropPage", "MyOnDropPageEvent")

Sub MyOnDropPageEvent(Context, DropContext)
  Dim oMyDropElement, sOutput, oMyComment
  sOutput = "Names of dropped elements:"
  For Each oMyDropElement in DropContext.DiademElements
    sOutput = sOutput & VBCrLf & oMyDropElement.Name
  Next
  Call Msgbox(sOutput)
  Call MsgBox(Context.Sheet.Name & VBCrLf & Context.Position.X & VBCrLf & Context.Position.Y)
  Context.DoProceed = TRUE
End Sub

Properties

X | Y

Returned From

PageDropContext.Position