TRVStyle.OnDrawPageBreak

<< Click to display table of contents >>

TRVStyle.OnDrawPageBreak

Occurs when drawing page breaks.

property OnDrawPageBreak: TRVDrawPageBreakEvent;

VCL and LCL:

type

  TRVPageBreakType = (rvpbSoftPageBreak, rvpbPageBreak);

 

  TRVDrawPageBreakEvent =

    procedure (Sender: TRVStyle;

      ACanvas: TCanvas;

      Y, XShift: TRVCoord;

      PageBreakType: TRVPageBreakType;

      Control: TControl;

      var DoDefault: Boolean) of object;

(introduced in version 1.3; modified in 1.7)

FireMonkey:

type

  TRVPageBreakType = (rvpbSoftPageBreak, rvpbPageBreak);

 

  TRVDrawPageBreakEvent =

    procedure (Sender: TRVStyle;

      ACanvas: TRVFMXCanvas;

      Y, XShift: TRVCoord;

      PageBreakType: TRVPageBreakType;

      Control: TControl;

      var DoDefault: Boolean) of object;

You can use this event to draw your own visual representation of page breaks.

This event occurs only if rvoShowPageBreaks is included in TCustomRichView(Control).Options.

Input parameters:

Sender TRVStyle generating the event.

Canvas – canvas to paint.

PageBreakType – type of page break (either soft (automatic) page break or explicit (user-defined) page break).

Y – y coordinate of page break in TRichView window.

XShift – how much TRichView is scrolled horizontally (>=0).

Control – TRichView control.

DoDefault is equal to True.

 

"Hidden" input parameters:

Sender.RVData: TPersistent, document where page break occurs. It should be typecasted to TCustomRVFormattedData before using.

Sender.ItemNo: Integer, index of the item in Sender.RVData.

These parameters define one of the following:

item starting a new page;

table with page breaks between rows.

 

Output parameter:

DoDefault – set to False to prevent default drawing. The default procedure draws horizontal line horizontal line with "dog-ear" effect. The line color is either PageBreakColor or SoftPageBreakColor, depending on PageBreakType.

 

Using Sender.RVData you can get additional information about the item:

For example:

uses ..., CRVFData;

...

var ParaNo: Integer;

begin

  ParaNo := TCustomRVFormattedData(Sender.RVData).GetItemPara(

    Sender.ItemNo));

  ...

end

 

See also properties:

PageBreakColor;

SoftPageBreakColor.

See also properties of TCustomRichView:

PageBreaksBeforeItem.

See also methods of TCustomRichView:

AssignSoftPageBreaks.

See also methods of TCustomRichViewEdit:

InsertPageBreak;

RemoveCurrentPageBreak.

See also properties of table:

PrintOptions.

See also properties of table row:

PageBreakBefore.

Demo project:

Demos\*\Assorted\Custom Draw\CustomDraw\