View Issue Details

IDProjectCategoryView StatusLast Update
0003936JEDI VCL00 JVCL Componentspublic2006-11-01 06:45
ReporterricoleboAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.30 
Summary0003936: JvSpinEdit don't work with displayFormat
DescriptionIn 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

TagsNo tags attached.

Activities

ricolebo

2006-10-02 04:25

reporter   ~0010273

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

Decimal = 2
DisplayFormat = #,##0.00 €
ValueType = vtFloat

obones

2006-10-06 03:52

administrator   ~0010311

Why is '0' better than '#' in this case?

ricolebo

2006-10-06 04:32

reporter   ~0010316

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

2006-10-09 03:34

 

testSpin.zip (3,931 bytes)

obones

2006-11-01 06:45

administrator   ~0010401

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-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