View Issue Details

IDProjectCategoryView StatusLast Update
0032321LazarusLCLpublic2017-12-14 22:00
ReporterStephanie Assigned ToMichl  
Status resolvedResolutionno change required 
Product Version1.8RC3 
Summary0032321: TEdit / TDbEdit cursor position after overwrite text
DescriptionHello, with Lazarus 1.8.0.RC3 under Linux 64 bit there is a problem with TEdit and TDbEdit: when I put this code in the Enter Event:

    Edit1.SelStart := 0;
    Edit1.SelLength := Length (Edit1.Text);

in order to automatically select all the text when the user goes on the TEdit, if the user press a key, the letter is ok and replace the previous text, but the second letter pressed from the user is written before and not after the first letter.

The first letter inserted by the user remains always at the end of the TEdit / TDbEdit, if the user doesn't move manually the cursor.

The problem occours only with letters and not with numbers.

Sorry for my bad english.

Best regards,

TagsNo tags attached.
Fixed in Revision
WidgetsetGTK 2
Attached Files


related to 0023131 resolvedJuha Manninen [GTK2+Windows] Backspace on TEdit moves cursor one position to the right 
related to 0030596 resolvedJuha Manninen error in the keyboard backspace key on linux TEdit 
related to 0024371 resolvedJuha Manninen Wrong usage of SelStart and SelLength in OnChange event only the first time 
related to 0025978 assignedZeljan Rikalo Select text with mouse from right to left has problems under GTK2 



2017-09-21 20:21

developer (1,833 bytes)


2017-09-21 20:21

developer   ~0102964

This isn't a bug per se. The event OnEnter is not good. The control isn't ready for such changes. Just tested, it doesn't work with Win32, GTK2, Qt.

You can use a asynchron method call. I add a simple test app to show you, what you can do (tested with Win32, GTK2, Qt). You can there select a TEdit per mouse or key (key only: property AutoSelect = True should be enough).

Please close, if all is clear. Please reopen, if I miss the point of that bug report (than please add a minimal example).


2017-12-14 22:00

reporter   ~0104722

With version 1.8.0 of Lazarus it seems to work now correctly (the code in the OnEnter event hasn't however changed).

Best regards,


Issue History

Date Modified Username Field Change
2017-08-23 12:21 Stephanie New Issue
2017-08-25 10:13 Juha Manninen Relationship added related to 0023131
2017-08-25 10:15 Juha Manninen Relationship added related to 0030596
2017-08-25 10:18 Juha Manninen Relationship added related to 0024371
2017-08-25 10:33 Juha Manninen Relationship added related to 0025978
2017-09-21 20:21 Michl File Added:
2017-09-21 20:21 Michl LazTarget => -
2017-09-21 20:21 Michl Note Added: 0102964
2017-09-21 20:21 Michl Status new => resolved
2017-09-21 20:21 Michl Resolution open => no change required
2017-09-21 20:21 Michl Assigned To => Michl
2017-12-14 22:00 Stephanie Note Added: 0104722