Added: TJLabeledFloatEdit property CurrentValue

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2528 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
jujibo
2012-09-20 14:52:22 +00:00
parent 79fddd5ecf
commit a4c65ef669
2 changed files with 8 additions and 1 deletions

View File

@ -5,7 +5,7 @@ Note: Lazarus Trunk required
Version pre-1.1
--------------------------------------------------
2012-09-20 Added: TJLabeledIntegerEdit property CurrentValue
2012-09-20 Added: TJLabeledIntegerEdit and TJLabeledFloatEdit property CurrentValue
2012-06-12 Fixed: TJDbGridTimeCtrl, store time value
2012-03-14 Fixed: Prevent double updates (QT widgetset) in edit widgets
2012-03-06 Fixed: Focus issues

View File

@ -38,6 +38,7 @@ type
function getDecimals: integer;
function getFormat: string;
function getValue: double;
function getCurrentValue: double;
procedure formatInput;
procedure setDecimals(const AValue: integer);
procedure setFormat(const AValue: string);
@ -53,6 +54,7 @@ type
{ Public declarations }
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
property CurrentValue: double read getCurrentValue;
published
{ Published declarations }
property DisplayFormat: string read getFormat write setFormat;
@ -135,6 +137,11 @@ begin
Result := theValue;
end;
function TJLabeledFloatEdit.getCurrentValue: double;
begin
Result:= StrToFloatDef(Text, Value);
end;
procedure TJLabeledFloatEdit.formatInput;
begin
Caption := FormatFloat(DisplayFormat, theValue);