Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/RTF Windows
Function:
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/RTF Windows
This example is the version from Mon, 29th Jun 2014.
Project "RTF Windows.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() dim f as FolderItem = GetOpenFolderItem(FileTypes1.Rtf) if f<>Nil then dim b as BinaryStream = BinaryStream.Open(f) dim s as string = b.Read(b.Length) TextArea1.WinRTFDataMBS(false) = s end if Exception io as IOException MsgBox "IOException!"+EndOfLine+EndOfLine+str(io.errorNumber)+" "+io.message End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() dim f as FolderItem = GetSaveFolderItem(FileTypes1.Rtf, "test.rtf") if f<>Nil then dim s as string = TextArea1.WinRTFDataMBS(false) dim b as BinaryStream = BinaryStream.Create(f, true) b.Write s end if Exception io as IOException MsgBox "IOException!"+EndOfLine+EndOfLine+str(io.errorNumber)+" "+io.message End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() dim f as FolderItem = GetOpenFolderItem(FileTypes1.ImageXBmp+FileTypes1.Png+FileTypes1.Jpeg) if f<>Nil then dim p as Picture = Picture.Open(f) if p<>Nil then dim b as BinaryStream = BinaryStream.Open(f) dim d as string = b.Read(b.Length) TextArea1.WinInsertImageMBS(d, p.Width, p.Height) end if end if Exception io as IOException MsgBox "IOException!"+EndOfLine+EndOfLine+str(io.errorNumber)+" "+io.message End EventHandler
End Control
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
FileTypes1
Filetype application/rtf
Filetype image/jpeg
Filetype image/png
Filetype image/x-bmp
End FileTypes1
End Project

Feedback, Comments & Corrections

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




Links
MBS FileMaker Plugins