You've already forked lazarus-ccr
Fixed: incorrect format display
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2852 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -132,7 +132,7 @@ end;
|
|||||||
|
|
||||||
function TJLabeledIntegerEdit.getCurrentValue: integer;
|
function TJLabeledIntegerEdit.getCurrentValue: integer;
|
||||||
begin
|
begin
|
||||||
Result:= StrToIntDef(Text, Value);
|
Result := StrToIntDef(Text, Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJLabeledIntegerEdit.setFormat(const AValue: string);
|
procedure TJLabeledIntegerEdit.setFormat(const AValue: string);
|
||||||
@ -157,7 +157,9 @@ end;
|
|||||||
|
|
||||||
procedure TJLabeledIntegerEdit.FormatInput;
|
procedure TJLabeledIntegerEdit.FormatInput;
|
||||||
begin
|
begin
|
||||||
if not fNull then
|
if fNull and (theValue = Low(integer)) then
|
||||||
|
Text := ''
|
||||||
|
else
|
||||||
Text := FormatFloat(fFormat, theValue);
|
Text := FormatFloat(fFormat, theValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -166,8 +168,8 @@ begin
|
|||||||
inherited DoEnter;
|
inherited DoEnter;
|
||||||
if ReadOnly then
|
if ReadOnly then
|
||||||
exit;
|
exit;
|
||||||
if not fNull then
|
if not fNull then
|
||||||
Text := IntToStr(theValue);
|
Text := IntToStr(theValue);
|
||||||
SelectAll;
|
SelectAll;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -177,7 +179,7 @@ begin
|
|||||||
if ReadOnly then
|
if ReadOnly then
|
||||||
exit;
|
exit;
|
||||||
if fNull and (Length(Caption) = 0) then
|
if fNull and (Length(Caption) = 0) then
|
||||||
theValue:= Low(Integer) // min integer value means null
|
theValue := Low(integer) // min integer value means null
|
||||||
else
|
else
|
||||||
if IsValidInteger(Text) then
|
if IsValidInteger(Text) then
|
||||||
theValue := StrToInt(Text)
|
theValue := StrToInt(Text)
|
||||||
@ -212,7 +214,7 @@ end;
|
|||||||
|
|
||||||
function TJLabeledIntegerEdit.isNull: boolean;
|
function TJLabeledIntegerEdit.isNull: boolean;
|
||||||
begin
|
begin
|
||||||
Result:= theValue = Low(Integer);
|
Result := theValue = Low(integer);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user