Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacControls/Canvas Gestures
Function:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/Canvas Gestures
This example is the version from Sun, 28th Apr 2018.
Project "Canvas Gestures.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() // one global object to catch events CanvasGestures = new MyCanvasGesturesMBS End EventHandler
Property CanvasGestures As MyCanvasGesturesMBS
End Class
Class MainWindow Inherits Window
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
EventHandler Sub Open() app.CanvasGestures.AddCanvas canvas1 End EventHandler
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MyCanvasGesturesMBS Inherits CanvasGesturesMBS
EventHandler Function beginGestureWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName End EventHandler
EventHandler Function endGestureWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName End EventHandler
EventHandler Function magnifyWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName+" "+str(e.magnification) End EventHandler
EventHandler Function rotateWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName+" "+str(e.rotation) End EventHandler
EventHandler Function swipeWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName End EventHandler
End Class
Module Module1
Sub log(s as string) MainWindow.List.AddRow s End Sub
End Module
End Project

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins