|
TCustomRichView.OnItemAction |
Top Previous Next |
|
Occurs on insertion, deletion and some other modifications of item type TRVItemAction = (rviaInserting, rviaInserted, rviaTextModifying, rviaDestroying, rviaMovingToUndoList)
TRVItemActionEvent = procedure (Sender: TCustomRichView; ItemAction: TRVItemAction; Item: TCustomRVItemInfo; var Text: String; RVData: TCustomRVData) of object;
property OnItemAction: TRVItemActionEvent; (introduced in version 1.7) Parameters Item – item for which this event is generated. Text – text associated with this item. If this is a text item, this text is displayed in RichView. RVData – document containing Item (it can be Sender.RVData, table cell, or RVData of cell inplace-editor). ItemAction identifies operation that calls this event.
Example (converting all non-Unicode text to upper case): procedure TForm1.RichViewEdit1ItemAction(Sender: TCustomRichView; ItemAction: TRVItemAction; Item: TCustomRVItemInfo; var Text: String; RVData: TCustomRVData); begin if (ItemAction in [rviaInserting, rviaTextModifying]) and (Item.StyleNo>=0) and not (rvioUnicode in Item.ItemOptions) then Text := AnsiUpperCase(Text); end;
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.
See also events: See also methods:
|