Call HitTest in just one place
Can now preserve repeatedly hit UIHandle objects during pre-click motion
Fields of HitTestResult besides the handle pointer are now unused
The need to repaint a track during mouse movement can be indicated when
constructing a UIHandle or when updating it for move; HitPreview no longer
does this
And the last allows simplifications of LabelTrack glyph highlighting
Also move the temporary state for label glyph dragging out of LabelTrack
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.
It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change. No matter now.
... Time warping functions should be nondecreasing, but let's not assume so.
If not, the insertion sort just takes linear time to check that there are no
disorders.
Added a setting for whether labels can be created by typing in a label track.
The setting can be changed in either the Tracks menu, or the Tracks category in Preferences.
By default the setting is set to on.
The two commands are "selection to next label" and "selection to previous label".
They have default shortcuts alt+right and alt+left.
A label track does not have to be the focus. If there is a single label track in the project, that it used. If there is more than one label track, then the first label track, if any, starting at the focused track is used.
If the commands are used during playback of the project, playback continues from the new cursor/selection.
The commands provide feedback to screen readers: the name of the label, and position in the form of "i of n".
... And label track selection code is simpler to understand, without delayed
side effects happening during drawing.
Left and right arrow keys collapse text range selection correctly
Shift-click adjusts the end of selection nearest the pick
Right (and middle) click and drag do not affect the selection
Copying empty selection has no effect on the clipboard
Left-drag behaves independently of previous selection state
... but this brings back some "mutable" members, not in LabelTrack, but in
LabelStruct.
To make that go away, and still have the Draw function const, figure out how to
update the label track layout at the right times, outside of the draw function.