Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/MethodDraw SVG Editor/MethodDraw


Required plugins for this example: MBS MacBase Plugin, MBS Mac64bit Plugin, MBS Main Plugin, MBS MacCocoa Plugin, MBS MacControls Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/MethodDraw SVG Editor/MethodDraw

This example is the version from Mon, 6th Nov 2022.

Project "MethodDraw.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
End Control
Control HTMLViewer1 Inherits HTMLViewer
ControlInstance HTMLViewer1 Inherits HTMLViewer
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
Control TextArea2 Inherits TextArea
ControlInstance TextArea2 Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() dim s as string = TextArea1.Text s = ReplaceAll(s, "'", "\'") s = ReplaceLineEndings(s, "") dim e as NSErrorMBS Dim w As WKWebViewMBS = HTMLViewer1.WKWebViewMBS Call w.EvaluateJavaScript("svgCanvas.setSvgString('"+s+"');", e) End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() dim e as NSErrorMBS Dim w As WKWebViewMBS = HTMLViewer1.WKWebViewMBS TextArea2.Text = w.EvaluateJavaScript("svgCanvas.getSvgString();",e) End EventHandler
End Control
EventHandler Sub Open() dim folder as FolderItem = FindFile("method-draw") dim file as FolderItem = folder.Child("index.html") HTMLViewer1.LoadPage(file) End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
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
End Project

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


The biggest plugin in space...