From e868afe133f43b1f2902151a5b97f4ae911cd04f Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sun, 3 Oct 2021 16:22:04 +0200 Subject: [PATCH] T(Float)SpinEditEx: set make sure Modified is correct in OnChange event as well. --- components/lazcontrols/spinex.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/components/lazcontrols/spinex.inc b/components/lazcontrols/spinex.inc index 419cff0ca5..1987a46800 100644 --- a/components/lazcontrols/spinex.inc +++ b/components/lazcontrols/spinex.inc @@ -139,6 +139,14 @@ begin {$ifdef debugspinex} debugln('TSpinEditExBase.EditChange'); {$endif} + if FMustSetModifiedToTrueInOnChange then + begin + Modified := True; + FMustSetModifiedToTrueInOnChange := False; + {$ifdef debugspinex} + debugln('FMustSetModifiedToTrue=True, Setting Modifed to True'); + {$endif} + end; inherited EditChange; end; @@ -304,7 +312,9 @@ begin NewValue := GetLimitedValue(SafeDec(OldValue)); end; end; + FMustSetModifiedToTrueInOnChange := True; SetValue(NewValue); + //RealSetText of the Edit will set it to False Modified := True; end; @@ -328,7 +338,7 @@ end; constructor TSpinEditExBase.Create(TheOwner: TComponent); begin inherited Create(TheOwner); - + FMustSetModifiedToTrueInOnChange := False; FArrowKeys := True; FIncrement := DefIncrement; FMaxValue := DefMaxValue;