From 0e725023a219cd47c40d43011141efb929108d36 Mon Sep 17 00:00:00 2001 From: wp Date: Wed, 6 Jan 2021 19:06:32 +0000 Subject: [PATCH] LazControls: Undo r64326 and r64334, obsolete after recent fixes in fpc (r48089 and r48088 #6c7790212c) git-svn-id: trunk@64344 - --- components/lazcontrols/spinex.inc | 36 +++---------------------------- components/lazcontrols/spinex.pp | 12 +++-------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/components/lazcontrols/spinex.inc b/components/lazcontrols/spinex.inc index 6751eb2560..4b14e6d06f 100644 --- a/components/lazcontrols/spinex.inc +++ b/components/lazcontrols/spinex.inc @@ -202,12 +202,12 @@ end; function TSpinEditExBase.MaxValueStored: Boolean; begin - Result := true; + Result := not SameValue(FMaxValue, DefMaxValue); end; function TSpinEditExBase.MinValueStored: Boolean; begin - Result := true; + Result := not SameValue(FMinValue, DefMinValue); end; procedure TSpinEditExBase.EditMouseWheelUp(Shift: TShiftState; @@ -257,7 +257,7 @@ end; function TSpinEditExBase.IncrementStored: Boolean; begin - Result := true; + Result := not SameValue(FIncrement, DefIncrement); end; function TSpinEditExBase.IsLimited: Boolean; @@ -478,21 +478,6 @@ begin inherited EditKeyPress(Key); end; -function TCustomFloatSpinEditEx.IncrementStored: Boolean; -begin - Result := not SameValue(FIncrement, DefIncrement); -end; - -function TCustomFloatSpinEditEx.MaxValueStored: Boolean; -begin - Result := not SameValue(FMaxValue, DefMaxValue); -end; - -function TCustomFloatSpinEditEx.MinValueStored: Boolean; -begin - Result := not SameValue(FMinValue, DefMinValue); -end; - function TCustomFloatSpinEditEx.TextIsNumber(const S: String; out ANumber: Double ): Boolean; begin @@ -634,21 +619,6 @@ begin Result := StringReplace(ValueS, AThousandSeparator, '', [rfReplaceAll]); end; -function TCustomSpinEditEx.IncrementStored: Boolean; -begin - Result := FIncrement <> DefIncrement; -end; - -function TCustomSpinEditEx.MaxValueStored: Boolean; -begin - Result := FMaxValue <> DefMaxValue; -end; - -function TCustomSpinEditEx.MinValueStored: Boolean; -begin - Result := FMinValue <> DefMinValue; -end; - procedure TCustomSpinEditEx.SetThousandSeparator(AValue: String); begin if FThousandSeparator = AValue then Exit; diff --git a/components/lazcontrols/spinex.pp b/components/lazcontrols/spinex.pp index 433c2c0875..6d4c2696cc 100644 --- a/components/lazcontrols/spinex.pp +++ b/components/lazcontrols/spinex.pp @@ -120,8 +120,11 @@ type function GetNullValue: T; function GetUpDown: TUpDown; function GetValue: T; + function IncrementStored: Boolean; function IsLimited: Boolean; function IsOutOfLimits(AValue: T): Boolean; + function MaxValueStored: Boolean; + function MinValueStored: Boolean; procedure UpdateControl; procedure UpDownChangingEx(Sender: TObject; var {%H-}AllowChange: Boolean; {%H-}NewValue: SmallInt; Direction: TUpDownDirection); @@ -135,9 +138,6 @@ type procedure EditKeyDown(var Key: word; Shift: TShiftState); override; procedure EditMouseWheelUp(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override; procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override; - function IncrementStored: Boolean; virtual; - function MaxValueStored: Boolean; virtual; - function MinValueStored: Boolean; virtual; function SafeInc(AValue: T): T; virtual; abstract; function SafeDec(AValue: T): T; virtual abstract; procedure SetValue(const AValue: T); virtual; @@ -204,9 +204,6 @@ type protected function GetFormatsettings: TFormatSettings; procedure EditKeyPress(var Key: char); override; - function IncrementStored: Boolean; override; - function MaxValuestored: Boolean; override; - function MinValuestored: Boolean; override; function TextIsNumber(const S: String; out ANumber: Double): Boolean; override; function SafeInc(AValue: Double): Double; override; function SafeDec(AValue: Double): Double; override; @@ -319,9 +316,6 @@ type FThousandSeparator: String; procedure SetThousandSeparator(AValue: String); protected - function IncrementStored: Boolean; override; - function MaxValuestored: Boolean; override; - function MinValuestored: Boolean; override; function SafeInc(AValue: Int64): Int64; override; function SafeDec(AValue: Int64): Int64; override; function TextIsNumber(const S: String; out ANumber: Int64): Boolean; override;