From a4c65ef669b54ed30089fbb95e22afd8ad747ffb Mon Sep 17 00:00:00 2001 From: jujibo Date: Thu, 20 Sep 2012 14:52:22 +0000 Subject: [PATCH] Added: TJLabeledFloatEdit property CurrentValue git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2528 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jujiboutils/changes.txt | 2 +- components/jujiboutils/src/jlabeledfloatedit.pas | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/jujiboutils/changes.txt b/components/jujiboutils/changes.txt index 51697e073..3de15a8a9 100644 --- a/components/jujiboutils/changes.txt +++ b/components/jujiboutils/changes.txt @@ -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 diff --git a/components/jujiboutils/src/jlabeledfloatedit.pas b/components/jujiboutils/src/jlabeledfloatedit.pas index e0ea182fd..eb54c7606 100644 --- a/components/jujiboutils/src/jlabeledfloatedit.pas +++ b/components/jujiboutils/src/jlabeledfloatedit.pas @@ -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);