Recent

Author Topic: TMemo scroll to end (Linux)?  (Read 4477 times)

ezlage

  • Guest
Re: TMemo scroll to end (Linux)?
« Reply #15 on: February 01, 2021, 08:09:54 pm »
You are correct, lucamar! (In my case there was a command elsewhere trying to roll the bar).

I tested again and figured out that no matter what I do, It doesn't work. With "CaretPos:=Point(0, Lines.Count-1)" works at the begging, but after a few lines it stops rolling down again.

I'll leave it at that, because making things work in the smallest details on Linux is a lot of work and time.

Thank you all!
« Last Edit: February 01, 2021, 08:23:02 pm by ezlage »

ezlage

  • Guest
Re: TMemo scroll to end (Linux)?
« Reply #16 on: February 01, 2021, 08:16:59 pm »
WorWrap might interfere with caret positioning/lines visibility in some widgetsets but I don't know if adding an empty line just to solve this is worth it ... :-\

Adding a empty line at the end solves the positioning on visual line breaks, but isn't elegant if new content come to the field later.

ezlage

  • Guest
Re: TMemo scroll to end (Linux)?
« Reply #17 on: February 01, 2021, 08:19:30 pm »
Hi!


Old lousy trick:
Code: Pascal  [Select][+][-]
  1. Memo.selstart := MaxInt;

The Memo will recognize that MaxInt is too much and set it to the last possible position.

Winni

It seems to be working, Winni. Thank you! I will wait for make sure, because with another tricks the rolling stops after a few lines. The cause can be something at the text too, some line with a control char. I will take a look on this too.
« Last Edit: February 01, 2021, 08:21:07 pm by ezlage »

ezlage

  • Guest
Re: TMemo scroll to end (Linux)?
« Reply #18 on: February 01, 2021, 08:33:31 pm »
Hi!


Old lousy trick:
Code: Pascal  [Select][+][-]
  1. Memo.selstart := MaxInt;

The Memo will recognize that MaxInt is too much and set it to the last possible position.

Winni

It seems to be working, Winni. Thank you! I will wait for make sure, because with another tricks the rolling stops after a few lines. The cause can be something at the text too, some line with a control char. I will take a look on this too.

I could set the position rightly with CaretPos and SelStart, but using Debian or OpenSUSE, after a few lines the bar stops rolling even with a Timer repeating the CaretPos and the SelStart. It is weird! On Windows everything works fine!

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: TMemo scroll to end (Linux)?
« Reply #19 on: February 02, 2021, 01:45:40 am »
hello,
in my lazserial demo project (serial port gps receiver), i use this to scroll to the end of my tMemo :
Code: Pascal  [Select][+][-]
  1. Memo.SelStart := Length(Memo.Lines.Text)-1;
  2. Memo.SelLength:=0;
Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018