From e43cc06e923d4a5ba69850888ab0812bff41f2db Mon Sep 17 00:00:00 2001 From: jujibo Date: Wed, 27 Nov 2013 10:33:53 +0000 Subject: [PATCH] Fixed: incorrect format display git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2852 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jujiboutils/src/jlabeledintegeredit.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/jujiboutils/src/jlabeledintegeredit.pas b/components/jujiboutils/src/jlabeledintegeredit.pas index efb21cfd8..5de8c92ab 100644 --- a/components/jujiboutils/src/jlabeledintegeredit.pas +++ b/components/jujiboutils/src/jlabeledintegeredit.pas @@ -132,7 +132,7 @@ end; function TJLabeledIntegerEdit.getCurrentValue: integer; begin - Result:= StrToIntDef(Text, Value); + Result := StrToIntDef(Text, Value); end; procedure TJLabeledIntegerEdit.setFormat(const AValue: string); @@ -157,7 +157,9 @@ end; procedure TJLabeledIntegerEdit.FormatInput; begin - if not fNull then + if fNull and (theValue = Low(integer)) then + Text := '' + else Text := FormatFloat(fFormat, theValue); end; @@ -166,8 +168,8 @@ begin inherited DoEnter; if ReadOnly then exit; - if not fNull then - Text := IntToStr(theValue); + if not fNull then + Text := IntToStr(theValue); SelectAll; end; @@ -177,7 +179,7 @@ begin if ReadOnly then exit; if fNull and (Length(Caption) = 0) then - theValue:= Low(Integer) // min integer value means null + theValue := Low(integer) // min integer value means null else if IsValidInteger(Text) then theValue := StrToInt(Text) @@ -212,7 +214,7 @@ end; function TJLabeledIntegerEdit.isNull: boolean; begin - Result:= theValue = Low(Integer); + Result := theValue = Low(integer); end; end.