TEdit.OnChange is fired if text is not changed (after pressing delete or backspace) in Linux
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
If you press Delete or Backspace in a TEdit control then the OnChange event is fired wether or not the text is actually changed.
This happens in Linux, not in Win32.
Steps to reproduce:
Place a TEdit control on a form
Let it's OnChange event do something trivial
Build and run
In the empty TEdit press BackSpace or Delete
Expected behaviour
- nothing happens
Observed behaviour
- The OnChange event is fired
Additional information:
in:
procedure TControl.RealSetText(const Value: TCaption);
begin
if FCaption = Value then Exit;
//the above line should prevent this from happening as far as I can see
//but if it should, it clearly does not
FCaption := Value;
//TextChanged sets Modified to true and then calls Change,
//which then fires OnChange if it is assigned
TextChanged;
end;
As far as I can see non of the GetText / SetText methods for TEdit are overridden, so TEdit.SetText should call TControl.RealSetText.
There may well be a relation with bug #7243 (closed).
Mantis conversion info:
- Mantis ID: 8491
- OS: Suse Linux
- OS Build: 10.0
- Platform: i386
- Version: 0.9.20
- Target version: 1.0.0
- LazTarget: 1.0