Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/Carbon Events/Tablet Window


Required plugins for this example: MBS MacCF Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/Carbon Events/Tablet Window

This example is the version from Sun, 17th Mar 2012.

Project "Tablet Window.xojo_binary_project"
Class Window1 Inherits Window
Control GroupBox1 Inherits GroupBox
ControlInstance GroupBox1 Inherits GroupBox
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticTexts Inherits Label
ControlInstance StaticTexts(0) Inherits Label
ControlInstance StaticTexts(1) Inherits Label
ControlInstance StaticTexts(2) Inherits Label
ControlInstance StaticTexts(3) Inherits Label
ControlInstance StaticTexts(4) Inherits Label
ControlInstance StaticTexts(5) Inherits Label
ControlInstance StaticTexts(6) Inherits Label
ControlInstance StaticTexts(7) Inherits Label
ControlInstance StaticTexts(8) Inherits Label
ControlInstance StaticTexts(9) Inherits Label
ControlInstance StaticTexts(10) Inherits Label
ControlInstance StaticTexts(11) Inherits Label
ControlInstance StaticTexts(12) Inherits Label
ControlInstance StaticTexts(13) Inherits Label
End Control
Control LastUpdatePoint Inherits Label
ControlInstance LastUpdatePoint Inherits Label
End Control
Control absx Inherits Label
ControlInstance absx Inherits Label
End Control
Control absy Inherits Label
ControlInstance absy Inherits Label
End Control
Control absz Inherits Label
ControlInstance absz Inherits Label
End Control
Control Button Inherits Label
ControlInstance Button Inherits Label
End Control
Control Pressure Inherits Label
ControlInstance Pressure Inherits Label
End Control
Control tangentialPressure Inherits Label
ControlInstance tangentialPressure Inherits Label
End Control
Control tiltx Inherits Label
ControlInstance tiltx Inherits Label
End Control
Control tilty Inherits Label
ControlInstance tilty Inherits Label
End Control
Control rotation Inherits Label
ControlInstance rotation Inherits Label
End Control
Control GroupBox2 Inherits GroupBox
ControlInstance GroupBox2 Inherits GroupBox
End Control
Control LastUpdateProximity Inherits Label
ControlInstance LastUpdateProximity Inherits Label
End Control
Control enterProximity Inherits Label
ControlInstance enterProximity Inherits Label
End Control
Control vendorid Inherits Label
ControlInstance vendorid Inherits Label
End Control
Control tabletid Inherits Label
ControlInstance tabletid Inherits Label
End Control
Control pointerid Inherits Label
ControlInstance pointerid Inherits Label
End Control
EventHandler Sub Open() c=new myCarbonWindowEvents c.Tablet=true c.Listen self End EventHandler
Sub UpdatetabletProximity(p as carboneventstabletProximityMBS) dim d as date d=new date LastUpdateProximity.text=d.LongTime if p.enterProximity=0 then enterProximity.text="leaving" else enterProximity.text="entering" end if VendorID.text=str(p.VendorID) TabletID.text=str(p.TabletID) PointerID.text=str(p.PointerID) End Sub
Sub updateTabletPoint(p as carboneventstabletPointMBS) dim d as date d=new date LastUpdatePoint.text=d.LongTime absx.text=str(p.AbsX) absy.text=str(p.Absy) absz.text=str(p.Absz) Button.text=str(p.Buttons) Pressure.text=str(p.Pressure) rotation.text=str(p.Rotation) tiltx.text=str(p.Tiltx) tilty.text=str(p.Tilty) tangentialPressure.text=str(p.TangentialPressure) End Sub
Property Protected c As mycarbonWindowEvents
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class myCarbonWindowEvents Inherits CarbonWindowsEventsMBS
EventHandler Function MouseDown(x as single, y as single, modifierKeys as integer, button as integer, clickcount as integer, MouseChord as integer) As boolean if TabletPoint<>nil then Window1.updateTabletPoint TabletPoint end if if TabletProximity<>nil then Window1.UpdatetabletProximity TabletProximity end if End EventHandler
EventHandler Function MouseDragged(x as single, y as single, modifierKeys as integer, deltax as single, deltay as single, button as integer, clickcount as integer, MouseChord as integer) As boolean if TabletPoint<>nil then Window1.updateTabletPoint TabletPoint end if if TabletProximity<>nil then Window1.UpdatetabletProximity TabletProximity end if End EventHandler
EventHandler Function MouseMoved(x as single, y as single, modifierKeys as integer, deltax as single, deltay as single) As boolean if TabletPoint<>nil then Window1.updateTabletPoint TabletPoint end if if TabletProximity<>nil then Window1.UpdatetabletProximity TabletProximity end if End EventHandler
EventHandler Function MouseUp(x as single, y as single, modifierKeys as integer, button as integer, clickcount as integer, MouseChord as integer) As boolean if me.TabletPoint<>nil then Window1.updateTabletPoint TabletPoint end if if TabletProximity<>nil then Window1.UpdatetabletProximity TabletProximity end if End EventHandler
End Class
Class App Inherits Application
End Class
End Project

See also:

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


The biggest plugin in space...