Page, Line and Column of my text, how to get them?

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Page, Line and Column of my text, how to get them?

Post by alexandreq »

Hello,

I have a form where I have a statusbar with 3 panels.

1º) Page
2º) Line
3º) Column

How to get the information from my DBSRichViewEdit so that I can display them each one in the correct panel from my statusBar?

Thanls
Alex
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can find it in the ActionTest demo:

Code: Select all

{------------------------------ Status bar ------------------------------------}
// Displaying the index of the edited page (OnCurrentPageChange & OnPageCountChanged)
procedure TForm3.SRichViewEdit1CurrentPageChange(Sender: TObject);
begin
  stat1.Panels.Items[1].Text := Format(SRVA_GetS(srvam_PageMofN),
    [SRichViewEdit1.CurrentPage, SRichViewEdit1.PageCount]);
end;
// Displaying the index of the visible page
procedure TForm3.SRichViewEdit1PageScrolled(Sender: TObject);
begin
  stat1.Panels.Items[0].Text  := Format(SRVA_GetS(srvam_ViewPageX),
    [SRichViewEdit1.ScrolledPage]);
end;
// Displaying the current line and column
procedure TForm3.SRichViewEdit1CaretMove(Sender: TObject);
var Line, Column : Integer;
begin
  SRichViewEdit1.GetCurrentLineCol(Line, Column);
  stat1.Panels.Items[2].Text := Format(SRVA_GetS(srvam_LineX), [Line]);
  stat1.Panels.Items[3].Text := Format(SRVA_GetS(srvam_ColX), [Column]);
end;
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hello Sergey

Thanks for your help.

Have a nice moment over there :)
Post Reply