Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/mouseDidMoveOverElement Test
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/mouseDidMoveOverElement Test
This example is the version from Sun, 17th Mar 2012.
Project "mouseDidMoveOverElement Test.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
EventHandler Sub Open() me.LoadURL "http://www.apple.com/" w = new MyWebUIDelegateMBS me.InstallWebUIDelegateMBS w End EventHandler
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Property w As MyWebUIDelegateMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class MyWebUIDelegateMBS Inherits WebUIDelegateMBS
EventHandler Function MouseDidMoveOverElement(elementInformation as Dictionary, modifierFlags as integer) As boolean dim l as listbox = Window1.List l.DeleteAllRows if elementInformation<>Nil then dim c as integer = elementInformation.Count -1 for i as integer = 0 to c dim key as Variant = elementInformation.Key(i) dim value as Variant = elementInformation.Value(key) l.addrow key.StringValue if value isa webFrameMBS then dim w as webFrameMBS = value l.cell(l.LastIndex,1)="Webframe: "+w.name elseif value isa DOMNodeMBS then dim n as DOMNodeMBS = value l.Cell(l.LastIndex,1)="WebElementDOMNode: "+n.localName elseif value isa NSImageMBS then dim im as NSImageMBS = value l.Cell(l.LastIndex,1)="Image: "+str(im.width)+" x "+str(im.height) else l.cell(l.LastIndex,1)=value end if // *** CHANGE WEBVIEW MOUSE CURSOR *** // if key = "WebElementLinkIsLive" then if value = true then Window1.MouseCursor = System.Cursors.FingerPointer else Window1.MouseCursor = System.Cursors.StandardPointer end if end if next end if End EventHandler
Property w As WebFrameMBS
End Class
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCocoa Plugin.

MBS Xojo PDF Plugins