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
0003936 [JEDI VCL] 00 JVCL Components minor always 2006-10-02 04:15 2006-11-01 06:45
Reporter ricolebo View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0003936: JvSpinEdit don't work with displayFormat
Description In the code of jvSpin.pas I saw that editFormat is changed when
displayFormat is used.

When the spinEdit is in edit mode the edit format become
'0.#' and display 0 and so it's impossible to input decimalSeparator.
in TJvCustomSpinEdit.DataChanged the correct editFormat is '0.0'

So if someboby could make this change : MakeStr('#', FDecimal) by MakeStr('0', FDecimal)

procedure TJvCustomSpinEdit.DataChanged;
var
  EditFormat: string;
  WasModified: Boolean;
begin
  if (ValueType = vtFloat) and FFocused and (FDisplayFormat <> '') then
  begin
    EditFormat := '0';
    if FDecimal > 0 then
      EditFormat := EditFormat + '.' + MakeStr('0', FDecimal); // Line t o change
    { Changing EditText sets Modified to false }
    WasModified := Modified;
    try
      Text := FormatFloat(EditFormat, Value);
    finally
      Modified := WasModified;
    end;
  end;
end;

Thank you
Eric

Additional Information
Tags No tags attached.
Attached Files zip file icon testSpin.zip [^] (3,931 bytes) 2006-10-09 03:34

- Relationships

-  Notes
(0010273)
ricolebo (reporter)
2006-10-02 04:25

To see the bug, set the the jvSpinEdit like this :

Decimal = 2
DisplayFormat = #,##0.00 €
ValueType = vtFloat
(0010311)
obones (administrator)
2006-10-06 03:52

Why is '0' better than '#' in this case?
(0010316)
ricolebo (reporter)
2006-10-06 04:32

Hi olivier,

'0' is better than '#' in this case, because the spinEdit use the displayFormat
as an editFormat (It's not logical, but it is like that !)

So when then displayFormat is 0.# the editFormat is 0 and then it's not possible to input float value.

Hope it can help you to understand the problem
(0010401)
obones (administrator)
2006-11-01 06:45

This is now fixed in SVN.

- Issue History
Date Modified Username Field Change
2006-10-02 04:15 ricolebo New Issue
2006-10-02 04:25 ricolebo Note Added: 0010273
2006-10-06 03:52 obones Note Added: 0010311
2006-10-06 03:52 obones Status new => feedback
2006-10-06 04:32 ricolebo Note Added: 0010316
2006-10-09 03:34 ricolebo File Added: testSpin.zip
2006-10-26 15:14 CarmeloViavattene Issue Monitored: CarmeloViavattene
2006-11-01 06:45 obones Status feedback => resolved
2006-11-01 06:45 obones Fixed in Version => Daily / SVN
2006-11-01 06:45 obones Resolution open => fixed
2006-11-01 06:45 obones Assigned To => obones
2006-11-01 06:45 obones Note Added: 0010401
2006-11-01 15:02 CarmeloViavattene Issue End Monitor: CarmeloViavattene


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