... Remove mention of obsolete plans for TrackPanel refactor, superseded by a
different refactor now accomplished.
Remove detailed mention of names of functions and data members that implement
drawing.
Move most of Roger's comments about drawing into Overlay.h which is now the
more relevant place.
Commented more correctly what TrackPanelListener is.
... Also rewrote some of the existing event handling so all events from
TrackList are of the same, custom event class, and distinguishing addition
from resizing events, though this distinction is not yet used
... The crash happened in drawing code. The recently submitted but long
developed rewriting of track and channel iterations wasn't all reconciled
with the early 2.3.0 development relating to temporary track objects for
display purposes, which was for fixing the interactions of recording and undo.
... Use correct symbolic constants in three places (no effect);
use proper theme color for the two pixels per track that are left of and
above the shadow (small effect when not Classic theme)
... while the project makes note of which window has temporarily given up the
focus; and TrackPanel can detect that, so that the yellow border of the focused
track is still drawn while the panel "lends" the focus.
Why do all this? So that, when the ruler is another CellularPanel, ESC key
will work to abort drags in the ruler, but TrackPanel appearance won't change
during the drags.
... To be reused with the Ruler too.
The new base class does all the handling of hit tests on cells and managing
of UIHandles, and keyboard events and focus.
It has no knowledge of tracks -- that all resides in overriding functions in
TrackPanel.
Still to do, of course, is reorganizing drawing with callbacks to the cell
objects.
... a mono channel into the left side of a stereo track; crash was in drawing;
other code now prevents such recording, but that prevention might be revised
again.
... it's either the source of the connection that is being destroyed, or other
object (such as an ancestor window) transitively owning it and so causing it to
be destroyed too;
or, the sink is being destroyed, and that sink is a wxEvtHandler (which is
always so for Disconnect, though not for Unbind in case Bind was passed a
member function of a non-wxEvtHandler).
wxWidgets takes care of erasing the connection in such cases.
This removes most calls to Disconnect and Unbind. Many destructors shrank to
nothing.
Notably, in case of popup menu handling, the call to Disconnect is not removable
because the object being destroyed is neither the source nor the sink.
... Assuming that large unsigned magnitudes with high order bit set are not
the problem, but signed negatives of small magnitude may be:
1) Always cast the unsigned to signed in comparisons, not the other way.
Also:
2) Cast unsigned TERM to signed by itself, before subtracting. Don't cast
the result.
3) Rewrite some comparisons by moving subtracted term to other side.
See commits
d2fe7b1757d77d93d82d53685a118517a4d2e996
f463eda36c059236ecc168919c745eb687170c95