TCustomRichView.OnControlAction

<< Click to display table of contents >>

TCustomRichView.OnControlAction

Occurs when some important operation is performed on control inserted in RichView

type

  TRVControlAction = 

    (rvcaAfterRVFLoad, rvcaDestroy,

     rvcaMoveToUndoList, rvcaMoveFromUndoList,

     rvcaDestroyInUndoList, rvcaBeforeRVFSave,

     rvcaAfterRVFSave);

 

  TRVControlActionEvent = 

    procedure (Sender: TCustomRichView; 

      ControlAction: TRVControlAction; 

      ItemNo: Integer;

      var ctrl: TControl) of object;

 

property OnControlAction: TRVControlActionEvent;

(Introduced in version 1.3, changed in v1.4 and v10)

Warning: this event can occur from RichView destructor (when clearing document before destruction). Be careful if you access other controls from this event: they may be already destroyed!

This event occurs when some changes were done (or are being done) on inserted control ctrl.

Position of this control in the document is defined by the "hidden" parameter Sender.Style.RVData (must be typecasted to TCustomRVData) and ItemNo parameter. ItemNo is an index of item (containing ctrl) in the document Sender.Style.RVData (it may be RVData of the main RichView (Sender), cell, or RVData of cell inplace editor).

ControlAction

Meaning

rvcaAfterRVFLoad

The control was created and loaded from RVF (file, stream, database field or Clipboard);

rvcaDestroy

The control will be destroyed soon (removing items from RichView, or destroying RichView itself)

rvcaMoveToUndoList

The control was moved to undo/redo buffer. It will not be displayed, but it will not be destroyed yet.

rvcaMoveFromUndoList

The control was moved from undo/redo list back to the editor.

rvcaDestroyInUndoList

The control will be destroyed together with undo/redo buffer (undo item); this control is already not in the editor; only ctrl parameter is valid in this case, ItemNo=-1;

rvcaBeforeRVFSave

Before saving to RVF

rvcaAfterRVFSave

After saving to RVF

Note: do not perform any changes on RichView when processing this event.

Note: TRVControlAction is defined in RVStyle unit.

See also:

OnItemAction.