TrvActionOpen.LoadFile |
Top Previous Next |
|
Loads the specified file in rve. procedure LoadFile(rve: TCustomRichViewEdit; const FileName: String; FileFormat: TrvFileOpenFilter; CustomFilterIndex: Integer=0); Parameters: rve – editor where to load file. FileName – name of the file to load. FileFormat – format of this file. CustomFilterIndex used only if FileFormat is ffiCustom. If FileFormat = ffiCustom, CustomFilterIndex identifies a custom file format. Custom formats are numbered from 1 in the order they are listed in the CustomFilter property. This procedure performs the following tasks: 1.Clears the document (calls TCustomRichViewEdit.Clear); clears the background image; if rvfoSaveDocProperties is included in TCustomRichViewEdit.RVFOptions, clears its DocProperties and resets DocParameters properties. 2.Applies the default values specified in the properties of TRVAControlPanel: DefaultColor, DefaultMargin. 3.Calls OnNew event. 4.Loads the file in rve. 5.Associates rve with this file and file format (in the list of documents maintained by TrvActionSave). 6.Calls OnDocumentFileChange event of TrvActionSave action. 7.Calls OnMarginsChanged event of TRVAControlPanel component. 8.Formats the document (calls TCustomRichViewEdit.Format). 9.If TRVAControlPanel.AutoDeleteUnusedStyles=True, deletes unused styles (calls TCustomRichViewEdit.DeleteUnusedStyles(True, True, True)). 10.Calls OnOpenFile event. Subsequent executions of TrvActionSave will save rve content in this file in this format. |