Altova XMLSpy 2025 Enterprise Edition

Event: OnDragOver (nXPos as Long, nYPos as Long, eMouseEvent as SPYMouseEvent, objRange as AuthenticRange, objData as AuthenticDataTransfer) as Boolean

 

Scripting environment - VBScript:

Function On_AuthenticDragOver(nXPos, nYPos, eMouseEvent, objRange, objData)

 ' On_AuthenticDragOver = False  ' to disable operation

End Function

 

Scripting environment - JScript:

function On_AuthenticDragOver(nXPos, nYPos, eMouseEvent, objRange, objData)

{

 // return false;  /* to disable operation */

}

 

IDE Plugin:

IXMLSpyPlugIn.OnEvent (10, ...)        // nEventId = 10

 

Description

This event gets triggered whenever an object from within or outside of Authentic View gets dragged with the mouse over the application window. All event related information gets passed as parameters.

 

The first three parameters specify the mouse position, the mouse button status and the status of the virtual keys at the time when the event occurred. The parameter objRange passes a range object that selects the XML element below the mouse position. The value of this parameter might be NULL. Be sure to check before you access the range object. The parameter objData allows to access information about the object being dragged.

 

Return False to cancel the drag operation. Return True (or nothing) to continue normal operation.

 

Examples

' ----------------------------------------------------------------------------

' VB code snippet - connecting to object level events

' ----------------------------------------------------------------------------

' access XMLSpy (without checking for any errors)

Dim objSpy As XMLSpyLib.Application

Set objSpy = GetObject("", "XMLSpy.Application")

 

' this is the event callback routine connected to the OnDragOver

' event of object objView

Private Function objView_OnDragOver(ByVal i_nXPos As Long, ByVal i_nYPos As Long,

                                   ByVal i_eMouseEvent As SPYMouseEvent,

                                   ByVal i_ipRange As IAuthenticRange,

                                   ByVal i_ipData As IAuthenticDataTransfer) As Boolean

 

   If (((i_eMouseEvent And spyShiftKeyDownMask) <> 0) And

              (Not i_ipRange Is Nothing)) Then

       MsgBox ("Floating over element " & i_ipRange.FirstXMLData.Parent.Name);

   End If

 

   Return True;

End Function

 

' use VBA keyword WithEvents to connect to object-level event

Dim WithEvents objView As XMLSpyLib.AuthenticView

Set objView = objSpy.ActiveDocument.AuthenticView

 

' continue here with something useful ...

' and serve the windows message loop

© 2018-2024 Altova GmbH