diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index d4de54a44..22ed2421f 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -81,12 +81,12 @@ IMPLEMENT_CLASS(ControlToolBar, ToolBar); BEGIN_EVENT_TABLE(ControlToolBar, ToolBar) EVT_CHAR(ControlToolBar::OnKeyEvent) - EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay) - EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop) - EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord) EVT_BUTTON(ID_REW_BUTTON, ControlToolBar::OnRewind) EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF) + EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop) + EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay) EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause) + EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord) EVT_IDLE(ControlToolBar::OnIdle) END_EVENT_TABLE() @@ -193,9 +193,19 @@ void ControlToolBar::Populate() SetBackgroundColour( theTheme.Colour( clrMedium ) ); MakeButtonBackgroundsLarge(); - mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled, - ID_PAUSE_BUTTON, true, XO("Pause")); + // Rewind button + mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled, + ID_REW_BUTTON, false, XO("Skip to Start")); + // Fast-forward button + mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled, + ID_FF_BUTTON, false, XO("Skip to End")); + + // Stop button + mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled , + ID_STOP_BUTTON, false, XO("Stop")); + + // Play button mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled, ID_PLAY_BUTTON, true, XO("Play")); MakeAlternateImages(*mPlay, 1, bmpLoop, bmpLoop, bmpLoopDisabled); @@ -207,15 +217,11 @@ void ControlToolBar::Populate() bmpSeek, bmpSeek, bmpSeekDisabled); mPlay->FollowModifierKeys(); - mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled , - ID_STOP_BUTTON, false, XO("Stop")); - - mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled, - ID_REW_BUTTON, false, XO("Skip to Start")); - - mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled, - ID_FF_BUTTON, false, XO("Skip to End")); + // Pause button + mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled, + ID_PAUSE_BUTTON, true, XO("Pause")); + // Record button mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled, ID_RECORD_BUTTON, false, XO("Record")); @@ -249,27 +255,27 @@ void ControlToolBar::RegenerateTooltips() CommandID name; switch (iWinID) { + case ID_REW_BUTTON: + name = wxT("CursProjectStart"); + break; + case ID_FF_BUTTON: + name = wxT("CursProjectEnd"); + break; + case ID_STOP_BUTTON: + name = wxT("Stop"); + break; case ID_PLAY_BUTTON: // Without shift name = wxT("PlayStop"); break; + case ID_PAUSE_BUTTON: + name = wxT("Pause"); + break; case ID_RECORD_BUTTON: // Without shift //name = wxT("Record"); name = wxT("Record1stChoice"); break; - case ID_PAUSE_BUTTON: - name = wxT("Pause"); - break; - case ID_STOP_BUTTON: - name = wxT("Stop"); - break; - case ID_FF_BUTTON: - name = wxT("CursProjectEnd"); - break; - case ID_REW_BUTTON: - name = wxT("CursProjectStart"); - break; } std::vector<ComponentInterfaceSymbol> commands( 1u, { name, Verbatim( pCtrl->GetLabel() ) } ); @@ -277,10 +283,24 @@ void ControlToolBar::RegenerateTooltips() // Some have a second switch (iWinID) { + case ID_REW_BUTTON: + // With shift + commands.push_back( { + wxT("SelStart"), XO("Select to Start") } ); + break; + case ID_FF_BUTTON: + // With shift + commands.push_back( { + wxT("SelEnd"), XO("Select to End") } ); + break; + case ID_STOP_BUTTON: + break; case ID_PLAY_BUTTON: // With shift commands.push_back( { wxT("PlayLooped"), XO("Loop Play") } ); break; + case ID_PAUSE_BUTTON: + break; case ID_RECORD_BUTTON: // With shift { bool bPreferNewTrack; @@ -294,20 +314,6 @@ void ControlToolBar::RegenerateTooltips() } ); } break; - case ID_PAUSE_BUTTON: - break; - case ID_STOP_BUTTON: - break; - case ID_FF_BUTTON: - // With shift - commands.push_back( { - wxT("SelEnd"), XO("Select to End") } ); - break; - case ID_REW_BUTTON: - // With shift - commands.push_back( { - wxT("SelStart"), XO("Select to Start") } ); - break; } ToolBar::SetButtonToolTip( mProject, *pCtrl, commands.data(), commands.size()); @@ -377,11 +383,11 @@ void ControlToolBar::ArrangeButtons() mRewind->MoveBeforeInTabOrder( mRecord ); mFF->MoveBeforeInTabOrder( mRecord ); - mSizer->Add( mPause, 0, flags, 2 ); - mSizer->Add( mPlay, 0, flags, 2 ); - mSizer->Add( mStop, 0, flags, 2 ); mSizer->Add( mRewind, 0, flags, 2 ); mSizer->Add( mFF, 0, flags, 10 ); + mSizer->Add( mStop, 0, flags, 2 ); + mSizer->Add( mPlay, 0, flags, 2 ); + mSizer->Add( mPause, 0, flags, 2 ); mSizer->Add( mRecord, 0, flags, 5 ); } else diff --git a/src/toolbars/ControlToolBar.h b/src/toolbars/ControlToolBar.h index 257bfacf7..34f34f1b8 100644 --- a/src/toolbars/ControlToolBar.h +++ b/src/toolbars/ControlToolBar.h @@ -99,23 +99,25 @@ class TENACITY_DLL_API ControlToolBar final : public ToolBar { void ArrangeButtons(); TranslatableString StateForStatusBar(); + // Sorted in order of appearance, not alphabetically + enum { - ID_PAUSE_BUTTON = 11000, - ID_PLAY_BUTTON, - ID_STOP_BUTTON, - ID_FF_BUTTON, ID_REW_BUTTON, + ID_FF_BUTTON, + ID_STOP_BUTTON, + ID_PLAY_BUTTON, + ID_PAUSE_BUTTON = 11000, ID_RECORD_BUTTON, BUTTON_COUNT, }; AButton *mRewind; - AButton *mPlay; - AButton *mRecord; - AButton *mPause; - AButton *mStop; AButton *mFF; + AButton *mStop; + AButton *mPlay; + AButton *mPause; + AButton *mRecord; // Activate ergonomic order for transport buttons bool mErgonomicTransportButtons;