[Lazarus] Order of events: TEdit / TListBox
kapibara
kapibara.pas at aol.com
Tue May 23 15:27:00 CEST 2017
On 05/23/2017 09:18 AM, zeljko wrote:
> It's normal. If you click onto listbox (OnMouseDown of listbox
> triggers), TEdit looses focus and triggers OnExit()
>
Thanks for the reply.
Yes, on Windows, Lazarus and Delphi 7 behave the same. Except that
Delphi 7 doesn't have the ListBox.SelectionChange event:
Lazarus Win platform: Edit.Exit always fires before ListBox.OnClick (and
OnSelectionChange), no matter if the ListBox item is selected or not.
Good. Though I would not expect SelectionChange to fired since there is
no change in selection?
Problem is with Lazarus Linux GTK2. Events behave the *opposite* to
Windows Lazarus and Delphi 7:
1) SelectionChange does not fire when clicking an already selected item.
I might be wrong, but thats good I think and the windows implementation bad?
2) Edit.Exit fires BEFORE ListBox.OnClick if selecting and already
selected ListBox item. Good.
3) Edit.Exit fires AFTER ListBox.SelectionChange and ListBox.OnClick if
selecting a different ListBox item than the currently selected one. Bad.
So the behaviour is inconsistent between platforms, and also
inconsistent within the same control (TListBox) depending on what item
is selected.
More information about the Lazarus
mailing list