It's weird, but looks like wrap mode of the spinner is broken at least
since the move of elm to trunk.
The current code:
if (sd->wrap)
{
while (new_val < sd->val_min)
new_val = sd->val_max + new_val + 1 - sd->val_min;
while (new_val > sd->val_max)
new_val = sd->val_min + new_val - sd->val_max - 1;
}
doesn't seems correct. Since even the documented example would fails:
* E.g.:
* @li min value = 10
* @li max value = 50
* @li step value = 20
* @li displayed value = 20
*
* When the user decrement value (using left or bottom arrow), it will
* displays @c 40, because max - (min - (displayed - step)) is
* @c 50 - (@c 10 - (@c 20 - @c 20)) = @c 40.
With the current code the value will be 41.
It also could lead to values above min, like happens on the first spinner test,
when you could go to -50.5 because new value will become:
250 + (-50.5) + 1 - (-50) in the first while() and later since these value
is bigger then 250, would go back to -50.5 ...
So, a reasonable algorithm would be
if (sd->wrap)
{
if (new_val < sd->val_min)
new_val = sd->val_max + new_val - sd->val_min;
else if (new_val > sd->val_max)
new_val = sd->val_min + new_val - sd->val_max;
}
But it doesn't works fine for cases like the months spinners test, when you
have min = 1, max = 12, step = 1 and each option should be displayed with
wrap. This algorithm would wraps from 1 to 11, so would skip December...
So, I think just going to the max value when min is reached is the better
choice.
if (sd->wrap)
{
if (new_val < sd->val_min)
new_val = sd->val_max;
else if (new_val > sd->val_max)
new_val = sd->val_min;
}
SVN revision: 77278
The Makefile rule building that is commented out -- meant to be run
locally once in a while (when changes on overall widget tree happen)
and changed images commited.
SVN revision: 71721
auto-formatting scripts and i just spent a long time fixing the
results of one. the actual value of these macros is minimal at best
SVN revision: 66680