Page 1 of 1

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

Posted: Thu Oct 23, 2014 7:16 pm
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

Posted: Fri Oct 24, 2014 10:18 am
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;

Posted: Fri Oct 24, 2014 12:25 pm
by alexandreq
Hello Sergey

Thanks for your help.

Have a nice moment over there :)