View Issue Details

IDProjectCategoryView StatusLast Update
0002799JEDI VCL00 JVCL Componentspublic2005-03-26 03:38
ReporteranonymousAssigned Toremkobonte 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.10 
Summary0002799: TJvDBCalcEdit is cleaned on exit
DescriptionWhen
FormatOnEditing=True
ZeroEmpty=True
DisplayFormat=',00'

value is cleaned on component exit for values greater than 999.99 (if before enter to component was empty)

Example:
123 - OK
999 - OK
1,233 - error

If before enter to component value was different than empty then every new value is accepted.

Situation come forward only if FormatOnEditing=True

To solve this error i modified JvBaseEdits.pas file as follows:

procedure TJvCustomNumEdit.ReformatEditText;
var
  S,S1: string;
  IsEmpty: Boolean;
  OldLen, SelStart, SelStop: Integer;
  WasModified: Boolean; //new line
begin
  FFormatting := True;
  WasModified := Modified; //new line
  try
    S := inherited Text;
    OldLen := Length(S);
    IsEmpty := (OldLen = 0) or (S = '-');
    if HandleAllocated then
      GetSel(SelStart, SelStop);
    if not IsEmpty then
      S := TextToValText(S);
    S := FormatFloatStr(S, Pos(',', DisplayFormat) > 0);
    inherited Text := S;
    if HandleAllocated and (GetFocus = Handle) and
      not (csDesigning in ComponentState) then
    begin
      Inc(SelStart, Length(S) - OldLen);
      SetCursor(SelStart);
    end;
  finally
    FFormatting := False;
    Modified := WasModified; //new line
  end;
end;

Additional InformationMy email:
janusz.kowal@interia.pl
TagsNo tags attached.

Relationships

has duplicate 0002797 resolvedremkobonte TJvDBCalcEdit cleaning on exit 

Activities

remkobonte

2005-03-26 03:38

developer   ~0006759

Thanks, fixed in CVS.

Issue History

Date Modified Username Field Change
2005-03-24 16:50 anonymous New Issue
2005-03-26 03:37 remkobonte Relationship added has duplicate 0002797
2005-03-26 03:38 remkobonte Status new => resolved
2005-03-26 03:38 remkobonte Resolution open => fixed
2005-03-26 03:38 remkobonte Assigned To => remkobonte
2005-03-26 03:38 remkobonte Note Added: 0006759