Platforms to show: All Mac Windows Linux Cross-Platform
/MacOSX/Gestures
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /MacOSX/Gestures
This example is the version from Mon, 4th Jan 2009.
Notes: Last modified: Mon, 4th Jan 2009
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /MacOSX/Gestures
This example is the version from Mon, 4th Jan 2009.
Notes: Last modified: Mon, 4th Jan 2009
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = &Beenden
Const kEditClear =
End Class
Class Window1
Inherits Window
// Properties
Dim v As Object2D
Dim e As MyEvents
// Event implementations
Sub Paint(g As Graphics)
draw g
End Sub
Sub Open()
if TargetMachO then
e=new MyEvents
e.Listen
init
else
MsgBox "This example requires Mac OS X 10.5.5"
quit
end if
End Sub
// Methods
Sub draw(g as Graphics)
g.ForeColor=&cFFFFFF
g.FillRect 0,0,g.Width,g.Height
g.DrawObject v,g.Width/2,g.Height/2
End Sub
Sub redraw()
draw Graphics
End Sub
Sub init()
dim r as new RectShape
r.Width=100
r.Height=100
v=r
End Sub
End Class
Class MyEvents
Inherits CarbonApplicationEventsMBS
// Event implementations
Function GestureRotate(GlobalMouseX as double, GlobalMouseY as double, WindowHandle as integer, WindowMouseX as double, WindowMouseY as double, WindowPartCode as integer, KeyModifiers as integer, RotationAmount as double) As boolean
const pi=3.14159265
window1.v.Rotation=window1.v.Rotation-RotationAmount/180.0*pi
window1.redraw
End Function
Function GestureSwipe(GlobalMouseX as double, GlobalMouseY as double, WindowHandle as integer, WindowMouseX as double, WindowMouseY as double, WindowPartCode as integer, KeyModifiers as integer, SwipeDirectionX as double, SwipeDirectionY as double) As boolean
window1.init
window1.redraw
End Function
Function GestureMagnify(GlobalMouseX as double, GlobalMouseY as double, WindowHandle as integer, WindowMouseX as double, WindowMouseY as double, WindowPartCode as integer, KeyModifiers as integer, MagnificationAmount as double) As boolean
window1.v.Scale=window1.v.Scale+MagnificationAmount
window1.redraw
End Function
Function GestureStarted(GlobalMouseX as double, GlobalMouseY as double, WindowHandle as integer, WindowMouseX as double, WindowMouseY as double, WindowPartCode as integer, KeyModifiers as integer) As boolean
window1.v.FillColor=&cFF0000
window1.redraw
End Function
Function GestureEnded(GlobalMouseX as double, GlobalMouseY as double, WindowHandle as integer, WindowMouseX as double, WindowMouseY as double, WindowPartCode as integer, KeyModifiers as integer) As boolean
window1.v.FillColor=&c000000
window1.redraw
End Function
End Class
Links
MBS Filemaker Plugins - Pfarrgemeinde St. Arnulf Nickenich