http://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252011-02-16T16:10:20ZRedmineWt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18692011-02-16T16:10:20ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey Christophe,</p>
<p>But what's the point of using a spinbox to input a number that is more precise than what is shown?<br><br>
Is that not entirely unintuitive to the user?</p>
<p>I would expect spinboxes to be used for integer numbers, of 'perfect fractions', like 1.0, 1.1, 1.2, etc... ?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18702011-02-16T17:56:41ZChristophe Delépinechristophe.delepine@thalesgroup.com
<ul></ul><p>You are right.</p>
<p>However i have 3 suggestions to improve the SpinBox :</p>
<p>1 - It would be better if the arrows were outside the line edit. It would avoid the numbers to hide them in some cases.</p>
<p>2 - Currently to enter spin mode, the user has to click between the 2 arrows (very small area). It would be much easier if the spin mode could be entered with a mouse click down on one of the arrows and vertical drag.</p>
<p>3 - the text formatting should avoid the display of remaining zeros after the last significant digit. For instance, if we want a precision of 3 digits after the decimal point, then 1.3 would be displayed as 1.3 and not 1.300. I can see in the code that you already tried to do this for integers.</p>
<p>Regards<br><br>
Christophe</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18722011-02-17T10:53:31ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey Christophe,</p>
<p>1) That would be better, but, that is not consistent with how the HTML5 native implementations do it (I just noticed that chrome does it, so we will add support for this). The fact that the numbers overlap the buttons can and will be solved with some right-padding</p>
<p>2) Good suggestion, we will add it.</p>
<p>3) In that case, the current behaviour of lexical_cast<a href="std::string" class="external">std::string</a>() is what you want, at least when current value is a 'perfect fraction' ? If a user himself enters 1.3002, then I do not see why you would want to correct the display of that to 1.300 ?</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18732011-02-17T11:37:14ZChristophe Delépinechristophe.delepine@thalesgroup.com
<ul></ul><p>Hi Koen,</p>
<p>1) and 2) do you plan to do this soon ? i ask because i would rather wait for the latest revision before adding the new wt version to our clearcase repository</p>
<p>3) if the spinbox is setup to only display 3 digits after the decimal point, then if a user enters 1.3002, the display must correct the input and show 1.3 (or 1.300). The user then realizes that only 3 digits are supported (Maya works like that). That is why lexical_cast cannot be used. Shouldn't setValue and value() be consistent ? If you call setValue(1.3002) then 1.3 or 1.300 will be displayed because of the text formatting option. But value() will return 1.3. It does not make sense.</p>
<p>Regards<br><br>
Christophe</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18742011-02-17T15:02:39ZKoen Deforchekoen@emweb.be
<ul></ul><p>Hey Christophe,</p>
<p>Since 1 and 2 are not connected to the complex format discussion, yes, we will implement that soon (say within a week).</p>
<p>I am still not confident we found a good solution to the formatting problem.</p>
<p>I can see the argument for correcting user input. Let me think about it. W.r.t. setValue() and value(): If you set an illegal value (1.3002 is not valid for the user, it should not be valid for the API either), then you should not expect the same value back? For valid values, the API should be consistent.</p>
<p>Regards,<br><br>
koen</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18762011-02-18T14:40:48ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>InProgress</i></li><li><strong>Assignee</strong> set to <i>Pieter Libin</i></li></ul> Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18882011-02-23T15:22:31ZKoen Deforchekoen@emweb.be
<ul><li><strong>Assignee</strong> changed from <i>Pieter Libin</i> to <i>Koen Deforche</i></li></ul> Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=18932011-02-25T10:14:09ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>InProgress</i> to <i>Resolved</i></li></ul><p>I've split the API into WSpinBox and WDoubleSpinBox, and the formatting options have changed. There is now setDecimals(), setSuffix() and setPrefix().</p>
Wt - Bug #727: WSpinBox should store a float value http://redmine.emweb.be/issues/727?journal_id=19672011-04-08T14:00:16ZKoen Deforchekoen@emweb.be
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Available in Wt 3.1.9</p>