Platforms to show: All Mac Windows Linux Cross-Platform

/MacControls/Gestures/Canvas Gestures


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/Gestures/Canvas Gestures

This example is the version from Thu, 15th May 2019.

Project "Canvas Gestures.xojo_binary_project"
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 scrollWheel(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName End EventHandler
EventHandler Function smartMagnifyWithEvent(can as Canvas, e as NSEventMBS) As boolean log CurrentMethodName 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.InsertRow 0,s End Sub
End Module
End Project

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


The biggest plugin in space...