From 79fddd5ecf3f618843dba919a28e4b6ce72a7f71 Mon Sep 17 00:00:00 2001 From: jujibo Date: Thu, 20 Sep 2012 14:25:33 +0000 Subject: [PATCH] Added: TJLabeledIntegerEdit property CurrentValue git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2527 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jujiboutils/changes.txt | 1 + components/jujiboutils/src/jlabeledintegeredit.pas | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/components/jujiboutils/changes.txt b/components/jujiboutils/changes.txt index 5b790b0be..51697e073 100644 --- a/components/jujiboutils/changes.txt +++ b/components/jujiboutils/changes.txt @@ -5,6 +5,7 @@ Note: Lazarus Trunk required Version pre-1.1 -------------------------------------------------- +2012-09-20 Added: TJLabeledIntegerEdit 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/jlabeledintegeredit.pas b/components/jujiboutils/src/jlabeledintegeredit.pas index e5be5e3b6..821c925c7 100644 --- a/components/jujiboutils/src/jlabeledintegeredit.pas +++ b/components/jujiboutils/src/jlabeledintegeredit.pas @@ -36,6 +36,7 @@ type fFormat: string; function getFormat: string; function getValue: integer; + function getCurrentValue: integer; procedure setFormat(const AValue: string); procedure setValue(const AValue: integer); function IsValidInteger(const Value: string): boolean; @@ -49,6 +50,7 @@ type { Public declarations } constructor Create(TheOwner: TComponent); override; destructor Destroy; override; + property CurrentValue: integer read getCurrentValue; published { Published declarations } property DisplayFormat: string read getFormat write setFormat; @@ -125,6 +127,11 @@ begin Result := theValue; end; +function TJLabeledIntegerEdit.getCurrentValue: integer; +begin + Result:= StrToIntDef(Text, Value); +end; + procedure TJLabeledIntegerEdit.setFormat(const AValue: string); begin fFormat := AValue;