|Top Previous Next|
TrvActionEditNote allows editing a footnote, an endnote, a sidenote, or a text box in a non-modal dialog window.
TrvActionInsertNote = class(TrvCustomEditorAction)
ScaleRichView note: it's not recommended to use this action for TSRichViewEdit. Use TsrvActionEditNote instead.
It's recommended to assign Control property for this action; otherwise, this property is assigned automatically when the action is executed for the first time.
When executed, the action shows a non-modal dialog window containing TRichViewEdit for editing subdocuments of items of the following types:
•text box item.
If there is no item of these types in the caret position of the target editor, the action can move the caret to the next such item, if JumpToNextNote=True. If there are no such items, a note editor is shown disabled.
If a note editor window is already visible when this action is executed, the action activates its window.
After the execution, the window is still open and the action reacts on the caret movement in the target editor (more exactly, in Control): the window always shows a document for the current note. The user can edit the note document. It is saved to the note (as an undoable operation) automatically in the following cases:
•a caret movement in Control;
•saving Control to a file or a stream;
•printing or displaying a print preview of Control;
•showing or hiding the note editor window;
•assigning a different value to Control.
If you do not want to save recent changes, undo them in the note editor (there is no "Cancel Changes" command).
Editing in the note editor
By default, a note editor is shown in a floating window, without any additional controls in this window. If you attempt to use toolbar buttons located on another form, you will see the problem: clicking the button activates another form, and the command will be executed for an editor in this form.
So you have two main options to implement UI for a note editor:
•use OnFormCreate event to insert additional control in the note editor window (such as menu or toolbar)
•insert the note window in the main form, and switch RVAControlPanel.DefaultControl when the note editor acquires and releases the input focus (see the example in the topic about OnShowing and OnHide)
The latter is implemented in the ActionTest demos.
RichViewActions © trichview.com