void ToolsToolBar::OnTool(wxCommandEvent & evt)
{
   mCurrentTool = evt.GetId() - firstTool;
   for (int i = 0; i < numTools; i++)
      if (i == mCurrentTool)
         mTool[i]->PushDown();
      else
         mTool[i]->PopUp();

#ifdef EXPERIMENTAL_SCRUBBING_BASIC
   if (0 != mCurrentTool) {
      AudacityProject *p = GetActiveProject();
      if (p) {
         TrackPanel *tp = p->GetTrackPanel();
         if (tp) {
            tp->StopScrubbing();
         }
      }
   }
#endif

   RedrawAllProjects();

   gPrefs->Write(wxT("/GUI/ToolBars/Tools/MultiToolActive"),
                 IsDown(multiTool));
   gPrefs->Flush();
}
Beispiel #2
0
void ControlToolBar::OnTool(wxCommandEvent & evt)
{
   mCurrentTool = evt.GetId() - ID_FIRST_TOOL;
   for (int i = 0; i < numTools; i++)
      if (i == mCurrentTool) 
         mTool[i]->PushDown();
      else
         mTool[i]->PopUp();

   RedrawAllProjects();
}
Beispiel #3
0
void ToolsToolBar::OnTool(wxCommandEvent & evt)
{
   mCurrentTool = evt.GetId() - firstTool;
   for (int i = 0; i < numTools; i++)
      if (i == mCurrentTool)
         mTool[i]->PushDown();
      else
         mTool[i]->PopUp();

   RedrawAllProjects();

   gPrefs->Write(wxT("/GUI/ToolBars/Tools/MultiToolActive"),
                 IsDown(multiTool));
   gPrefs->Flush();
}
Beispiel #4
0
void APalette::OnTool(wxCommandEvent & evt)
{
   int prev = mCurrentTool;

   mCurrentTool = evt.GetId() - ID_FIRST_TOOL;

   for (int i = 0; i < 4; i++)
      if (i == mCurrentTool)
         mTool[i]->PushDown();
      else
         mTool[i]->PopUp();

   if (mCurrentTool == 1 || prev == 1)
      RedrawAllProjects();
}
Beispiel #5
0
/// Sets the currently active tool
/// @param tool - The index of the tool to be used.
/// @param show - should we update the button display?
void ControlToolBar::SetCurrentTool(int tool, bool show)
{
   #if (AUDACITY_BRANDING == BRAND_THINKLABS) 
      // no tools for Thinklabs
      return;
   #endif

   //In multi-mode the current tool is shown by the 
   //cursor icon.  The buttons are not updated.

   if (tool != mCurrentTool) {
      if (show)
         mTool[mCurrentTool]->PopUp();
      mCurrentTool=tool;
      if (show)
         mTool[mCurrentTool]->PushDown();
   }
   RedrawAllProjects();
}