[Lazarus] How to fix slow screen refresh of TListbox?

Flávio Etrusco flavio.etrusco at gmail.com
Sun Nov 20 22:21:56 CET 2022


Em dom., 20 de nov. de 2022 04:23, Bo Berglund via lazarus <
lazarus at lists.lazarus-ide.org> escreveu:

> On Fri, 18 Nov 2022 18:40:57 -0300, Flávio Etrusco via lazarus
> <lazarus at lists.lazarus-ide.org> wrote:
>
> >Em dom., 13 de nov. de 2022 às 18:36, Luca Olivetti via lazarus <
> >lazarus at lists.lazarus-ide.org> escreveu:
> >
> >> El 12/11/22 a les 12:13, Bo Berglund via lazarus ha escrit:
> >> > On Sat, 12 Nov 2022 09:45:15 +0100, Luca Olivetti via lazarus
> >> > <lazarus at lists.lazarus-ide.org> wrote:
> >> >
> >> >> El 11/11/22 a les 23:37, Bo Berglund via lazarus ha escrit:
> >> >>
> >> >>> But how to jump to the end of the text on screen?
> >> >>>
> >> >>
> >> >> TheSynEdit.TopLine:=TheSynEdit.Lines.Count-TheSynEdit.LinesInWindow+1
> >> >>
> >> >
> >> > Did not work, but this does work:
> >>
> >> Strange, I've been using it for many years (and still use it) to ensure
> >> the last line is visible.
> >>
> >> (...)
> >> --
> >> Luca Olivetti
> >> Wetron Automation Technology http://www.wetron.es/
> >> Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
> >>
> >
> > It should work. Or even straight
> >"TheSynEdit.TopLine:=TheSynEdit.Lines.Count;'.
>
> My current version of my logging tool application uses this to display
> incoming
> data on the serial port (where it ends up in the TBytes buffer DataBuffer[]
> before displaying):
>
> ...
>   SetLength(DataTxt, Length(DataBuffer)); //Set string length
>   Move(DataBuffer[0], DataTxt[1], Length(DataBuffer)); //Copy data to
> string
>   {$ifdef USESYNEDIT}
>     synRxData.Lines.Beginupdate;
>     synRxData.Lines.Text := DataTxt;
>     synRxData.CaretY := synRxData.Lines.Count;
>     synRxData.Lines.Endupdate;
>     stxLineCount.Caption := IntToStr(synRxData.Lines.Count);
>   {$else}
> ...
>

I see. My point is that you don't need to copy the whole DataBuffer and
re-populate the whole SynEdit each time you receive new data. But this
probably won't matter much unless you have hundreds of thousands of lines
running on not so recent hardware.

Best regards,
Flávio

>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221120/d601448e/attachment.htm>


More information about the lazarus mailing list