Apply XMouseMotionHandler to the sheet
Posted: Sun Mar 17, 2013 7:11 pm
Good day.
I want to prohibit the use drag & drop tool on a sheet of Calc. I think “:: com :: sun :: star :: awt :: XMouseMotionHandler“ is suitable for this. But I don't know how to take advantage of. Help apply XMouseMotionHandler to the sheet . Fix my code.
Why don't I see the message "mouseDragged!" and "mouseMoved!" ?
I want to prohibit the use drag & drop tool on a sheet of Calc. I think “:: com :: sun :: star :: awt :: XMouseMotionHandler“ is suitable for this. But I don't know how to take advantage of. Help apply XMouseMotionHandler to the sheet . Fix my code.
Code: Select all
Global oDocView_m As Object
Global oMouseMotionHandler As Object
Sub RegisterMouseMotionHandler
oDocView_m = ThisComponent.CurrentController.Frame.ContainerWindow
oMouseMotionHandler = createUnoListener("MyApp_", "com.sun.star.awt.XMouseMotionHandler")
oDocView_m.addMouseMotionListener(oMouseMotionHandler)
msgbox "RegisterMouseMotionHandler!"
End Sub
Sub UnregisterMouseMotionHandler
on error resume next
oDocView_m.removeMouseMotionListener(oMouseMotionHandler)
on error goto 0
End Sub
Function MyApp_mouseDragged(oEvt) As Boolean
msgbox "mouseDragged!"
MyApp_mouseDragged = False
End Function
Function MyApp_mouseMoved(oEvt) As Boolean
msgbox "mouseMoved!"
MyApp_mouseMoved = False
End Function