Change Page number footer

General TRichView support forum. Please post your questions here
Post Reply
haidomingo
Posts: 16
Joined: Tue Nov 10, 2009 7:27 pm

Change Page number footer

Post by haidomingo »

Hi,
how to change the text of the page number?
In TRichViewEdit.
(example (1 ----> Page 1 of 3)
Thanks
haidomingo
Posts: 16
Joined: Tue Nov 10, 2009 7:27 pm

Re: Change Page number footer

Post by haidomingo »

haidomingo wrote:Hi,
how to change the text of the page number?
In TRichViewEdit.
(example (1 ----> Page 1 of 3)
Thanks
AutoReply:

Code: Select all

procedure TScEditor.SEditorPaintPage(Sender: TObject; PageNo: Integer; PageRect,
  R: TRect; Canvas: TCanvas);
var
     H : Integer;
     Text: String;
begin
  Canvas.Brush.Style := bsSolid;
  Canvas.Brush.Color := SEditor.RichViewEdit.Style.Color;
  Canvas.Font.Assign(SEditor.RichViewEdit.Style.TextStyles[0]);
  // Drawing footer
  H := SEditor.BottomMargin100Pix;
  Text := IntToStr(PageNo)+ ' di '+IntToStr(SEditor.PageCount);
   Canvas.FillRect(
    Rect(PageRect.Left, PageRect.Bottom - H, PageRect.Right, PageRect.Bottom));
  Canvas.TextOut(
    (PageRect.Left + PageRect.Right - Canvas.TextWidth(Text)) div 2,
    PageRect.Bottom - H div 2, Text);
end;
Post Reply