1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 23:00:06 +02:00

Bug 1522 - No pointer or Status Bar indication of CTRL-click in waveform to move selection boundary

I also took the opportunity to modifier the Status Bar indications when in the TrackInfo.
1) We now mention ctrl click can select or deselect track.
2) If there is only one track, we don't now prompt about rearranging tracks, since you can't.
3) If you hover in a label track's VRuler (which is just a spacer so that things line up), you now don't get a message.
This commit is contained in:
James Crook 2016-10-07 21:38:18 +01:00
parent 2add9792ce
commit fe2dfca3e0
2 changed files with 23 additions and 2 deletions

View File

@ -1363,9 +1363,22 @@ void TrackPanel::SetCursorAndTipWhenInLabel( Track * t,
SetCursor(event.ShiftDown() ? *mZoomOutCursor : *mZoomInCursor); SetCursor(event.ShiftDown() ? *mZoomOutCursor : *mZoomInCursor);
} }
#endif #endif
else if (event.m_x >= GetVRulerOffset() ){
// In VRuler but probably in a label track, and clicks don't do anything here, so no tip.
// Use a space for the tip, otherwsie we get he default message.
// TODO: Maybe the code for label tracks SHOULD treat the VRuler as part of the TrackInfo?
tip = wxT(" ");
SetCursor( *mArrowCursor );
}
else if( GetTrackCount() > 1 ){
// Set a status message if over TrackInfo.
//tip = _("Drag the track vertically to change the order of the tracks.");
tip = _("Ctrl-Click to select or deselect track. Drag up or down to change track order.");
SetCursor( *mArrowCursor );
}
else { else {
// Set a status message if over TrackInfo. // Set a status message if over TrackInfo.
tip = _("Drag the track vertically to change the order of the tracks."); tip = _("Ctrl-Click to select or deselect track.");
SetCursor(*mArrowCursor); SetCursor(*mArrowCursor);
} }
} }
@ -1547,6 +1560,8 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t,
} }
const bool bShiftDown = event.ShiftDown(); const bool bShiftDown = event.ShiftDown();
const bool bCtrlDown = event.ControlDown();
const bool bModifierDown = bShiftDown || bCtrlDown;
#ifdef EXPERIMENTAL_SPECTRAL_EDITING #ifdef EXPERIMENTAL_SPECTRAL_EDITING
if ( (mFreqSelMode == FREQ_SEL_SNAPPING_CENTER) && if ( (mFreqSelMode == FREQ_SEL_SNAPPING_CENTER) &&
@ -1562,7 +1577,7 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t,
// choose boundaries only in snapping tolerance, // choose boundaries only in snapping tolerance,
// and may choose center. // and may choose center.
SelectionBoundary boundary = SelectionBoundary boundary =
ChooseBoundary(event, t, rect, !bShiftDown, !bShiftDown); ChooseBoundary(event, t, rect, !bModifierDown, !bModifierDown);
#ifdef USE_MIDI #ifdef USE_MIDI
// The MIDI HitTest will only succeed if we are on a midi track, so // The MIDI HitTest will only succeed if we are on a midi track, so
@ -1879,6 +1894,11 @@ void TrackPanel::SelectTrack(Track *pTrack, bool selected, bool updateLastPicked
} }
} }
size_t TrackPanel::GetTrackCount(){
auto tracks = GetTracks();
return (size_t)tracks->GetCount();
}
size_t TrackPanel::GetSelectedTrackCount(){ size_t TrackPanel::GetSelectedTrackCount(){
size_t count = 0; size_t count = 0;

View File

@ -291,6 +291,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
// AS: Selection handling // AS: Selection handling
void SelectTrack(Track *track, bool selected, bool updateLastPicked = true); void SelectTrack(Track *track, bool selected, bool updateLastPicked = true);
void SelectRangeOfTracks(Track *sTrack, Track *eTrack); void SelectRangeOfTracks(Track *sTrack, Track *eTrack);
size_t GetTrackCount();
size_t GetSelectedTrackCount(); size_t GetSelectedTrackCount();
virtual void HandleSelect(wxMouseEvent & event); virtual void HandleSelect(wxMouseEvent & event);
virtual void SelectionHandleDrag(wxMouseEvent &event, Track *pTrack); virtual void SelectionHandleDrag(wxMouseEvent &event, Track *pTrack);