Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/ATS/ATS Glyph Curves
Function:
Required plugins for this example: MBS MacCF Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/ATS/ATS Glyph Curves
This example is the version from Sun, 17th Mar 2012.
Project "ATS Glyph Curves.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control EditField1 Inherits TextField
ControlInstance EditField1 Inherits TextField
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() List.DeleteAllRows dim style as new ATSUStyleMBS Style.Create dim events as new MyATSPathEventsMBS(list) dim n as integer = val(EditField1.text) dim error as integer = Style.GlyphGetCubicPaths(events, n) List.AddRow "GlyphGetCubicPaths Error: "+str(style.Lasterror) List.addrow "Error from Callback: "+str(error) End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() List.DeleteAllRows dim style as new ATSUStyleMBS Style.Create dim events as new MyATSPathEventsMBS(list) dim n as integer = val(EditField1.text) dim error as integer = Style.GlyphGetQuadraticPaths(events, n) List.AddRow "GlyphGetCubicPaths Error: "+str(style.Lasterror) List.addrow "Error from Callback: "+str(error) End EventHandler
End Control
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
Class MyATSPathEventsMBS Inherits ATSPathEventsMBS
EventHandler Function CubicClosePath() As integer l.AddRow CurrentMethodName End EventHandler
EventHandler Function CubicCurveTo(x1 as double, y1 as double, x2 as double, y2 as double, x3 as double, y3 as double) As integer l.AddRow CurrentMethodName+" "+str(x1)+"/"+str(y1)+" "+str(x2)+"/"+str(y2)+" "+str(x3)+"/"+str(y3) End EventHandler
EventHandler Function CubicLineTo(x as double, y as double) As integer l.AddRow CurrentMethodName+" "+str(x)+"/"+str(y) End EventHandler
EventHandler Function CubicMoveTo(x as double, y as double) As integer l.AddRow CurrentMethodName+" "+str(x)+"/"+str(y) End EventHandler
EventHandler Function QuadraticClosePath() As integer l.AddRow CurrentMethodName End EventHandler
EventHandler Function QuadraticCurve(x1 as double, y1 as double, CX as double, CY as double, x2 as double, y2 as double) As integer l.AddRow CurrentMethodName+" "+str(x1)+"/"+str(y1)+" "+str(cx)+"/"+str(cy)+" "+str(x2)+"/"+str(y2) End EventHandler
EventHandler Function QuadraticLine(x1 as double, y1 as double, x2 as double, y2 as double) As integer l.AddRow CurrentMethodName+" "+str(x1)+"/"+str(y1)+" "+str(x2)+"/"+str(y2) End EventHandler
EventHandler Function QuadraticNewPath() As integer l.AddRow CurrentMethodName End EventHandler
Sub Constructor(list as listbox) l = list End Sub
Property l As Listbox
End Class
End Project

See also:

Feedback, Comments & Corrections

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




Links
MBS FileMaker Plugins