TSRichViewEdit.OnGetPagePos

<< Click to display table of contents >>

TSRichViewEdit.OnGetPagePos

Allows to define page position, size and Z-order. Occurs if ViewProperty.FreePosPage = True.

type

  TSRVGetPagePosEvent = procedure(Sender: TSRichViewEdit;

    PageNo : Integer;

    StartItemNo, EndItemNo, OffsetInStartItem,

    StartTableRow, EndTableRow: Integer;

    var Position : TPoint; var ZoomPercent : Single;

    var ZOrder : Integer) of object;

 

property OnGetPagePos: TSRVGetPagePosEvent;

PageNo – page index (from 1).

StartItemNo – index of the first item on the page.

EndItemNo – index of the last item on the page.

OffsetInStartItem – offset in the first item (for non-text items: 0; for text items: index of the first character on this page, from 1).

StartTableRow – index of the first table row on the page, if the table is the first item on the page; -1 otherwise.

EndTableRow – index of the last table row on the page, if the table is the last item on the page; -1 otherwise.

Position – page position, coordinates of the top left page corner. By default, it is calculated by adding offset to the previous page. The coordinates are relative to the top left corner of a scrollable area in TSRichViewEdit's window.

ZoomPercent – page zooming. By default, it is equal to zoom percent for the previous page. For the first page, it is equal to ViewProperty.ZoomPercent.

ZOrder – the page's Z-order. By default it is the same as for the previous page. For the first page, it is 0. Pages having the same Z-order value are drawn in the order of their numeration. Pages with larger Z-order value are drawn above the pages with smaller Z-order values. If PageProperty.UsePageOrders = False, this parameter is ignored.

 

See also:

CalculatePagePosition

CalculateAllPagePositions

 

Example:

// Arranging pages in 4 columns, 10 pixels between rows,

// 30 pixels between columns

procedure TFColumns.SRichViewEdit1GetPagePos(Sender: TSRichViewEdit;

  PageNo : Integer; StartItemNo, EndItemNo, OffsetInStartItem,

  StartTableRow, EndTableRow: Integer;

  var Position : TPoint; var ZoomPercent : Single;

  var ZOrder : Integer);

begin

  Position.X := 10 + ((PageNo - 1mod 4) * (Sender.PageWidthPix + 30);

  Position.Y := 10 + ((PageNo - 1div 4) * (Sender.PageHeightPix + 10);

end;