mScrollRemainder was not getting initialised and so the first time TimeTextCtrl::OnMouse got called, 'steps' got set to a random number (very large and -ve here) and Adjust got called with -2147483648, -1. So we need to initialise mScrollRemainder.
This has been wrong for a while, from what I see. Previous version used Decrease and Increase which were immune to the problem.
'Adjust' decrements steps, whether it is positive or negative to start with. It is designed to have 'steps' strictly positive, so make sure of that.
Make sure OnMouse uses Adjust correctly.
Audacity tries to run clean/distclean on subdirectories speculatively
and ignores errors of the clean/distclean call in subdirectories.
clean/distclean should only be run for subdirectories if they contain
a Makefile.
bug #115.
But, since there's some definite preferences on which is correct, I've
left the change in, but added a simple way (SNAP_TO_NEAREST define in Snap.c)
to change it once a decision is made.
If set SNAP_TO_NEAREST back to true since that is the current (as of 2.0.5)
behavior.
Completes James' TimeConverter work
This completes the work that James started. It moves most of the non-GUI
related processing from TimeTextCtrl to James' TimeConverter class.
Other changes include:
1) TimeTextCtrl now expects the format name instead of the format string to be
passed when creating a new instance. I found that almost all cases created the
instance with a blank format string and then set the string after creation.
2) To simplify maintenance and prevent a possible discrepancy between the two,
Increase() and Decrease() were merged into a single routine.
As a result:
1) All cases where a TimeTextCtrl was being used to extract information and
not actually display a control have been changed to use TimeConverter instead.
2) All cases where TimeTextCtrl was being created with an empty format and
then immediately followed by something like this:
tt.SetFormatString(tt.GetBuiltinFormat(c->GetFormat()))
have been changed to pass the format name instead of the format string when
creating the TimeTextCtrl instance.
The are pretty darn slick. There's an integer one and a floating point
one. They support automatic range limiting (ex., you can't even type a
number outside of the range), proper number formats (ex., you can't
enter a decimal point in an integer field), you can't enter bogus
numbers like "0.3-.2", thousands separators are supported, decimal
precision may be specified and proper number formatting for string
values (or automatic conversion to int, double, float, etc.).