|Top Previous Next|
TrvActionNew is the action for "File | New" command.
TrvActionNew = class(TrvActionCustomNew)
This action must be linked to TrvActionSave action, because TrvActionSave contains a list of all documents opened in TCustomRichViewEdit controls. This link may be defined explicitly (via ActionSave property) or implicitly (this action finds and uses TrvActionSave action placed on the same form/datamodule).
This action performs the following tasks, if style templates are not used:
1.If the document was modified, asks for saving and saves it (using TrvActionSave).
2.Clears the document (calls TCustomRichViewEdit.Clear); clears the background image; if rvfoSaveDocProperties is included in TCustomRichViewEdit.RVFOptions, clears its DocProperties and resets DocParameters properties.
4.Calls OnNew event.
6.Formats the document (calls TCustomRichViewEdit.Format).
8.Stores the following values for this TCustomRichViewEdit using the properties of GetControlPanel: temporal file name = DefaultFileName, file format = DefaultFileFormat, custom filter index (used if file format is ffeCustom) = DefaultCustomFilterIndex. These values are stored in the list of documents maintained by TrvActionSave.
The sequence of operations is the same, but the step #7 is different. The action resets text and paragraph styles according to StyleTemplates.
RichViewActions © trichview.com