To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=76767





------- Additional comments from ms7...@openoffice.org Sun Apr  5 14:38:37 
+0000 2009 -------
The following OO Basic code (tested on XP SP3, OO 2.4) gives a hint how to 
implement the mouse motion listener in draw:

Global oSheetOutMML as Any
Global kRowSheetOutMML as Long
Global kLevelMML as Long

Sub Main
  oCompWin = ThisComponent.CurrentController.Frame.ComponentWindow
  oScrollPane = oCompWin.AccessibleContext.getAccessibleChild
(0).AccessibleContext.getAccessibleChild(0)

  oDoc   = StarDesktop.LoadComponentFromUrl
("private:factory/scalc","_default",0,Array())

  oSheetOutMML = oDoc.sheets.getByIndex(0)
  kRowSheetOutMML = 0
  kLevelMML = 0
  
  oMML = createUnoListener("MML_", "com.sun.star.awt.XMouseMotionListener")

  addremoveMouseMotionListenerRecursively(true, oMML, oScrollPane)
  wait(10000)
  addremoveMouseMotionListenerRecursively(false, oMML, oScrollPane)
End Sub


sub MML_mouseDragged(e as com.sun.star.awt.MouseEvent)
  if kLevelMML>0 then exit sub '
  kLevelMML = kLevelMML + 1
  logEvent("mouseDragged", e)
  kLevelMML = kLevelMML - 1
end sub 

sub MML_mouseMoved(e as com.sun.star.awt.MouseEvent)
end sub 

sub MML_disposing( Source as com.sun.star.lang.EventObject)
end sub 

sub logEvent(sText as String, e as com.sun.star.awt.MouseEvent)
  oSheetOutMML.getCellByPosition(0, kRowSheetOutMML).String = sText
  oSheetOutMML.getCellByPosition(1, kRowSheetOutMML).Value = e.X
  oSheetOutMML.getCellByPosition(2, kRowSheetOutMML).Value = e.Y
  oSheetOutMML.getCellByPosition(3, kRowSheetOutMML).Value = kLevelMML
  kRowSheetOutMML = kRowSheetOutMML + 1
end sub

sub addremoveMouseMotionListenerRecursively( bAdd as Boolean, 
oMouseMotionListener as Any, oWin as Any)
  if bAdd then
    oWin.addMouseMotionListener(oMouseMotionListener)
  else
    oWin.removeMouseMotionListener(oMouseMotionListener)
  endif

  if HasUnoInterfaces(oWin, "com.sun.star.awt.XVclContainer") then
    oWindows = oWin.Windows
    for k=0 to UBound(oWindows)
      call addremoveMouseMotionListenerRecursively( bAdd, oMouseMotionListener, 
oWindows(k))
    next k
  endif
end sub

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@graphics.openoffice.org
For additional commands, e-mail: issues-h...@graphics.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to