diff --git a/lcl/include/spinedit.inc b/lcl/include/spinedit.inc index 3c620d22b7..a02d5cc18b 100644 --- a/lcl/include/spinedit.inc +++ b/lcl/include/spinedit.inc @@ -33,11 +33,6 @@ begin end; end; -function TCustomFloatSpinEdit.ValueIsStored: Boolean; -begin - Result := True; // fpc bug, default value is always 0 -end; - function TCustomFloatSpinEdit.RealGetText: TCaption; begin if HandleAllocated then @@ -65,14 +60,10 @@ begin UpdateControl; end; -function TCustomFloatSpinEdit.MaxValueIsStored: Boolean; +function TCustomFloatSpinEdit.IsStored: boolean; begin - Result := True; // fpc bug, default value is always 0 -end; - -function TCustomFloatSpinEdit.MinValueIsStored: Boolean; -begin - Result := True; // fpc bug, default value is always 0 + // workaround for FPC bug + Result := True; end; procedure TCustomFloatSpinEdit.SetMinValue(const AValue: Single); diff --git a/lcl/spin.pp b/lcl/spin.pp index 15409f2845..8e2904d502 100644 --- a/lcl/spin.pp +++ b/lcl/spin.pp @@ -45,13 +45,11 @@ type FValueEmpty: Boolean; FUpdatePending: Boolean; FValueChanged: Boolean; - function MaxValueIsStored: Boolean; - function MinValueIsStored: Boolean; procedure SetMaxValue(const AValue: Single); procedure SetMinValue(const AValue: Single); procedure SetValueEmpty(const AValue: Boolean); procedure UpdateControl; - function ValueIsStored: Boolean; + function IsStored: Boolean; // FPC bug workaround protected function RealGetText: TCaption; override; procedure TextChanged; override; @@ -70,10 +68,10 @@ type function StrToValue(const S: String): Single; public property DecimalPlaces: Integer read FDecimals write SetDecimals default 2; - property Increment: Single read FIncrement write SetIncrement default 1; - property MinValue: Single read FMinValue write SetMinValue default 0; - property MaxValue: Single read FMaxValue write SetMaxValue default 100; - property Value: Single read GetValue write SetValue default 0; + property Increment: Single read FIncrement write SetIncrement stored IsStored default 1; + property MinValue: Single read FMinValue write SetMinValue stored IsStored default 0; + property MaxValue: Single read FMaxValue write SetMaxValue stored IsStored default 100; + property Value: Single read GetValue write SetValue stored IsStored default 0; property ValueEmpty: Boolean read FValueEmpty write SetValueEmpty default False; end;