From 3ee6c350433945caddcf20ae1ef6cec1172cb9d8 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 4 Jan 2021 20:51:58 +0000 Subject: [PATCH] ExCtrls: Adapt CurrencyEdit to recent changes in Laz-trunk (r64334, t64335) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7957 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/exctrls/source/exeditctrls.pas | 26 +++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/components/exctrls/source/exeditctrls.pas b/components/exctrls/source/exeditctrls.pas index 7d592e878..bdc1a598a 100644 --- a/components/exctrls/source/exeditctrls.pas +++ b/components/exctrls/source/exeditctrls.pas @@ -47,7 +47,6 @@ type FDecimalSeparator: Char; FNegCurrencyFormat: TSpinEditNegCurrencyFormat; FThousandSeparator: Char; - function IsIncrementStored: Boolean; procedure SetCurrencyFormat(AValue: TSpinEditCurrencyFormat); procedure SetCurrencyString(AValue: String); procedure SetDecimals(AValue: TSpinEditCurrencyDecimals); @@ -56,6 +55,9 @@ type procedure SetThousandSeparator(AValue: Char); protected procedure EditKeyPress(var Key: char); override; + function IncrementStored: Boolean; override; + function MaxValuestored: Boolean; override; + function MinValuestored: Boolean; override; function SafeInc(AValue: Currency): Currency; override; function SafeDec(AValue: Currency): Currency; override; function TextIsNumber(const S: String; out ANumber: Currency): Boolean; override; @@ -68,7 +70,6 @@ type procedure ResetFormatSettings; function StrToValue(const S: String): Currency; override; public - property Increment stored IsIncrementStored; property CurrencyFormat: TSpinEditCurrencyFormat read FCurrencyFormat write SetCurrencyFormat; property CurrencyString: String @@ -323,6 +324,22 @@ begin if (Key = '-') and IsLimited and (MinValue >= 0) then Key := #0; end; +function TCustomCurrSpinEditEx.IncrementStored: Boolean; +begin + Result := FIncrement <> 1; +end; + +function TCustomCurrSpinEditEx.MaxValueStored: Boolean; +begin + Result := FMaxValue <> 0; +end; + +function TCustomCurrSpinEditEx.MinValueStored: Boolean; +begin + Result := FMinValue <> 0; +end; + + procedure TCustomCurrSpinEditEx.ResetFormatSettings; begin FDecimals := DefaultFormatSettings.CurrencyDecimals; @@ -333,11 +350,6 @@ begin FThousandSeparator := DefaultFormatSettings.ThousandSeparator; end; -function TCustomCurrSpinEditEx.IsIncrementStored: Boolean; -begin - Result := FIncrement <> 1; -end; - function TCustomCurrSpinEditEx.SafeInc(AValue: Currency): Currency; begin if (AValue > 0) and (AValue > MaxCurrency-FIncrement) then