Peculiar event-trigger
MacOs.10.9.5 (not so recent I know, but hesitating to update, with the GDB installation-problems I had years ago in mind).
The FPC/Lazarus stable version-updates from last years went without hick-up so I reckoned this latest would be no problem.
Lazarus started indeed without a problem, compilation of a simple test-program went well.
But then while testing this program I discovered a strange thing I never had before.
Simply put a Button1, an Edit1 and a Listbox1 on Form1.
Insert by 2-click on the Button1 following code (nothing else):
var Year: integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
Year:=StrToInt(edit1.Text);
Listbox1.Items.add('Button1Click : Year is '+IntTostr(Year));
end;
Compilation OK, but the strange thing is when I complete with a keyboard « enter », an entry in the Edit1, like ‘1999’, the Button1Click seems to be triggered, as messaged in the Listbox.
I would expect – as it did in previous Lazarus-versions if I remember well – that the « enter » would only trigger Edit1.OnEditingDone.
If I insert the Edit1.EditingDone event :
procedure TForm1.Edit1EditingDone(Sender: TObject);
begin
Listbox1.Items.add('Edit1EditingDone : Year is '+IntTostr(Year));
end;
this event is triggered first followed by the button1.click event.
Could one confirm this ?
I reinstalled FPC/Lazarus twice ; started with new/ project/application.
What could be messing this up ?