DIAdem Help

Object: DropEventContext

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

Object: DropEventContext

The DropEventContext object provides information on an area in DIAdem VIEW.

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

The following example only lets you drop data if you drag a channel or a group of channels from the Data Portal onto a 2D axis system in DIAdem VIEW. The drop method is not valid for any other display type. If dropping is permitted, the example outputs the name of the first selected channel.

VBScriptPython

 


Call AddUserCommandToEvent("View.Events.OnDropAllowed", "MyOnDropAllowed")
Call AddUserCommandToEvent("View.Events.OnDrop", "MyOnDrop")

Sub MyOnDropAllowed(Context, DropInformation, ByRef DropEffect)
  If Context.Area.DisplayObjType = "CurveChart2D" Then
    DropEffect = eDropEffectCopy
  Else
    DropEffect = eDropEffectNone
  End If
End Sub

Sub MyOnDrop(Context, DropInformation, ByRef DoProceed)
  Call MsgBoxDisp(DropInformation.DIAdemElements(1).Name)
  DoProceed = TRUE
End Sub

Properties

Area