Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/RTF/RTFData Benchmark
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/RTF/RTFData Benchmark
This example is the version from Sun, 23th Nov 2013.
Project "RTFData Benchmark.rbp"
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 TextArea2 Inherits TextArea
ControlInstance TextArea2 Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() TextArea2.Text = "" dim Start as Double = Microseconds for i as integer = 1 to 10 dim data as string = TextArea1.StyledText.RTFData TextArea2.StyledText.RTFData = data next dim Ende as Double = Microseconds label1.text = str((ende-start)/1000,"0.0")+" ms" End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() TextArea2.Text = "" dim Start as Double = Microseconds for i as integer = 1 to 10 dim data as string = TextArea1.StyledText.RTFDataMBS TextArea2.StyledText.RTFDataMBS = data next dim Ende as Double = Microseconds label2.text = str((ende-start)/1000,"0.0")+" ms" End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
EventHandler Sub Open() for i as integer = 1 to 10 AddStuff next End EventHandler
Sub AddStuff() TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextSize = 12 TextArea1.SelText = "Hello World"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelText = "Styles: " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelBold = true TextArea1.SelText = "bold" TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelBold = false TextArea1.SelText = ", " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelItalic = true TextArea1.SelText = "italic" TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelItalic = false TextArea1.SelText = ", " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelUnderline = true TextArea1.SelText = "italic" TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelUnderline = false TextArea1.SelText = EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelText = "Fonts: " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextFont = "Arial" TextArea1.SelText = "Arial, " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextFont = "Comic Sans MS" TextArea1.SelText = "Comic Sans MS, " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextFont = "Courier" TextArea1.SelText = "Courier" TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextFont = "" TextArea1.SelText = EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelAlignment = TextArea1.AlignLeft TextArea1.SelText = "Left Align"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelAlignment = TextArea1.AlignCenter TextArea1.SelText = "Center Align"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelAlignment = TextArea1.AlignRight TextArea1.SelText = "Right Align"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelAlignment = TextArea1.AlignDefault TextArea1.SelText = "Default Align"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextColor = &cFF0000 TextArea1.SelText = "Red " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextColor = &c00FF00 TextArea1.SelText = "Green " TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextColor = &c0000FF TextArea1.SelText = "Blue"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextColor = &c000000 TextArea1.SelTextSize = 9 TextArea1.SelText = "Size 9"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextSize = 12 TextArea1.SelText = "Size 12"+EndOfLine TextArea1.SelStart = TextArea1.Text.Len TextArea1.SelTextSize = 20 TextArea1.SelText = "Size 20"+EndOfLine TextArea1.SelTextSize = 12 End Sub
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

See also:

Feedback, Comments & Corrections

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




Links
MBS FileMaker tutorial videos