Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002799 [JEDI VCL] 00 JVCL Components block always 2005-03-24 16:50 2005-03-26 03:38
Reporter anonymous View Status public  
Assigned To remkobonte
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA 2
Summary 0002799: TJvDBCalcEdit is cleaned on exit
Description When
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 Information My email:
janusz.kowal@interia.pl
Tags No tags attached.
Attached Files

- Relationships
has duplicate 0002797resolvedremkobonte TJvDBCalcEdit cleaning on exit 

-  Notes
(0006759)
remkobonte (developer)
2005-03-26 03:38

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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker