|
TRVStyle.OnDrawTextBack |
Top Previous Next |
|
Occurs when drawing background of text of the StyleNo-th text style. property OnDrawTextBack: TRVDrawTextBackEvent;
type TRVDrawTextBackEvent = procedure (Sender: TRVStyle; Canvas: TCanvas; StyleNo: Integer; Left, Top, Width, Height: Integer; DrawState: TRVTextDrawStates; var DoDefault: Boolean) of object; (introduced in version 1.3) You can use this event to modify drawing of text background for some or all text styles. Unlike OnDrawStyleText, this event is called only once for each drawing item. OnDrawStyleText can be called several times if part of text item is selected. But in paragraphs having Alignment=rvaJustify, this event is called for background of each word separately. Input parameters: Sender – TRVStyle generating the event. Canvas – canvas to paint. StyleNo – index of text style in TextStyles collection. Left, Top, Width, Height – rectangle where to paint. DrawState may include rvtsControlFocused and rvtsHover, see , see TRVTextDrawStates. DoDefault is equal to True.
"Hidden" input parameters: Sender.RVData: TPersistent, document containing this paragraph. It should be typecasted to TCustomRVFormattedData before using. Sender.ItemNo: Integer, index of the item in Sender.RVData. These parameters allow to get additional information about the item being painted. For example: uses ..., CRVFData; ... var ItemTag: Integer; ... ItemTag := TCustomRVFormattedData(Sender.RVData).GetItemTag(Sender.ItemNo));
Output parameters: DoDefault – set to False to prevent default drawing. Currently the default drawing procedure does nothing.
See also events: See also properties: Demo projects:
|