new TrvActionNew

Properties   Events

Top  Previous  Next

TrvActionNew is the action for "File | New" command.

Unit RichViewActions;

Syntax

TrvActionNew = class(TrvAction)

Hierarchy

TObject

TPersistent

TComponent

TBasicAction

TContainedAction

TCustomAction

TAction

TrvCustomAction

TrvAction

Description

If you use this action, you must also use TrvActionSave and TrvActionSaveAs actions.

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:

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.

3.Applies the default values specified in the properties of TRVAControlPanel: DefaultColor, DefaultMargin.

4.Calls OnNew event.

5.Calls OnMarginsChanged event of TRVAControlPanel component.

6.Formats the document (calls TCustomRichViewEdit.Format).

7.If TRVAControlPanel.AutoDeleteUnusedStyles=True, deletes unused styles (calls TCustomRichViewEdit.DeleteUnusedStyles(True, True, True)).

8.Stores the following values for this TCustomRichViewEdit using the properties of TRVAControlPanel: 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.

9.Calls OnDocumentFileChange event of TrvActionSave action.


RichView © Sergey Tkachenko