Difference between revisions of "RichMemo/Features"
(Created page with "Here're a number of features, that a considered and/or explained. ==Load/Save from File== There're no methods to load or save to file from TRichMemo. (There're methods howeve...") |
|||
Line 15: | Line 15: | ||
Please, note, if at some point Load/Save File methods are to be added to RichMemo, they must also be implemented via Widgetset interface. Since a native widget might implement load/save file more efficiently (i.e. Cocoa interface). | Please, note, if at some point Load/Save File methods are to be added to RichMemo, they must also be implemented via Widgetset interface. Since a native widget might implement load/save file more efficiently (i.e. Cocoa interface). | ||
+ | |||
+ | |||
+ | RichMemo.Lines is TStrings class, which has Load/Save file method. Using these methods you can load/save plain text (without formatting) | ||
== See Also== | == See Also== | ||
*[[RichMemo]] | *[[RichMemo]] |
Revision as of 20:42, 3 November 2016
Here're a number of features, that a considered and/or explained.
Load/Save from File
There're no methods to load or save to file from TRichMemo. (There're methods however to load or save to a TStream)
The reason why no file save/load is because accessing a file might require a certain rights. I.e. when file is written, it might be necessary to either create a file or overwrite an existing file. If file is read, it must/should be shared with certain condition.
In every program such rights and access restrictions should/could be different, depending on the task of the program.
Thus, the access file flags should either become a parameters of load/save method, or not even introduced to RichMemo at all. (Leaving a developer with an option, to create TFileStream by themselves with whatever access they find desirable).
There're utility functions introduced LoadRTFFile/SaveRTFFile, but they're not part of the TRichMemo base interface. Also, extending TRichMemo with a class helper, that introduced these method, is an option.
Please, note, if at some point Load/Save File methods are to be added to RichMemo, they must also be implemented via Widgetset interface. Since a native widget might implement load/save file more efficiently (i.e. Cocoa interface).
RichMemo.Lines is TStrings class, which has Load/Save file method. Using these methods you can load/save plain text (without formatting)