DateTimePicker - improved 54652

git-svn-id: trunk@54653 -
This commit is contained in:
zoran 2017-04-20 13:08:55 +00:00
parent 1ed8c064f8
commit c954ed4518

View File

@ -1922,13 +1922,19 @@ end;
procedure TCustomDateTimePicker.UndoChanges;
begin
FDateTime := FConfirmedDateTime;
Inc(FSkipChangeInUpdateDate);
try
if FDateTime = FConfirmedDateTime then begin
Inc(FSkipChangeInUpdateDate); // prevents calling Change in UpdateDate,
try // but UpdateDate should be called anyway, because user might have
// changed text on screen and it should be updated to what it was.
UpdateDate;
finally
Dec(FSkipChangeInUpdateDate);
end;
end else begin
FDateTime := FConfirmedDateTime;
UpdateDate;
finally
Dec(FSkipChangeInUpdateDate);
end;
end;
{ GetDateTimePartFromTextPart function