void EditToolBar::OnButton(wxCommandEvent &event) { AudacityProject *p = GetActiveProject(); if (!p) return; bool busy = gAudioIO->IsBusy(); int id = event.GetId(); switch (id) { case ETBCutID: if (!busy) p->OnCut(); break; case ETBCopyID: if (!busy) p->OnCopy(); break; case ETBPasteID: if (!busy) p->OnPaste(); break; case ETBTrimID: if (!busy) p->OnTrim(); break; case ETBSilenceID: if (!busy) p->OnSilence(); break; case ETBUndoID: if (!busy) p->OnUndo(); break; case ETBRedoID: if (!busy) p->OnRedo(); break; #ifdef EXPERIMENTAL_LINKING case ETBLinkID: if (!busy) p->OnStickyLabel(); return;//avoiding the call to SetButton() #endif case ETBZoomInID: p->OnZoomIn(); break; case ETBZoomOutID: p->OnZoomOut(); break; #if 0 // Disabled for version 1.2.0 since it doesn't work quite right... case ETBZoomToggleID: p->OnZoomToggle(); break; #endif case ETBZoomSelID: p->OnZoomSel(); break; case ETBZoomFitID: p->OnZoomFit(); break; } SetButton(false, mButtons[id]); }
void EditToolBar::OnButton(wxCommandEvent &event) { AudacityProject *p = GetActiveProject(); if (!p) return; bool busy = gAudioIO->IsBusy(); int id = event.GetId(); switch (id) { case ETBCutID: if (!busy) p->OnCut(); break; case ETBCopyID: if (!busy) p->OnCopy(); break; case ETBPasteID: if (!busy) p->OnPaste(); break; case ETBTrimID: if (!busy) p->OnTrim(); break; case ETBSilenceID: if (!busy) p->OnSilence(); break; case ETBUndoID: if (!busy) p->OnUndo(); break; case ETBRedoID: if (!busy) p->OnRedo(); break; #ifdef EXPERIMENTAL_SYNC_LOCK case ETBSyncLockID: p->OnSyncLock(); return;//avoiding the call to SetButton() #endif case ETBZoomInID: p->OnZoomIn(); break; case ETBZoomOutID: p->OnZoomOut(); break; #if 0 // Disabled for version 1.2.0 since it doesn't work quite right... case ETBZoomToggleID: p->OnZoomToggle(); break; #endif case ETBZoomSelID: p->OnZoomSel(); break; case ETBZoomFitID: p->OnZoomFit(); break; #if defined(EXPERIMENTAL_EFFECTS_RACK) case ETBEffectsID: EffectManager::Get().ShowRack(); break; #endif } SetButton(false, mButtons[id]); }