mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
LCL T(Float)SpinEdit: Single properties storing
git-svn-id: trunk@11398 -
This commit is contained in:
parent
77b45f8368
commit
efa8463c35
@ -33,11 +33,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomFloatSpinEdit.ValueIsStored: Boolean;
|
|
||||||
begin
|
|
||||||
Result := True; // fpc bug, default value is always 0
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCustomFloatSpinEdit.RealGetText: TCaption;
|
function TCustomFloatSpinEdit.RealGetText: TCaption;
|
||||||
begin
|
begin
|
||||||
if HandleAllocated then
|
if HandleAllocated then
|
||||||
@ -65,14 +60,10 @@ begin
|
|||||||
UpdateControl;
|
UpdateControl;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomFloatSpinEdit.MaxValueIsStored: Boolean;
|
function TCustomFloatSpinEdit.IsStored: boolean;
|
||||||
begin
|
begin
|
||||||
Result := True; // fpc bug, default value is always 0
|
// workaround for FPC bug
|
||||||
end;
|
Result := True;
|
||||||
|
|
||||||
function TCustomFloatSpinEdit.MinValueIsStored: Boolean;
|
|
||||||
begin
|
|
||||||
Result := True; // fpc bug, default value is always 0
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomFloatSpinEdit.SetMinValue(const AValue: Single);
|
procedure TCustomFloatSpinEdit.SetMinValue(const AValue: Single);
|
||||||
|
12
lcl/spin.pp
12
lcl/spin.pp
@ -45,13 +45,11 @@ type
|
|||||||
FValueEmpty: Boolean;
|
FValueEmpty: Boolean;
|
||||||
FUpdatePending: Boolean;
|
FUpdatePending: Boolean;
|
||||||
FValueChanged: Boolean;
|
FValueChanged: Boolean;
|
||||||
function MaxValueIsStored: Boolean;
|
|
||||||
function MinValueIsStored: Boolean;
|
|
||||||
procedure SetMaxValue(const AValue: Single);
|
procedure SetMaxValue(const AValue: Single);
|
||||||
procedure SetMinValue(const AValue: Single);
|
procedure SetMinValue(const AValue: Single);
|
||||||
procedure SetValueEmpty(const AValue: Boolean);
|
procedure SetValueEmpty(const AValue: Boolean);
|
||||||
procedure UpdateControl;
|
procedure UpdateControl;
|
||||||
function ValueIsStored: Boolean;
|
function IsStored: Boolean; // FPC bug workaround
|
||||||
protected
|
protected
|
||||||
function RealGetText: TCaption; override;
|
function RealGetText: TCaption; override;
|
||||||
procedure TextChanged; override;
|
procedure TextChanged; override;
|
||||||
@ -70,10 +68,10 @@ type
|
|||||||
function StrToValue(const S: String): Single;
|
function StrToValue(const S: String): Single;
|
||||||
public
|
public
|
||||||
property DecimalPlaces: Integer read FDecimals write SetDecimals default 2;
|
property DecimalPlaces: Integer read FDecimals write SetDecimals default 2;
|
||||||
property Increment: Single read FIncrement write SetIncrement default 1;
|
property Increment: Single read FIncrement write SetIncrement stored IsStored default 1;
|
||||||
property MinValue: Single read FMinValue write SetMinValue default 0;
|
property MinValue: Single read FMinValue write SetMinValue stored IsStored default 0;
|
||||||
property MaxValue: Single read FMaxValue write SetMaxValue default 100;
|
property MaxValue: Single read FMaxValue write SetMaxValue stored IsStored default 100;
|
||||||
property Value: Single read GetValue write SetValue default 0;
|
property Value: Single read GetValue write SetValue stored IsStored default 0;
|
||||||
property ValueEmpty: Boolean read FValueEmpty write SetValueEmpty default False;
|
property ValueEmpty: Boolean read FValueEmpty write SetValueEmpty default False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user