T(Float)SpinEditEx: set make sure Modified is correct in OnChange event as well.

This commit is contained in:
Bart 2021-10-03 16:22:04 +02:00
parent abd3cd5c6b
commit e868afe133

View File

@ -139,6 +139,14 @@ begin
{$ifdef debugspinex} {$ifdef debugspinex}
debugln('TSpinEditExBase.EditChange'); debugln('TSpinEditExBase.EditChange');
{$endif} {$endif}
if FMustSetModifiedToTrueInOnChange then
begin
Modified := True;
FMustSetModifiedToTrueInOnChange := False;
{$ifdef debugspinex}
debugln('FMustSetModifiedToTrue=True, Setting Modifed to True');
{$endif}
end;
inherited EditChange; inherited EditChange;
end; end;
@ -304,7 +312,9 @@ begin
NewValue := GetLimitedValue(SafeDec(OldValue)); NewValue := GetLimitedValue(SafeDec(OldValue));
end; end;
end; end;
FMustSetModifiedToTrueInOnChange := True;
SetValue(NewValue); SetValue(NewValue);
//RealSetText of the Edit will set it to False
Modified := True; Modified := True;
end; end;
@ -328,7 +338,7 @@ end;
constructor TSpinEditExBase.Create(TheOwner: TComponent); constructor TSpinEditExBase.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
FMustSetModifiedToTrueInOnChange := False;
FArrowKeys := True; FArrowKeys := True;
FIncrement := DefIncrement; FIncrement := DefIncrement;
FMaxValue := DefMaxValue; FMaxValue := DefMaxValue;