diff --git a/components/lazcontrols/spinex.inc b/components/lazcontrols/spinex.inc index 44722a483c..e10706c29e 100644 --- a/components/lazcontrols/spinex.inc +++ b/components/lazcontrols/spinex.inc @@ -237,13 +237,6 @@ begin SpinUpDown(False); end; -{ This is added as a virtual method because the 64-bit compiler on Windows cannot - determine which overloaded function to call when T is Currency. } -function TSpinEditExBase.SameValue(AValue1, AValue2: T): Boolean; -begin - Result := Math.SameValue(AValue1, AValue2); -end; - procedure TSpinEditExBase.SetValue(const AValue: T); var ValueFromText: T; @@ -531,6 +524,11 @@ begin Result := AValue - FIncrement; end; +function TCustomFloatSpinEditEx.SameValue(AValue1, AValue2: Double): Boolean; +begin + Result := Math.SameValue(AValue1, AValue2); +end; + procedure TCustomFloatSpinEditEx.SetDecimals(ADecimals: Integer); begin if (FDecimals = ADecimals) or (ADecimals < 0) then Exit; @@ -664,6 +662,11 @@ begin Result := AValue - FIncrement; end; +function TCustomSpinEditEx.SameValue(AValue1, AValue2: Int64): Boolean; +begin + Result := (AValue1 = AValue2); +end; + function TCustomSpinEditEx.TextIsNumber(const S: String; out ANumber: Int64 ): Boolean; var diff --git a/components/lazcontrols/spinex.pp b/components/lazcontrols/spinex.pp index 9ced99197f..9f4c753941 100644 --- a/components/lazcontrols/spinex.pp +++ b/components/lazcontrols/spinex.pp @@ -141,7 +141,7 @@ type procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override; function SafeInc(AValue: T): T; virtual; abstract; function SafeDec(AValue: T): T; virtual abstract; - function SameValue(AValue1, AValue2: T): boolean; virtual; + function SameValue(AValue1, AValue2: T): boolean; virtual; abstract; procedure SetValue(const AValue: T); virtual; procedure SetNullValue(AValue: T); virtual; procedure SetMaxValue(const AValue: T); virtual; @@ -209,6 +209,7 @@ type function TextIsNumber(const S: String; out ANumber: Double): Boolean; override; function SafeInc(AValue: Double): Double; override; function SafeDec(AValue: Double): Double; override; + function SameValue(AValue1, AValue2: Double): Boolean; override; procedure SetDecimals(ADecimals: Integer); virtual; public function ValueToStr(const AValue: Double): String; override; @@ -320,6 +321,7 @@ type protected function SafeInc(AValue: Int64): Int64; override; function SafeDec(AValue: Int64): Int64; override; + function SameValue(AValue1, AValue2: Int64): Boolean; override; function TextIsNumber(const S: String; out ANumber: Int64): Boolean; override; public function ValueToStr(const AValue: Int64): String; override;