mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 05:19:37 +02:00
SpinEdit: support setting Text property
git-svn-id: trunk@53159 -
This commit is contained in:
parent
7adca22c01
commit
e9bfcc0273
@ -41,6 +41,16 @@ begin
|
|||||||
Result := ValueToStr(FValue);
|
Result := ValueToStr(FValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomFloatSpinEdit.RealSetText(const AValue: TCaption);
|
||||||
|
var
|
||||||
|
NewValue: Double;
|
||||||
|
begin
|
||||||
|
if TryStrToFloat(AValue, NewValue) then
|
||||||
|
Value := NewValue
|
||||||
|
else
|
||||||
|
inherited RealSetText(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomFloatSpinEdit.TextChanged;
|
procedure TCustomFloatSpinEdit.TextChanged;
|
||||||
var
|
var
|
||||||
PrevValue: Double;
|
PrevValue: Double;
|
||||||
|
@ -44,6 +44,7 @@ type
|
|||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
function RealGetText: TCaption; override;
|
function RealGetText: TCaption; override;
|
||||||
|
procedure RealSetText(const AValue: TCaption); override;
|
||||||
procedure TextChanged; override;
|
procedure TextChanged; override;
|
||||||
procedure SetDecimals(ADecimals: Integer); virtual;
|
procedure SetDecimals(ADecimals: Integer); virtual;
|
||||||
procedure SetValue(const AValue: Double); virtual;
|
procedure SetValue(const AValue: Double); virtual;
|
||||||
|
Loading…
Reference in New Issue
Block a user