Tmemo scrolls to the left with no reason
Original Reporter info from Mantis: fedkad
-
Reporter name: Fedon Kadifeli
Original Reporter info from Mantis: fedkad
- Reporter name: Fedon Kadifeli
Description:
The Tmemo will scroll to the left so that the caret goes to the leftmost edge of the memo when the SelStart or SelText property is changed with code.
Steps to reproduce:
Create a Tmemo with the size of say 300 by 300 pixels. Enter two lines at design time into the memo; the first line with 10 characters and the second line with 100 characters.
Programmatically run the following code (for example by assigning to a Button's onClick event):
Memo1.SelStart := 4;
The memo will scroll to the left so that the caret (or the fifth character of the first line) goes to the leftmost edge of the memo.
The same thing happens when you put the caret somewhere in the first characters of the line and try to insert some text with code:
Memo1.SelText := 'XXXXX';
The expected behavior is for the Tmemo not to scroll unless the caret moves out of view. However, in this case TMemo scrolls as much as it can, so that the caret goes towards the leftmost edge of the Tmemo.
Additional information:
Details can be found in the forum post: https://forum.lazarus.freepascal.org/index.php?topic=51429
Mantis conversion info:
- Mantis ID: 37764
- OS: Ubuntu
- OS Build: 20.04
- Build: 2020-07-07 64-linux-qtk2
- Platform: Lazarus 2.0.10 x86 64-linux-qtk2
- Version: 2.0.10
- Monitored by: » fedkad (Fedon Kadifeli)