mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 20:58:28 +02:00
TDateEdit: avoid OnChange being issued in Loaded. Fixes issue described in https://forum.lazarus.freepascal.org/index.php/topic,60538.msg453740.html#msg453740
This commit is contained in:
parent
78b42debff
commit
e7e585f13d
@ -1714,11 +1714,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDateEdit.Loaded;
|
procedure TDateEdit.Loaded;
|
||||||
|
var
|
||||||
|
SavedOnChange: TNotifyEvent;
|
||||||
begin
|
begin
|
||||||
inherited Loaded;
|
|
||||||
//Forces a valid Text in the control
|
//Forces a valid Text in the control
|
||||||
if not (csDesigning in ComponentState) then
|
if not (csDesigning in ComponentState) then
|
||||||
SetDate(FDate);
|
SetDate(FDate);
|
||||||
|
//avoid OnChange (regression introduced by #8ce29506c500e46d65b9a067bf446fd91224e6c0, happens when DirectInput=True and DefaultToday=True)
|
||||||
|
//the FEdit's OnChange is only forwarded once the whole component has been loaded, so call inherited after setting the text, not before
|
||||||
|
inherited Loaded;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDateEdit.DoDateRangeCheck(var ADate: TDateTime);
|
procedure TDateEdit.DoDateRangeCheck(var ADate: TDateTime);
|
||||||
|
Loading…
Reference in New Issue
Block a user