mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-04 06:29:07 +02:00
Merge branch 'master' into HEAD
This commit is contained in:
commit
9ee11e94bd
@ -387,12 +387,44 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyConfigPrefs::OnDefaults(wxCommandEvent & WXUNUSED(event))
|
|
||||||
|
|
||||||
|
// There currently is only one clickable AButton
|
||||||
|
// so we just do what it needs.
|
||||||
|
void KeyConfigPrefs::OnDefaults(wxCommandEvent & event)
|
||||||
{
|
{
|
||||||
|
wxMenu Menu;
|
||||||
|
Menu.Append( 0, _("Import Standard Defaults") );
|
||||||
|
Menu.Append( 1, _("Import Max Defaults") );
|
||||||
|
Menu.Bind( wxEVT_COMMAND_MENU_SELECTED, &KeyConfigPrefs::OnImportDefaults, this );
|
||||||
|
// Pop it up where the mouse is.
|
||||||
|
PopupMenu(&Menu);//, wxPoint(0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void KeyConfigPrefs::OnImportDefaults(wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
int id = event.GetId();
|
||||||
mNewKeys = mDefaultKeys;
|
mNewKeys = mDefaultKeys;
|
||||||
|
|
||||||
for (size_t i = 0; i < mNewKeys.GetCount(); i++) {
|
for (size_t i = 0; i < mNewKeys.GetCount(); i++) {
|
||||||
mManager->SetKeyFromIndex(i, mNewKeys[i]);
|
// Proof of concept for idea for freeing up some unwanted bindings.
|
||||||
|
// There will be neater code idioms we can use.
|
||||||
|
bool bDeleteBinding = false;
|
||||||
|
if( id == 0 ){
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "A" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "D" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Ctrl+Shift+A" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+X" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+K" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+Shift+X" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+Shift+K" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+L" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+Shift+C" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+I" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+J" );
|
||||||
|
bDeleteBinding |= ( mNewKeys[i] == "Alt+Shift+J" );
|
||||||
|
}
|
||||||
|
mManager->SetKeyFromIndex(i, bDeleteBinding ? "" : mNewKeys[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
RefreshBindings(true);
|
RefreshBindings(true);
|
||||||
|
@ -52,6 +52,7 @@ private:
|
|||||||
|
|
||||||
void OnViewBy(wxCommandEvent & e);
|
void OnViewBy(wxCommandEvent & e);
|
||||||
void OnDefaults(wxCommandEvent & e);
|
void OnDefaults(wxCommandEvent & e);
|
||||||
|
void OnImportDefaults(wxCommandEvent & e);
|
||||||
void OnImport(wxCommandEvent & e);
|
void OnImport(wxCommandEvent & e);
|
||||||
void OnExport(wxCommandEvent & e);
|
void OnExport(wxCommandEvent & e);
|
||||||
void OnSet(wxCommandEvent & e);
|
void OnSet(wxCommandEvent & e);
|
||||||
|
@ -78,6 +78,10 @@ enum {
|
|||||||
EndTitleID,
|
EndTitleID,
|
||||||
AudioTitleID,
|
AudioTitleID,
|
||||||
|
|
||||||
|
LeftID,
|
||||||
|
CentralNameID,
|
||||||
|
RightID,
|
||||||
|
|
||||||
StartEndRadioID,
|
StartEndRadioID,
|
||||||
StartLengthRadioID,
|
StartLengthRadioID,
|
||||||
LengthEndRadioID,
|
LengthEndRadioID,
|
||||||
@ -123,8 +127,10 @@ SelectionBar::SelectionBar()
|
|||||||
mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
|
mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
|
||||||
mStartTime(NULL), mEndTime(NULL), mLengthTime(NULL), mCenterTime(NULL),
|
mStartTime(NULL), mEndTime(NULL), mLengthTime(NULL), mCenterTime(NULL),
|
||||||
mAudioTime(NULL),
|
mAudioTime(NULL),
|
||||||
|
#ifdef SEL_RADIO_TITLES
|
||||||
mStartTitle(NULL), mCenterTitle(NULL), mLengthTitle(NULL), mEndTitle(NULL),
|
mStartTitle(NULL), mCenterTitle(NULL), mLengthTitle(NULL), mEndTitle(NULL),
|
||||||
mStartEndProxy(NULL), mStartLengthProxy(NULL), mLengthEndProxy(NULL), mLengthCenterProxy(NULL),
|
mStartEndProxy(NULL), mStartLengthProxy(NULL), mLengthEndProxy(NULL), mLengthCenterProxy(NULL),
|
||||||
|
#endif
|
||||||
mDrive1( StartTimeID), mDrive2( EndTimeID ),
|
mDrive1( StartTimeID), mDrive2( EndTimeID ),
|
||||||
mSelectionMode(0)
|
mSelectionMode(0)
|
||||||
{
|
{
|
||||||
@ -188,8 +194,8 @@ wxRadioButton * SelectionBar::AddRadioButton( const wxString & Name,
|
|||||||
return pBtn;
|
return pBtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer ){
|
wxStaticText * SelectionBar::AddTitle( const wxString & Title, int id, wxSizer * pSizer ){
|
||||||
wxStaticText * pTitle = safenew wxStaticText(this, -1,Title );
|
wxStaticText * pTitle = safenew wxStaticText(this, id,Title );
|
||||||
pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
|
pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
|
||||||
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
|
pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
|
||||||
return pTitle;
|
return pTitle;
|
||||||
@ -212,7 +218,10 @@ void SelectionBar::Populate()
|
|||||||
{
|
{
|
||||||
SetBackgroundColour( theTheme.Colour( clrMedium ) );
|
SetBackgroundColour( theTheme.Colour( clrMedium ) );
|
||||||
mStartTime = mEndTime = mLengthTime = mCenterTime = mAudioTime = nullptr;
|
mStartTime = mEndTime = mLengthTime = mCenterTime = mAudioTime = nullptr;
|
||||||
|
#ifdef SEL_RADIO_TITLE
|
||||||
mStartEndProxy = mStartLengthProxy = mLengthEndProxy = mLengthCenterProxy = nullptr;
|
mStartEndProxy = mStartLengthProxy = mLengthEndProxy = mLengthCenterProxy = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// This will be inherited by all children:
|
// This will be inherited by all children:
|
||||||
SetFont(wxFont(
|
SetFont(wxFont(
|
||||||
@ -231,7 +240,7 @@ void SelectionBar::Populate()
|
|||||||
* look-ups static because they depend on translations which are done at
|
* look-ups static because they depend on translations which are done at
|
||||||
* runtime */
|
* runtime */
|
||||||
|
|
||||||
Add((mainSizer = safenew wxFlexGridSizer(7, 1, 1)), 0, wxALIGN_CENTER_VERTICAL);
|
Add((mainSizer = safenew wxFlexGridSizer(8, 1, 1)), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Top row (mostly labels)
|
// Top row (mostly labels)
|
||||||
@ -251,11 +260,14 @@ void SelectionBar::Populate()
|
|||||||
mainSizer->Add(pProjRate,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
mainSizer->Add(pProjRate,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
mainSizer->Add(5, 1);
|
mainSizer->Add(5, 1);
|
||||||
|
|
||||||
AddTitle( _("Snap-To"), mainSizer );
|
AddTitle( _("Snap-To"), -1, mainSizer );
|
||||||
// Not enough room to say 'Selection Options". There is a tooltip instead.
|
// Not enough room to say 'Selection Options". There is a tooltip instead.
|
||||||
AddTitle( wxT(""), mainSizer );
|
AddTitle( wxT(""), -1, mainSizer );
|
||||||
|
// This is for the vertical line.
|
||||||
|
AddTitle( wxT(""), -1, mainSizer );
|
||||||
|
|
||||||
{
|
{
|
||||||
|
#ifdef SEL_RADIO_TITLE
|
||||||
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
(mStartEndRadBtn = AddRadioButton( _("Start-End"), StartEndRadioID, hSizer.get(), wxRB_GROUP))
|
(mStartEndRadBtn = AddRadioButton( _("Start-End"), StartEndRadioID, hSizer.get(), wxRB_GROUP))
|
||||||
->SetValue( mSelectionMode == 0 );
|
->SetValue( mSelectionMode == 0 );
|
||||||
@ -270,9 +282,23 @@ void SelectionBar::Populate()
|
|||||||
->SetValue( mSelectionMode == 3 );
|
->SetValue( mSelectionMode == 3 );
|
||||||
mLengthCenterProxy = mProxy;
|
mLengthCenterProxy = mProxy;
|
||||||
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SEL_BUTTON_TITLES
|
||||||
|
auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||||
|
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
mButtonTitles[0] = AddTitle( "< ", LeftID, hSizer.get() );
|
||||||
|
mButtonTitles[1] = AddTitle( "Start - End ", CentralNameID, hSizer.get() );
|
||||||
|
mButtonTitles[2] = AddTitle( " >", RightID, hSizer.get() );
|
||||||
|
mButtonTitles[0]->Bind( wxEVT_LEFT_DOWN,&SelectionBar::OnModeDecClicked,this );
|
||||||
|
mButtonTitles[1]->Bind( wxEVT_LEFT_DOWN,&SelectionBar::OnChooserTitleClicked, this );
|
||||||
|
mButtonTitles[2]->Bind( wxEVT_LEFT_DOWN,&SelectionBar::OnModeIncClicked,this );
|
||||||
|
vSizer->Add( hSizer.release(), 0, wxALIGN_CENTER, 0);
|
||||||
|
mainSizer->Add(vSizer.release(), 0, wxALIGN_CENTER, 0 );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#ifdef SEL_PLAIN_TITLES
|
||||||
mStartTitle = AddTitle( _("Start"), mainSizer );
|
mStartTitle = AddTitle( _("Start"), mainSizer );
|
||||||
mLengthTitle = AddTitle( _("Length"), mainSizer );
|
mLengthTitle = AddTitle( _("Length"), mainSizer );
|
||||||
mCenterTitle = AddTitle( _("Center"), mainSizer );
|
mCenterTitle = AddTitle( _("Center"), mainSizer );
|
||||||
@ -284,8 +310,9 @@ void SelectionBar::Populate()
|
|||||||
mEndTitle->Bind( wxEVT_LEFT_DOWN,&SelectionBar::OnEndTitleClicked,this );
|
mEndTitle->Bind( wxEVT_LEFT_DOWN,&SelectionBar::OnEndTitleClicked,this );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
mainSizer->Add(5, 1);
|
mainSizer->Add(5, 1);
|
||||||
AddTitle( _("Audio Position"), mainSizer );
|
AddTitle( _("Audio Position"), -1, mainSizer );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Middle row (mostly time controls)
|
// Middle row (mostly time controls)
|
||||||
@ -355,7 +382,7 @@ void SelectionBar::Populate()
|
|||||||
NULL,
|
NULL,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
// Old code which placed a button from which to select options.
|
// Old code which placed a button from which to select options.
|
||||||
// Retained in case we want a button for selection-toolbar options at a future date.
|
// Retained in case we want a button for selection-toolbar options at a future date.
|
||||||
AButton *& pBtn = mButtons[ SelTBMenuID - SelTBFirstButton];
|
AButton *& pBtn = mButtons[ SelTBMenuID - SelTBFirstButton];
|
||||||
@ -369,7 +396,7 @@ void SelectionBar::Populate()
|
|||||||
|
|
||||||
pBtn->SetLabel(_("Selection options"));
|
pBtn->SetLabel(_("Selection options"));
|
||||||
pBtn->SetToolTip(_("Selection options"));
|
pBtn->SetToolTip(_("Selection options"));
|
||||||
pBtn->Disable();
|
//pBtn->Disable();
|
||||||
mainSizer->Add( pBtn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
mainSizer->Add( pBtn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -391,18 +418,21 @@ void SelectionBar::Populate()
|
|||||||
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
||||||
mStartTime = AddTime(_("Start"), StartTimeID, hSizer.get() );
|
mStartTime = AddTime(_("Start"), StartTimeID, hSizer.get() );
|
||||||
mHyphen[0] = AddTitle( "-", hSizer.get() );
|
mHyphen[0] = AddTitle( "-", -1, hSizer.get() );
|
||||||
mLengthTime = AddTime(_("Length"), LengthTimeID, hSizer.get() );
|
mLengthTime = AddTime(_("Length"), LengthTimeID, hSizer.get() );
|
||||||
mHyphen[1] = AddTitle( "-", hSizer.get() );
|
mHyphen[1] = AddTitle( "-", -1, hSizer.get() );
|
||||||
mCenterTime = AddTime(_("Center"), CenterTimeID, hSizer.get() );
|
mCenterTime = AddTime(_("Center"), CenterTimeID, hSizer.get() );
|
||||||
mHyphen[2] = AddTitle( "-", hSizer.get() );
|
mHyphen[2] = AddTitle( "-", -1, hSizer.get() );
|
||||||
mEndTime = AddTime(_("End"), EndTimeID, hSizer.get() );
|
mEndTime = AddTime(_("End"), EndTimeID, hSizer.get() );
|
||||||
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
mainSizer->Add(hSizer.release(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
|
|
||||||
|
#ifdef SEL_RADIO_TITLES
|
||||||
// Put choice of what fields to show immediately before the fields.
|
// Put choice of what fields to show immediately before the fields.
|
||||||
mStartEndRadBtn->MoveBeforeInTabOrder( mStartTime );
|
mStartEndRadBtn->MoveBeforeInTabOrder( mStartTime );
|
||||||
mStartLengthRadBtn->MoveAfterInTabOrder( mStartEndRadBtn );
|
mStartLengthRadBtn->MoveAfterInTabOrder( mStartEndRadBtn );
|
||||||
mLengthEndRadBtn->MoveAfterInTabOrder( mStartLengthRadBtn );
|
mLengthEndRadBtn->MoveAfterInTabOrder( mStartLengthRadBtn );
|
||||||
mLengthCenterRadBtn->MoveAfterInTabOrder( mLengthEndRadBtn );
|
mLengthCenterRadBtn->MoveAfterInTabOrder( mLengthEndRadBtn );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
mainSizer->Add(safenew wxStaticLine(this, -1, wxDefaultPosition,
|
mainSizer->Add(safenew wxStaticLine(this, -1, wxDefaultPosition,
|
||||||
@ -564,6 +594,21 @@ void SelectionBar::OnLengthTitleClicked(wxMouseEvent & event){ OnTitleClicked( L
|
|||||||
void SelectionBar::OnCenterTitleClicked(wxMouseEvent & event){ OnTitleClicked( CenterTimeID );};
|
void SelectionBar::OnCenterTitleClicked(wxMouseEvent & event){ OnTitleClicked( CenterTimeID );};
|
||||||
void SelectionBar::OnEndTitleClicked(wxMouseEvent & event){ OnTitleClicked( EndTimeID );};
|
void SelectionBar::OnEndTitleClicked(wxMouseEvent & event){ OnTitleClicked( EndTimeID );};
|
||||||
|
|
||||||
|
void SelectionBar::OnModeDecClicked(wxMouseEvent & event){
|
||||||
|
SetSelectionMode( (mSelectionMode +3)%4 );
|
||||||
|
SelectionModeUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SelectionBar::OnModeIncClicked(wxMouseEvent & event){
|
||||||
|
SetSelectionMode( (mSelectionMode +1)%4 );
|
||||||
|
SelectionModeUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SelectionBar::OnChooserTitleClicked(wxMouseEvent & event){
|
||||||
|
wxCommandEvent evt;
|
||||||
|
OnButton( evt );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called when one of the format drop downs is changed.
|
// Called when one of the format drop downs is changed.
|
||||||
void SelectionBar::OnUpdate(wxCommandEvent &evt)
|
void SelectionBar::OnUpdate(wxCommandEvent &evt)
|
||||||
@ -615,7 +660,9 @@ void SelectionBar::SetDrivers( int driver1, int driver2 )
|
|||||||
mDrive1 = driver1;
|
mDrive1 = driver1;
|
||||||
mDrive2 = driver2;
|
mDrive2 = driver2;
|
||||||
|
|
||||||
|
#ifdef SEL_PLAIN_TITLES
|
||||||
wxStaticText ** Titles[4] = { &mStartTitle, &mCenterTitle, &mLengthTitle, &mEndTitle};
|
wxStaticText ** Titles[4] = { &mStartTitle, &mCenterTitle, &mLengthTitle, &mEndTitle};
|
||||||
|
#endif
|
||||||
NumericTextCtrl ** Ctrls[4] = { &mStartTime, &mCenterTime, &mLengthTime, &mEndTime};
|
NumericTextCtrl ** Ctrls[4] = { &mStartTime, &mCenterTime, &mLengthTime, &mEndTime};
|
||||||
wxString Text[4] = { _("Start"), _("Center"), _("Length"), _("End") };
|
wxString Text[4] = { _("Start"), _("Center"), _("Length"), _("End") };
|
||||||
|
|
||||||
@ -631,9 +678,11 @@ void SelectionBar::SetDrivers( int driver1, int driver2 )
|
|||||||
wxString VoiceOverText = wxString::Format(_("Selection %s. %s won't change."), Temp, Text[fixed]);
|
wxString VoiceOverText = wxString::Format(_("Selection %s. %s won't change."), Temp, Text[fixed]);
|
||||||
// i18n-hint: %s is replaced e.g by 'Length'. This is a tooltip on a numerical control.
|
// i18n-hint: %s is replaced e.g by 'Length'. This is a tooltip on a numerical control.
|
||||||
//wxString Tooltip = wxString::Format( _(" With %s fixed. (Use context menu to change format.) "), Text[fixed] );
|
//wxString Tooltip = wxString::Format( _(" With %s fixed. (Use context menu to change format.) "), Text[fixed] );
|
||||||
|
#ifdef SEL_PLAIN_TITLES
|
||||||
if( *Titles[i] ){
|
if( *Titles[i] ){
|
||||||
(*Titles[i])->SetLabelText( Title );
|
(*Titles[i])->SetLabelText( Title );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if( *Ctrls[i] ){
|
if( *Ctrls[i] ){
|
||||||
(*Ctrls[i])->SetName( Temp );
|
(*Ctrls[i])->SetName( Temp );
|
||||||
//(*Ctrls[i])->SetToolTip( Tooltip );
|
//(*Ctrls[i])->SetToolTip( Tooltip );
|
||||||
@ -706,6 +755,8 @@ void SelectionBar::SetSelectionMode(int mode)
|
|||||||
mSelectionMode = mode;
|
mSelectionMode = mode;
|
||||||
|
|
||||||
int id = mode + StartEndRadioID;
|
int id = mode + StartEndRadioID;
|
||||||
|
|
||||||
|
#ifdef SEL_RADIO_TITLES
|
||||||
if( mStartEndProxy == NULL ){
|
if( mStartEndProxy == NULL ){
|
||||||
// i18n-hint: S-E is an abbreviation of Start-End
|
// i18n-hint: S-E is an abbreviation of Start-End
|
||||||
mStartEndRadBtn->SetLabelText( (id == StartEndRadioID) ? _("Start - End") : _("S-E") );
|
mStartEndRadBtn->SetLabelText( (id == StartEndRadioID) ? _("Start - End") : _("S-E") );
|
||||||
@ -729,11 +780,16 @@ void SelectionBar::SetSelectionMode(int mode)
|
|||||||
mLengthEndRadBtn->SetToolTip( (id != LengthEndRadioID) ? _("Show length and end time") : "" );
|
mLengthEndRadBtn->SetToolTip( (id != LengthEndRadioID) ? _("Show length and end time") : "" );
|
||||||
mLengthCenterRadBtn->SetToolTip( (id != LengthCenterRadioID) ? _("Show length and center") : "" );
|
mLengthCenterRadBtn->SetToolTip( (id != LengthCenterRadioID) ? _("Show length and center") : "" );
|
||||||
|
|
||||||
|
|
||||||
mStartEndRadBtn->SetValue( id == StartEndRadioID );
|
mStartEndRadBtn->SetValue( id == StartEndRadioID );
|
||||||
mStartLengthRadBtn->SetValue( id == StartLengthRadioID );
|
mStartLengthRadBtn->SetValue( id == StartLengthRadioID );
|
||||||
mLengthEndRadBtn->SetValue( id == LengthEndRadioID );
|
mLengthEndRadBtn->SetValue( id == LengthEndRadioID );
|
||||||
mLengthCenterRadBtn->SetValue( id == LengthCenterRadioID );
|
mLengthCenterRadBtn->SetValue( id == LengthCenterRadioID );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SEL_BUTTON_TITLES
|
||||||
|
wxString CenterNames[] = { " Start - End ", " Start - Length ", " Length - End ", " Length - Center " };
|
||||||
|
mButtonTitles[1]->SetLabel( CenterNames[mode] );
|
||||||
|
#endif
|
||||||
|
|
||||||
// First decide which two controls drive the others...
|
// First decide which two controls drive the others...
|
||||||
// For example the last option is with all controls shown, and in that mode we
|
// For example the last option is with all controls shown, and in that mode we
|
||||||
@ -763,13 +819,17 @@ void SelectionBar::ShowHideControls(int mode)
|
|||||||
15};
|
15};
|
||||||
int mask = masks[mode];
|
int mask = masks[mode];
|
||||||
|
|
||||||
NumericTextCtrl ** Ctrls[4] = { &mStartTime, &mCenterTime, &mLengthTime, &mEndTime};
|
#ifdef SEL_PLAIN_TITLES
|
||||||
wxStaticText ** Titles[4] = { &mStartTitle, &mCenterTitle, &mLengthTitle, &mEndTitle};
|
wxStaticText ** Titles[4] = { &mStartTitle, &mCenterTitle, &mLengthTitle, &mEndTitle};
|
||||||
|
#endif
|
||||||
|
NumericTextCtrl ** Ctrls[4] = { &mStartTime, &mCenterTime, &mLengthTime, &mEndTime};
|
||||||
for(int i=0;i<4;i++){
|
for(int i=0;i<4;i++){
|
||||||
if( *Ctrls[i])
|
if( *Ctrls[i])
|
||||||
(*Ctrls[i])->Show( (mask & (1<<i))!=0 );
|
(*Ctrls[i])->Show( (mask & (1<<i))!=0 );
|
||||||
|
#ifdef SEL_PLAIN_TITLES
|
||||||
if( *Titles[i])
|
if( *Titles[i])
|
||||||
(*Titles[i])->Show( (mask & (1<<i))!=0 );
|
(*Titles[i])->Show( (mask & (1<<i))!=0 );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,12 @@
|
|||||||
|
|
||||||
#include "ToolBar.h"
|
#include "ToolBar.h"
|
||||||
|
|
||||||
|
// PLAIN_TITLES give Start Length Center End above each field.
|
||||||
|
// RADIO_TITLES give ()SE (*)Start-Length ()LE ()LC style.
|
||||||
|
// BUTTON_TITLES give < Start - Length > style.
|
||||||
|
//#define SEL_RADIO_TITLES
|
||||||
|
#define SEL_BUTTON_TITLES
|
||||||
|
|
||||||
class wxBitmap;
|
class wxBitmap;
|
||||||
class wxCheckBox;
|
class wxCheckBox;
|
||||||
class wxChoice;
|
class wxChoice;
|
||||||
@ -58,7 +64,7 @@ class SelectionBar final : public ToolBar {
|
|||||||
private:
|
private:
|
||||||
wxRadioButton * AddRadioButton( const wxString & Name, int id,
|
wxRadioButton * AddRadioButton( const wxString & Name, int id,
|
||||||
wxSizer * pSizer, long style);
|
wxSizer * pSizer, long style);
|
||||||
wxStaticText * AddTitle( const wxString & Title,
|
wxStaticText * AddTitle( const wxString & Title, int id,
|
||||||
wxSizer * pSizer );
|
wxSizer * pSizer );
|
||||||
NumericTextCtrl * AddTime( const wxString Name, int id, wxSizer * pSizer );
|
NumericTextCtrl * AddTime( const wxString Name, int id, wxSizer * pSizer );
|
||||||
|
|
||||||
@ -73,6 +79,11 @@ class SelectionBar final : public ToolBar {
|
|||||||
void OnCenterTitleClicked(wxMouseEvent & event);
|
void OnCenterTitleClicked(wxMouseEvent & event);
|
||||||
void OnLengthTitleClicked(wxMouseEvent & event);
|
void OnLengthTitleClicked(wxMouseEvent & event);
|
||||||
void OnEndTitleClicked(wxMouseEvent & event);
|
void OnEndTitleClicked(wxMouseEvent & event);
|
||||||
|
|
||||||
|
void OnModeDecClicked(wxMouseEvent & event);
|
||||||
|
void OnModeIncClicked(wxMouseEvent & event);
|
||||||
|
void OnChooserTitleClicked(wxMouseEvent & event);
|
||||||
|
|
||||||
void OnRate(wxCommandEvent & event);
|
void OnRate(wxCommandEvent & event);
|
||||||
void OnSnapTo(wxCommandEvent & event);
|
void OnSnapTo(wxCommandEvent & event);
|
||||||
void OnFocus(wxFocusEvent &event);
|
void OnFocus(wxFocusEvent &event);
|
||||||
@ -105,24 +116,38 @@ class SelectionBar final : public ToolBar {
|
|||||||
NumericTextCtrl *mEndTime;
|
NumericTextCtrl *mEndTime;
|
||||||
NumericTextCtrl *mAudioTime;
|
NumericTextCtrl *mAudioTime;
|
||||||
|
|
||||||
|
#ifdef PLAIN_TITLES
|
||||||
wxStaticText * mStartTitle;
|
wxStaticText * mStartTitle;
|
||||||
wxStaticText * mCenterTitle;
|
wxStaticText * mCenterTitle;
|
||||||
wxStaticText * mLengthTitle;
|
wxStaticText * mLengthTitle;
|
||||||
wxStaticText * mEndTitle;
|
wxStaticText * mEndTitle;
|
||||||
|
|
||||||
wxStaticText * mHyphen[3];
|
#endif
|
||||||
|
|
||||||
wxStaticText * mProxy;
|
|
||||||
wxStaticText * mStartEndProxy;
|
|
||||||
wxStaticText * mStartLengthProxy;
|
|
||||||
wxStaticText * mLengthEndProxy;
|
|
||||||
wxStaticText * mLengthCenterProxy;
|
|
||||||
|
|
||||||
|
#ifdef SEL_RADIO_TITLES
|
||||||
|
// These are the radio buttons
|
||||||
wxRadioButton * mStartEndRadBtn;
|
wxRadioButton * mStartEndRadBtn;
|
||||||
wxRadioButton * mStartLengthRadBtn;
|
wxRadioButton * mStartLengthRadBtn;
|
||||||
wxRadioButton * mLengthEndRadBtn;
|
wxRadioButton * mLengthEndRadBtn;
|
||||||
wxRadioButton * mLengthCenterRadBtn;
|
wxRadioButton * mLengthCenterRadBtn;
|
||||||
|
|
||||||
|
// These provide proxy themable text for
|
||||||
|
// Radio buttons that couldn't be themed.
|
||||||
|
wxStaticText * mStartEndProxy;
|
||||||
|
wxStaticText * mStartLengthProxy;
|
||||||
|
wxStaticText * mLengthEndProxy;
|
||||||
|
wxStaticText * mLengthCenterProxy;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SEL_BUTTON_TITLES
|
||||||
|
wxStaticText * mButtonTitles[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxStaticText * mProxy;
|
||||||
|
|
||||||
|
|
||||||
|
wxStaticText * mHyphen[3];
|
||||||
wxComboBox *mRateBox;
|
wxComboBox *mRateBox;
|
||||||
wxChoice *mSnapTo;
|
wxChoice *mSnapTo;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user