|
Top Previous Next |
|
TrvActionOpen is the action for "File | Open..." command. Unit RichViewActions; Syntax TrvActionOpen = class(TrvActionNew) Hierarchy TObject TPersistent TComponent TBasicAction TContainedAction TCustomAction TAction Description The action displays a file opening dialog and loads the chosen file in TCustomRichViewEdit component. After opening, this editor is associated with the chosen file name and format, so subsequent executions of TrvActionSave action save content of this TCustomRichViewEdit component in this file in this format. The following formats are supported: •RichView Format (RVF) •Rich Text Format (RTF) •Text files (TXT, Unicode and ANSI) •HTML (only if RvHtmlViewImporter is used) •RichViewXML Format (XML, only if RichViewXML is used) •custom formats, supported in TRVAControlPanel.OnCustomFileOperation event. 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.Shows a file opening dialog allowing the user to choose the file for opening. 3.If the user chose a file, calls LoadFile method. The file format is determined not by the file extension but by the filter index chosen in the file opening dialog. |