TRVStyle.OnApplyStyleColor

<< Click to display table of contents >>

TRVStyle.OnApplyStyleColor

Occurs when RichView applies the color of the StyleNo-th style to Canvas.

property OnApplyStyleColor: TRVApplyStyleColorEvent;

VCL and LCL:

type

  TRVApplyStyleColorEvent =

    procedure (Sender: TRVStyle; ACanvas: TCanvas;

      StyleNo: Integer; DrawState: TRVTextDrawStates;

      ApplyTo: TRVColoredParts;

      Printing: Boolean; ColorMode: TRVColorMode;

      DarkMode: Boolean;

      var DoDefault: Boolean) of object;

(introduced in version 1.3, changed in version 23)

FireMonkey:

type

  TRVApplyStyleColorEvent =

    procedure (Sender: TRVStyle; ACanvas: TRVFMXCanvas;

      StyleNo: Integer; DrawState: TRVTextDrawStates;

      ApplyTo: TRVColoredParts;

      Printing: Boolean; ColorMode: TRVColorMode;

      DarkMode: Boolean;

      var DoDefault: Boolean) of object;

where

  TRVColoredPart = (rvcpBack, rvcpText);
  TRVColoredParts = set of TRVColoredPart;

In this event you can apply font color for the StyleNo-th text style to Canvas.

Nothing should be drawn inside this event.

Input parameters:

Sender – TRVStyle generating this event.

Canvas – canvas for applying background and text colors to.

DrawState – states of this text item, see TRVTextDrawStates.

ApplyTo identifies object which require coloring.

Printing – if True, colors are requested for printing; otherwise, for drawing on the screen.

ColorMode – color mode.

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. Can be -1 if drawing is not for an item (for example, for a paragraph mark)

Output parameters:

DoDefault – set to False to prevent the default colors applying procedure.

 

FireMonkey note: to apply text color, use Sender.GraphicInterface.SetTextColor(Canvas, Color) method.

 

See also:

OnApplyStyle;

OnDrawStyleText.

See also properties:

TextStyles.