You've already forked lazarus-ccr
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user