Fix bug 181.

This commit is contained in:
v.audacity 2012-08-16 23:41:09 +00:00
parent cb2e9475c2
commit da08f1ea12
3 changed files with 13 additions and 4 deletions

View File

@ -6264,7 +6264,9 @@ void AudacityProject::OnRemoveTracks()
PushState(_("Removed audio track(s)"), _("Remove Track"));
mTrackPanel->UpdateViewIfNoTracks();
mTrackPanel->Refresh(false);
if (mMixerBoard)
mMixerBoard->Refresh(true);
}

View File

@ -3884,8 +3884,16 @@ void TrackPanel::HandleClosing(wxMouseEvent & event)
}
SetCapturedTrack( NULL );
}
// BG: There are no more tracks on screen
if (mTracks->IsEmpty()) {
this->UpdateViewIfNoTracks();
this->Refresh(false);
}
void TrackPanel::UpdateViewIfNoTracks()
{
if (mTracks->IsEmpty())
{
// BG: There are no more tracks on screen
//BG: Set zoom to normal
mViewInfo->zoom = 44100.0 / 512.0;
@ -3895,8 +3903,6 @@ void TrackPanel::HandleClosing(wxMouseEvent & event)
mListener->TP_RedrawScrollbars();
mListener->TP_DisplayStatusMessage(wxT("")); //STM: Clear message if all tracks are removed
Refresh(false);
}
}

View File

@ -200,6 +200,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
virtual void OnTrackListResized(wxCommandEvent & event);
virtual void OnTrackListUpdated(wxCommandEvent & event);
virtual void UpdateViewIfNoTracks(); // Call this to update mViewInfo, etc, after track(s) removal, before Refresh().
virtual double GetMostRecentXPos();