fixed default values of TSpinEdit

git-svn-id: trunk@4280 -
This commit is contained in:
mattias 2003-06-16 17:21:00 +00:00
parent fb9cba261c
commit b6209414ab
2 changed files with 29 additions and 5 deletions

View File

@ -27,6 +27,11 @@ begin
fValueNeedsUpdate:=false;
end;
function TSpinEdit.ValueIsStored: boolean;
begin
Result:=Value<>1;
end;
procedure TSpinEdit.SetMaxValue(const AValue: single);
begin
if FMaxValue=AValue then exit;
@ -34,6 +39,21 @@ begin
UpdateControl;
end;
function TSpinEdit.Climb_RateIsStored: boolean;
begin
Result:=fClimbRate<>1;
end;
function TSpinEdit.MaxValueIsStored: boolean;
begin
Result:=fMaxValue<>100;
end;
function TSpinEdit.MinValueIsStored: boolean;
begin
Result:=fMinValue<>1;
end;
{-----------------------------------------------------------------------------}

View File

@ -42,9 +42,13 @@ type
fValue : Single;
fClimbRate : Single;
fValueNeedsUpdate: boolean;
function Climb_RateIsStored: boolean;
function MaxValueIsStored: boolean;
function MinValueIsStored: boolean;
procedure SetMaxValue(const AValue: single);
procedure SetMinValue(const AValue: single);
Procedure UpdateControl;
function ValueIsStored: boolean;
protected
procedure SetDecimals(num : Integer);
Function GetValue : Single;
@ -56,16 +60,16 @@ type
destructor Destroy; override;
published
property Align;
property Decimal_Places: Integer read fDecimals write SetDecimals;
property Decimal_Places: Integer read fDecimals write SetDecimals default 2;
property Enabled;
property Climb_Rate : Single read fClimbRate write SetClimbRate;
property MinValue: single read FMinValue write SetMinValue;
property MaxValue: single read FMaxValue write SetMaxValue;
property Climb_Rate : Single read fClimbRate write SetClimbRate stored Climb_RateIsStored;
property MinValue: single read FMinValue write SetMinValue stored MinValueIsStored;
property MaxValue: single read FMaxValue write SetMaxValue stored MaxValueIsStored;
property OnEnter;
property OnExit;
property PopupMenu;
property ShowHint;
property Value: Single read GetValue write SetValue;
property Value: Single read GetValue write SetValue stored ValueIsStored;
property Visible;
end;