mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 19:16:16 +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);
|
||||
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;
|
||||
var
|
||||
PrevValue: Double;
|
||||
|
@ -44,6 +44,7 @@ type
|
||||
protected
|
||||
class procedure WSRegisterClass; override;
|
||||
function RealGetText: TCaption; override;
|
||||
procedure RealSetText(const AValue: TCaption); override;
|
||||
procedure TextChanged; override;
|
||||
procedure SetDecimals(ADecimals: Integer); virtual;
|
||||
procedure SetValue(const AValue: Double); virtual;
|
||||
|
Loading…
Reference in New Issue
Block a user