Page 1 of 1

Change Page number footer

Posted: Fri Dec 04, 2009 10:32 am
by haidomingo
Hi,
how to change the text of the page number?
In TRichViewEdit.
(example (1 ----> Page 1 of 3)
Thanks

Re: Change Page number footer

Posted: Fri Dec 04, 2009 3:56 pm
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;