diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index 071985e08..a840439b7 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -101,11 +101,12 @@ void MacroCommandDialog::PopulateOrExchange(ShuttleGui &S) S.SetStretchyCol(1); mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0); mParameters->SetEditable(false); - wxString prompt{_("&Details")}; - S.Prop(0).AddPrompt(prompt); - mDetails = S.AddTextWindow( wxT("")); + auto prompt = XO("&Details"); + S.Prop(0).AddPrompt(prompt.Translation()); + mDetails = S + .Name( prompt ) + .AddTextWindow( wxT("")); mDetails->SetEditable(false); - mDetails->SetName(wxStripMenuCodes(prompt)); } S.EndMultiColumn(); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 42ce5254b..92b4541c8 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -145,19 +145,21 @@ void ApplyMacroDialog::PopulateOrExchange(ShuttleGui &S) S.StartHorizontalLay(wxEXPAND, 0); { S.AddPrompt( _("Apply Macro to:") ); - wxButton* btn = S.Id(ApplyToProjectID).AddButton(_("&Project")); + wxButton* btn = S.Id(ApplyToProjectID) + .Name(XO("Apply macro to project")) + .AddButton(_("&Project")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control btn->SetAccessible(safenew WindowAccessible(btn)); #endif - btn->SetName(_("Apply macro to project")); - btn = S.Id(ApplyToFilesID).AddButton(_("&Files...")); + btn = S.Id(ApplyToFilesID) + .Name(XO("Apply macro to files...")) + .AddButton(_("&Files...")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control btn->SetAccessible(safenew WindowAccessible(btn)); #endif - btn->SetName(_("Apply macro to files...")); } S.EndHorizontalLay(); @@ -676,19 +678,21 @@ void MacrosWindow::PopulateOrExchange(ShuttleGui & S) mResize = S.Id(ShrinkID).AddButton(_("Shrin&k")); // Using variable text just to get the positioning options. S.Prop(0).AddVariableText( _("Apply Macro to:"), false, wxALL | wxALIGN_CENTRE_VERTICAL ); - wxButton* btn = S.Id(ApplyToProjectID).AddButton(_("&Project")); + wxButton* btn = S.Id(ApplyToProjectID) + .Name(XO("Apply macro to project")) + .AddButton(_("&Project")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control btn->SetAccessible(safenew WindowAccessible(btn)); #endif - btn->SetName(_("Apply macro to project")); - btn = S.Id(ApplyToFilesID).AddButton(_("&Files...")); + btn = S.Id(ApplyToFilesID) + .Name(XO("Apply macro to files...")) + .AddButton(_("&Files...")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control btn->SetAccessible(safenew WindowAccessible(btn)); #endif - btn->SetName(_("Apply macro to files...")); S.Prop(1).AddSpace( 10 ); S.AddStandardButtons( eOkButton | eCancelButton | eHelpButton); } diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index 387f98fce..d979bd078 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -213,9 +213,10 @@ void BenchmarkDialog::MakeBenchmarkDialog() false); // - mText = S.Id(StaticTextID).AddTextWindow(wxT("")); - /* i18n-hint noun */ - mText->SetName(_("Output")); + mText = S.Id(StaticTextID) + /* i18n-hint noun */ + .Name(XO("Output")) + .AddTextWindow(wxT("")); mText->SetSizeHints(wxSize(500,200)); // diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index b100ec1d1..d1df45cd8 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -324,9 +324,10 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id, // so that name can be set on a standard control mPanScroller->SetAccessible(safenew WindowAccessible(mPanScroller)); #endif - mPanScroller->SetName(_("Scroll")); S.Prop(1); - S.AddWindow(mPanScroller, wxALIGN_LEFT | wxTOP); + S + .Name(XO("Scroll")) + .AddWindow(mPanScroller, wxALIGN_LEFT | wxTOP); } S.EndVerticalLay(); @@ -340,12 +341,13 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id, mZoomSlider = safenew wxSliderWrapper(this, FreqZoomSliderID, 100, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL); S.Prop(1); - S.AddWindow(mZoomSlider, wxALIGN_CENTER_HORIZONTAL); + S + .Name(XO("Zoom")) + .AddWindow(mZoomSlider, wxALIGN_CENTER_HORIZONTAL); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control mZoomSlider->SetAccessible(safenew WindowAccessible(mZoomSlider)); #endif - mZoomSlider->SetName(_("Zoom")); S.AddSpace(5); diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index e3179aa56..c4c618b8e 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -528,37 +528,49 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) S.StartHorizontalLay(wxALIGN_NOT | wxALIGN_LEFT, 0); { - wxRadioButton* rb; + wxRadioButton *rb; + /* i18n-hint: This is before radio buttons selecting which effects to show */ S.AddPrompt(_("Show:")); - /* i18n-hint: Radio button to show all effects */ - rb = S.Id(ID_ShowAll).AddRadioButton(_("&All")); + rb = S.Id(ID_ShowAll) + /* i18n-hint: Radio button to show all effects */ + .Name(XO("Show all")) + /* i18n-hint: Radio button to show all effects */ + .AddRadioButton(_("&All")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control rb->SetAccessible(safenew WindowAccessible(rb)); #endif - rb->SetName(_("Show all")); - /* i18n-hint: Radio button to show just the currently disabled effects */ - rb = S.Id(ID_ShowDisabled).AddRadioButtonToGroup(_("D&isabled")); + + rb = S.Id(ID_ShowDisabled) + /* i18n-hint: Radio button to show just the currently disabled effects */ + .Name(XO("Show disabled")) + /* i18n-hint: Radio button to show just the currently disabled effects */ + .AddRadioButtonToGroup(_("D&isabled")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control rb->SetAccessible(safenew WindowAccessible(rb)); #endif - rb->SetName(_("Show disabled")); - /* i18n-hint: Radio button to show just the currently enabled effects */ - rb = S.Id(ID_ShowEnabled).AddRadioButtonToGroup(_("E&nabled")); + + rb = S.Id(ID_ShowEnabled) + /* i18n-hint: Radio button to show just the currently enabled effects */ + .Name(XO("Show enabled")) + /* i18n-hint: Radio button to show just the currently enabled effects */ + .AddRadioButtonToGroup(_("E&nabled")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control rb->SetAccessible(safenew WindowAccessible(rb)); #endif - rb->SetName(_("Show enabled")); - /* i18n-hint: Radio button to show just the newly discovered effects */ - rb = S.Id(ID_ShowNew).AddRadioButtonToGroup(_("Ne&w")); + + rb = S.Id(ID_ShowNew) + /* i18n-hint: Radio button to show just the newly discovered effects */ + .Name(XO("Show new")) + /* i18n-hint: Radio button to show just the newly discovered effects */ + .AddRadioButtonToGroup(_("Ne&w")); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control rb->SetAccessible(safenew WindowAccessible(rb)); #endif - rb->SetName(_("Show new")); } S.EndHorizontalLay(); } diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index a65ab0504..7032630eb 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -2078,6 +2078,13 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt) if ( !mItem.mToolTip.empty() ) mpWind->SetToolTip( mItem.mToolTip.Translation() ); + if ( !mItem.mName.empty() ) + mpWind->SetName( wxStripMenuCodes( mItem.mName.Translation() ) ); + + if ( !mItem.mNameSuffix.empty() ) + mpWind->SetName( + mpWind->GetName() + mItem.mNameSuffix.Translation() ); + // Reset to defaults mItem = {}; } diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index da2edf48f..b2a2ace4a 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -146,8 +146,25 @@ struct Item { return std::move( *this ); } + // Menu codes in the translation will be stripped + Item&& Name( const TranslatableString &name ) && + { + mName = name; + return std::move( *this ); + } + + // Append a space, then the translation of the given string, to control name + // (not the title or label: this affects the screen reader behavior) + Item&& NameSuffix( const TranslatableString &suffix ) && + { + mNameSuffix = suffix; + return std::move( *this ); + } + std::function< void(wxWindow*) > mValidatorSetter; TranslatableString mToolTip; + TranslatableString mName; + TranslatableString mNameSuffix; }; } @@ -175,6 +192,8 @@ public: // Pass the same initValue to the sequence of calls to AddRadioButton and // AddRadioButtonToGroup. // The radio button is filled if selector == initValue + // Spoken name of the button defaults to the same as the prompt + // (after stripping menu codes): wxRadioButton * AddRadioButton( const wxString & Prompt, int selector = 0, int initValue = 0 ); wxRadioButton * AddRadioButtonToGroup( @@ -510,6 +529,21 @@ public: return *this; } + // Menu codes in the translation will be stripped + ShuttleGui & Name( const TranslatableString &name ) + { + std::move( mItem ).Name( name ); + return *this; + } + + // Append a space, then the translation of the given string, to control name + // (not the title or label: this affects the screen reader behavior) + ShuttleGui & NameSuffix( const TranslatableString &suffix ) + { + std::move( mItem ).NameSuffix( suffix ); + return *this; + } + template ShuttleGui& Validator( const Factory &f ) { diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index a227fd561..ffd016b74 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -832,12 +832,12 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) ID_DATEPICKER_START, // wxWindowID id, m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl") - m_pDatePickerCtrl_Start->SetName(_("Start Date")); m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating. #if wxUSE_ACCESSIBILITY m_pDatePickerCtrl_Start->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_Start)); #endif - S.AddWindow(m_pDatePickerCtrl_Start); + S.Name(XO("Start Date")) + .AddWindow(m_pDatePickerCtrl_Start); m_pTimeTextCtrl_Start = safenew NumericTextCtrl( S.GetParent(), ID_TIMETEXT_START, NumericConverter::TIME, @@ -846,8 +846,8 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) .MenuEnabled(false) .Format(strFormat) .Value(true, wxDateTime_to_AudacityTime(m_DateTime_Start))); - m_pTimeTextCtrl_Start->SetName(_("Start Time")); - S.AddWindow(m_pTimeTextCtrl_Start); + S.Name(XO("Start Time")) + .AddWindow(m_pTimeTextCtrl_Start); } S.EndStatic(); @@ -862,11 +862,11 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) // const wxValidator& validator = wxDefaultValidator, // const wxString& name = "datectrl") m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating. - m_pDatePickerCtrl_End->SetName(_("End Date")); #if wxUSE_ACCESSIBILITY m_pDatePickerCtrl_End->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_End)); #endif - S.AddWindow(m_pDatePickerCtrl_End); + S.Name(XO("End Date")) + .AddWindow(m_pDatePickerCtrl_End); m_pTimeTextCtrl_End = safenew NumericTextCtrl( S.GetParent(), ID_TIMETEXT_END, NumericConverter::TIME, @@ -875,8 +875,8 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) .MenuEnabled(false) .Format(strFormat) .Value(true, wxDateTime_to_AudacityTime(m_DateTime_End))); - m_pTimeTextCtrl_End->SetName(_("End Time")); - S.AddWindow(m_pTimeTextCtrl_End); + S.Name(XO("End Time")) + .AddWindow(m_pTimeTextCtrl_End); } S.EndStatic(); @@ -897,8 +897,8 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) .MenuEnabled(false) .Format(strFormat1) .Value(true, m_TimeSpan_Duration.GetSeconds().ToDouble())); - m_pTimeTextCtrl_Duration->SetName(_("Duration")); - S.AddWindow(m_pTimeTextCtrl_Duration); + S.Name(XO("Duration")) + .AddWindow(m_pTimeTextCtrl_Duration); } S.EndStatic(); } diff --git a/src/effects/Amplify.cpp b/src/effects/Amplify.cpp index b66f14c64..f7bc7f52d 100644 --- a/src/effects/Amplify.cpp +++ b/src/effects/Amplify.cpp @@ -245,8 +245,9 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); - mAmpS = S.Id(ID_Amp).AddSlider( {}, 0, MAX_Amp * SCL_Amp, MIN_Amp * SCL_Amp); - mAmpS->SetName(_("Amplification dB")); + mAmpS = S.Id(ID_Amp) + .Name(XO("Amplification dB")) + .AddSlider( {}, 0, MAX_Amp * SCL_Amp, MIN_Amp * SCL_Amp); } S.EndHorizontalLay(); diff --git a/src/effects/BassTreble.cpp b/src/effects/BassTreble.cpp index 9f3c6eb96..1e9e55237 100644 --- a/src/effects/BassTreble.cpp +++ b/src/effects/BassTreble.cpp @@ -228,14 +228,15 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) // Bass control mBassT = S.Id(ID_Bass) + .Name(XO("Bass (dB):")) .Validator>( 1, &mBass, NumValidatorStyle::DEFAULT, MIN_Bass, MAX_Bass) .AddTextBox(_("Ba&ss (dB):"), wxT(""), 10); - mBassT->SetName(_("Bass (dB):")); S.SetStyle(wxSL_HORIZONTAL); - mBassS = S.Id(ID_Bass).AddSlider( {}, 0, MAX_Bass * SCL_Bass, MIN_Bass * SCL_Bass); - mBassS->SetName(_("Bass")); + mBassS = S.Id(ID_Bass) + .Name(XO("Bass")) + .AddSlider( {}, 0, MAX_Bass * SCL_Bass, MIN_Bass * SCL_Bass); // Treble control mTrebleT = S.Id(ID_Treble) @@ -244,8 +245,9 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Treble (dB):"), wxT(""), 10); S.SetStyle(wxSL_HORIZONTAL); - mTrebleS = S.Id(ID_Treble).AddSlider( {}, 0, MAX_Treble * SCL_Treble, MIN_Treble * SCL_Treble); - mTrebleS->SetName(_("Treble")); + mTrebleS = S.Id(ID_Treble) + .Name(XO("Treble")) + .AddSlider( {}, 0, MAX_Treble * SCL_Treble, MIN_Treble * SCL_Treble); } S.EndMultiColumn(); } @@ -264,8 +266,9 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Volume (dB):"), wxT(""), 10); S.SetStyle(wxSL_HORIZONTAL); - mGainS = S.Id(ID_Gain).AddSlider( {}, 0, MAX_Gain * SCL_Gain, MIN_Gain * SCL_Gain); - mGainS->SetName(_("Level")); + mGainS = S.Id(ID_Gain) + .Name(XO("Level")) + .AddSlider( {}, 0, MAX_Gain * SCL_Gain, MIN_Gain * SCL_Gain); } S.EndMultiColumn(); diff --git a/src/effects/ChangePitch.cpp b/src/effects/ChangePitch.cpp index 6702a4dab..7cf2042f6 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -275,21 +275,26 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(6, wxALIGN_CENTER); // 6 controls, because each AddChoice adds a wxStaticText and a wxChoice. { - m_pChoice_FromPitch = S.Id(ID_FromPitch).AddChoice(_("from"), pitch); - m_pChoice_FromPitch->SetName(_("from")); + m_pChoice_FromPitch = S.Id(ID_FromPitch) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("from")) + .AddChoice(_("from"), pitch); m_pChoice_FromPitch->SetSizeHints(80, -1); - m_pSpin_FromOctave = S.Id(ID_FromOctave).AddSpinCtrl( {}, m_nFromOctave, INT_MAX, INT_MIN); - m_pSpin_FromOctave->SetName(_("from Octave")); + m_pSpin_FromOctave = S.Id(ID_FromOctave) + .Name(XO("from Octave")) + .AddSpinCtrl( {}, m_nFromOctave, INT_MAX, INT_MIN); m_pSpin_FromOctave->SetSizeHints(50, -1); - m_pChoice_ToPitch = S.Id(ID_ToPitch).AddChoice(_("to"), pitch); - m_pChoice_ToPitch->SetName(_("to")); + m_pChoice_ToPitch = S.Id(ID_ToPitch) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("to")) + .AddChoice(_("to"), pitch); m_pChoice_ToPitch->SetSizeHints(80, -1); - m_pSpin_ToOctave = - S.Id(ID_ToOctave).AddSpinCtrl( {}, m_nToOctave, INT_MAX, INT_MIN); - m_pSpin_ToOctave->SetName(_("to Octave")); + m_pSpin_ToOctave = S.Id(ID_ToOctave) + .Name(XO("to Octave")) + .AddSpinCtrl( {}, m_nToOctave, INT_MAX, INT_MIN); m_pSpin_ToOctave->SetSizeHints(50, -1); } S.EndMultiColumn(); @@ -297,12 +302,12 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxALIGN_CENTER); { m_pTextCtrl_SemitonesChange = S.Id(ID_SemitonesChange) + .Name(XO("Semitones (half-steps)")) .Validator>( 2, &m_dSemitonesChange, NumValidatorStyle::TWO_TRAILING_ZEROES ) .AddTextBox(_("Semitones (half-steps):"), wxT(""), 12); - m_pTextCtrl_SemitonesChange->SetName(_("Semitones (half-steps)")); } S.EndHorizontalLay(); } @@ -313,22 +318,22 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(5, wxALIGN_CENTER); // 5, because AddTextBox adds a wxStaticText and a wxTextCtrl. { m_pTextCtrl_FromFrequency = S.Id(ID_FromFrequency) + .Name(XO("from (Hz)")) .Validator>( 3, &m_FromFrequency, NumValidatorStyle::THREE_TRAILING_ZEROES, 0.0 ) .AddTextBox(_("from"), wxT(""), 12); - m_pTextCtrl_FromFrequency->SetName(_("from (Hz)")); m_pTextCtrl_ToFrequency = S.Id(ID_ToFrequency) + .Name(XO("to (Hz)")) .Validator>( 3, &m_ToFrequency, NumValidatorStyle::THREE_TRAILING_ZEROES, 0.0 ) .AddTextBox(_("to"), wxT(""), 12); - m_pTextCtrl_ToFrequency->SetName(_("to (Hz)")); S.AddUnits(_("Hz")); } @@ -350,8 +355,8 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_PercentChange) + .Name(XO("Percent Change")) .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); - m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); } diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp index fc46a01b2..6c469cc5c 100644 --- a/src/effects/ChangeSpeed.cpp +++ b/src/effects/ChangeSpeed.cpp @@ -335,9 +335,9 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); - mpSlider_PercentChange = - S.Id(ID_PercentChange).AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); - mpSlider_PercentChange->SetName(_("Percent Change")); + mpSlider_PercentChange = S.Id(ID_PercentChange) + .Name(XO("Percent Change")) + .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); } S.EndHorizontalLay(); @@ -348,14 +348,15 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) S.AddUnits(_("Standard Vinyl rpm:")); mpChoice_FromVinyl = S.Id(ID_FromVinyl) + .Name(XO("From rpm")) /* i18n-hint: changing a quantity "from" one value "to" another */ .AddChoice(_("from"), vinylChoices); - mpChoice_FromVinyl->SetName(_("From rpm")); mpChoice_FromVinyl->SetSizeHints(100, -1); - mpChoice_ToVinyl = - S.Id(ID_ToVinyl).AddChoice(_("to"), vinylChoices); - mpChoice_ToVinyl->SetName(_("To rpm")); + mpChoice_ToVinyl = S.Id(ID_ToVinyl) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("To rpm")) + .AddChoice(_("to"), vinylChoices); mpChoice_ToVinyl->SetSizeHints(100, -1); } S.EndMultiColumn(); @@ -377,9 +378,10 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) .ReadOnly(true) .MenuEnabled(false)); - mpFromLengthCtrl->SetName(_("from")); - S.ToolTip(XO("Current length of selection.")). - AddWindow(mpFromLengthCtrl, wxALIGN_LEFT); + S.ToolTip(XO("Current length of selection.")) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("from")) + .AddWindow(mpFromLengthCtrl, wxALIGN_LEFT); S.AddPrompt(_("New Length:")); @@ -390,8 +392,9 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) mToLength, mProjectRate); - mpToLengthCtrl->SetName(_("to")); - S.AddWindow(mpToLengthCtrl, wxALIGN_LEFT); + /* i18n-hint: changing a quantity "from" one value "to" another */ + S.Name(XO("to")) + .AddWindow(mpToLengthCtrl, wxALIGN_LEFT); } S.EndMultiColumn(); } diff --git a/src/effects/ChangeTempo.cpp b/src/effects/ChangeTempo.cpp index 48ed2e39d..4019dfe12 100644 --- a/src/effects/ChangeTempo.cpp +++ b/src/effects/ChangeTempo.cpp @@ -246,8 +246,8 @@ void EffectChangeTempo::PopulateOrExchange(ShuttleGui & S) { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_PercentChange) + .Name(XO("Percent Change")) .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); - m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); @@ -256,22 +256,24 @@ void EffectChangeTempo::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxALIGN_CENTER); { m_pTextCtrl_FromBPM = S.Id(ID_FromBPM) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("Beats per minute, from")) .Validator>( 3, &m_FromBPM, NumValidatorStyle::THREE_TRAILING_ZEROES | NumValidatorStyle::ZERO_AS_BLANK) /* i18n-hint: changing a quantity "from" one value "to" another */ .AddTextBox(_("from"), wxT(""), 12); - m_pTextCtrl_FromBPM->SetName(_("Beats per minute, from")); m_pTextCtrl_ToBPM = S.Id(ID_ToBPM) + /* i18n-hint: changing a quantity "from" one value "to" another */ + .Name(XO("Beats per minute, to")) .Validator>( 3, &m_ToBPM, NumValidatorStyle::THREE_TRAILING_ZEROES | NumValidatorStyle::ZERO_AS_BLANK) /* i18n-hint: changing a quantity "from" one value "to" another */ .AddTextBox(_("to"), wxT(""), 12); - m_pTextCtrl_ToBPM->SetName(_("Beats per minute, to")); } S.EndHorizontalLay(); } diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index e9457353d..b8c15c348 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -349,9 +349,9 @@ void EffectClickRemoval::PopulateOrExchange(ShuttleGui & S) S.SetStyle(wxSL_HORIZONTAL); mThreshS = S.Id(ID_Thresh) + .Name(XO("Threshold")) .Validator(&mThresholdLevel) .AddSlider( {}, mThresholdLevel, MAX_Threshold, MIN_Threshold); - mThreshS->SetName(_("Threshold")); mThreshS->SetMinSize(wxSize(150, -1)); // Click width @@ -364,9 +364,9 @@ void EffectClickRemoval::PopulateOrExchange(ShuttleGui & S) S.SetStyle(wxSL_HORIZONTAL); mWidthS = S.Id(ID_Width) + .Name(XO("Max Spike Width")) .Validator(&mClickWidth) .AddSlider( {}, mClickWidth, MAX_Width, MIN_Width); - mWidthS->SetName(_("Max Spike Width")); mWidthS->SetMinSize(wxSize(150, -1)); } S.EndMultiColumn(); diff --git a/src/effects/Compressor.cpp b/src/effects/Compressor.cpp index 382d22b3b..0d11fcb70 100644 --- a/src/effects/Compressor.cpp +++ b/src/effects/Compressor.cpp @@ -227,33 +227,36 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) mThresholdLabel = S.AddVariableText(_("Threshold:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mThresholdSlider = S.Id(ID_Threshold).AddSlider( {}, - DEF_Threshold * SCL_Threshold, - MAX_Threshold * SCL_Threshold, - MIN_Threshold * SCL_Threshold); - mThresholdSlider->SetName(_("Threshold")); + mThresholdSlider = S.Id(ID_Threshold) + .Name(XO("Threshold")) + .AddSlider( {}, + DEF_Threshold * SCL_Threshold, + MAX_Threshold * SCL_Threshold, + MIN_Threshold * SCL_Threshold); mThresholdText = S.AddVariableText(wxT("XXX dB"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); mNoiseFloorLabel = S.AddVariableText(_("Noise Floor:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mNoiseFloorSlider = S.Id(ID_NoiseFloor).AddSlider( {}, - DEF_NoiseFloor / SCL_NoiseFloor, - MAX_NoiseFloor / SCL_NoiseFloor, - MIN_NoiseFloor / SCL_NoiseFloor); - mNoiseFloorSlider->SetName(_("Noise Floor")); + mNoiseFloorSlider = S.Id(ID_NoiseFloor) + .Name(XO("Noise Floor")) + .AddSlider( {}, + DEF_NoiseFloor / SCL_NoiseFloor, + MAX_NoiseFloor / SCL_NoiseFloor, + MIN_NoiseFloor / SCL_NoiseFloor); mNoiseFloorText = S.AddVariableText(wxT("XXX dB"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); mRatioLabel = S.AddVariableText(_("Ratio:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mRatioSlider = S.Id(ID_Ratio).AddSlider( {}, - DEF_Ratio * SCL_Ratio, - MAX_Ratio * SCL_Ratio, - MIN_Ratio * SCL_Ratio); - mRatioSlider->SetName(_("Ratio")); + mRatioSlider = S.Id(ID_Ratio) + .Name(XO("Ratio")) + .AddSlider( {}, + DEF_Ratio * SCL_Ratio, + MAX_Ratio * SCL_Ratio, + MIN_Ratio * SCL_Ratio); mRatioSlider->SetPageSize(5); mRatioText = S.AddVariableText(wxT("XXXX:1"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -264,22 +267,25 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) mAttackLabel = S.AddVariableText(_("Attack Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mAttackSlider = S.Id(ID_Attack).AddSlider( {}, - DEF_AttackTime * SCL_AttackTime, - MAX_AttackTime * SCL_AttackTime, - MIN_AttackTime * SCL_AttackTime); - mAttackSlider->SetName(_("Attack Time")); + mAttackSlider = S.Id(ID_Attack) + .Name(XO("Attack Time")) + .AddSlider( {}, + DEF_AttackTime * SCL_AttackTime, + MAX_AttackTime * SCL_AttackTime, + MIN_AttackTime * SCL_AttackTime); mAttackText = S.AddVariableText(wxT("XXXX secs"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); mDecayLabel = S.AddVariableText(_("Release Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mDecaySlider = S.Id(ID_Decay).AddSlider( {}, - DEF_ReleaseTime * SCL_ReleaseTime, - MAX_ReleaseTime * SCL_ReleaseTime, - MIN_ReleaseTime * SCL_ReleaseTime); - mDecaySlider->SetName(_("Release Time")); + mDecaySlider = S.Id(ID_Decay) + .Name(XO("Release Time")) + .AddSlider( {}, + DEF_ReleaseTime * SCL_ReleaseTime, + MAX_ReleaseTime * SCL_ReleaseTime, + MIN_ReleaseTime * SCL_ReleaseTime); + mDecayText = S.AddVariableText(wxT("XXXX secs"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 7c82caaf7..bb167d760 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -234,9 +234,9 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, 0.0, mProjectRate, options); - mForegroundStartT->SetName(_("Foreground start time")); } - S.AddWindow(mForegroundStartT); + S.Name(XO("Foreground start time")) + .AddWindow(mForegroundStartT); if (S.GetMode() == eIsCreating) { @@ -247,9 +247,9 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, 0.0, mProjectRate, options); - mForegroundEndT->SetName(_("Foreground end time")); } - S.AddWindow(mForegroundEndT); + S.Name(XO("Foreground end time")) + .AddWindow(mForegroundEndT); m_pButton_UseCurrentF = S.Id(ID_BUTTON_USECURRENTF).AddButton(_("&Measure selection")); mForegroundRMSText=S.Id(ID_FOREGROUNDDB_TEXT).AddTextBox( {}, wxT(""), 17); @@ -266,9 +266,9 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, 0.0, mProjectRate, options); - mBackgroundStartT->SetName(_("Background start time")); } - S.AddWindow(mBackgroundStartT); + S.Name(XO("Background start time")) + .AddWindow(mBackgroundStartT); if (S.GetMode() == eIsCreating) { @@ -279,9 +279,9 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, 0.0, mProjectRate, options); - mBackgroundEndT->SetName(_("Background end time")); } - S.AddWindow(mBackgroundEndT); + S.Name(XO("Background end time")) + .AddWindow(mBackgroundEndT); m_pButton_UseCurrentB = S.Id(ID_BUTTON_USECURRENTB).AddButton(_("Mea&sure selection")); mBackgroundRMSText = S.Id(ID_BACKGROUNDDB_TEXT).AddTextBox( {}, wxT(""), 17); @@ -296,17 +296,19 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, { S.StartMultiColumn(3, wxCENTER); { - wxString label = _("Co&ntrast Result:"); - S.AddFixedText(label); - mPassFailText = S.Id(ID_RESULTS_TEXT).AddTextBox( {}, wxT(""), 50); - mPassFailText->SetName(wxStripMenuCodes(label)); + auto label = XO("Co&ntrast Result:"); + S.AddFixedText(label.Translation()); + mPassFailText = S.Id(ID_RESULTS_TEXT) + .Name(label) + .AddTextBox( {}, wxT(""), 50); mPassFailText->Bind(wxEVT_KEY_DOWN, OnChar); m_pButton_Reset = S.Id(ID_BUTTON_RESET).AddButton(_("R&eset")); - label = _("&Difference:"); - S.AddFixedText(label); - mDiffText = S.Id(ID_RESULTSDB_TEXT).AddTextBox( {}, wxT(""), 50); - mDiffText->SetName(wxStripMenuCodes(label)); + label = XO("&Difference:"); + S.AddFixedText(label.Translation()); + mDiffText = S.Id(ID_RESULTSDB_TEXT) + .Name(label) + .AddTextBox( {}, wxT(""), 50); mDiffText->Bind(wxEVT_KEY_DOWN, OnChar); m_pButton_Export = S.Id(ID_BUTTON_EXPORT).AddButton(_("E&xport...")); } diff --git a/src/effects/Distortion.cpp b/src/effects/Distortion.cpp index 54c96aa51..425b9244e 100644 --- a/src/effects/Distortion.cpp +++ b/src/effects/Distortion.cpp @@ -129,7 +129,7 @@ FactoryPresets[] = { XO("Percussion Limiter"), {10, 0, -12.0, -70.0, 100.0, 30.0, 0 } }, }; -wxString defaultLabel(int index) +TranslatableString defaultLabelUntranslated(int index) { static const TranslatableString names[] = { XO("Upper Threshold"), @@ -139,18 +139,12 @@ wxString defaultLabel(int index) XO("Number of repeats"), }; - class NamesArray final : public TranslatableStringArray - { - void Populate() override - { - for (auto &name : names) - mContents.push_back( name.Translation() ); - } - }; + return names[ index ]; +} - static NamesArray theArray; - - return theArray.Get()[ index ]; +wxString defaultLabel(int index) +{ + return defaultLabelUntranslated(index).Translation(); } // @@ -396,33 +390,34 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) // Upper threshold control mThresholdTxt = S.AddVariableText(defaultLabel(0), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mThresholdT = S.Id(ID_Threshold) + .Name(defaultLabelUntranslated(0)) .Validator>( 2, &mParams.mThreshold_dB, NumValidatorStyle::DEFAULT, MIN_Threshold_dB, MAX_Threshold_dB) .AddTextBox( {}, wxT(""), 10); - mThresholdT->SetName(defaultLabel(0)); S.SetStyle(wxSL_HORIZONTAL); mThresholdS = S.Id(ID_Threshold) + .Name(defaultLabelUntranslated(0)) .AddSlider( {}, 0, DB_TO_LINEAR(MAX_Threshold_dB) * SCL_Threshold_dB, DB_TO_LINEAR(MIN_Threshold_dB) * SCL_Threshold_dB); - mThresholdS->SetName(defaultLabel(0)); S.AddSpace(20, 0); // Noise floor control mNoiseFloorTxt = S.AddVariableText(defaultLabel(1), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mNoiseFloorT = S.Id(ID_NoiseFloor) + .Name(defaultLabelUntranslated(1)) .Validator>( 2, &mParams.mNoiseFloor, NumValidatorStyle::DEFAULT, MIN_NoiseFloor, MAX_NoiseFloor ) .AddTextBox( {}, wxT(""), 10); - mNoiseFloorT->SetName(defaultLabel(1)); S.SetStyle(wxSL_HORIZONTAL); - mNoiseFloorS = S.Id(ID_NoiseFloor).AddSlider( {}, 0, MAX_NoiseFloor, MIN_NoiseFloor); - mNoiseFloorS->SetName(defaultLabel(1)); + mNoiseFloorS = S.Id(ID_NoiseFloor) + .Name(defaultLabelUntranslated(1)) + .AddSlider( {}, 0, MAX_NoiseFloor, MIN_NoiseFloor); S.AddSpace(20, 0); } S.EndMultiColumn(); @@ -440,46 +435,49 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) // Parameter1 control mParam1Txt = S.AddVariableText(defaultLabel(2), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mParam1T = S.Id(ID_Param1) + .Name(defaultLabelUntranslated(2)) .Validator>( 2, &mParams.mParam1, NumValidatorStyle::DEFAULT, MIN_Param1, MAX_Param1 ) .AddTextBox( {}, wxT(""), 10); - mParam1T->SetName(defaultLabel(2)); S.SetStyle(wxSL_HORIZONTAL); - mParam1S = S.Id(ID_Param1).AddSlider( {}, 0, MAX_Param1, MIN_Param1); - mParam1S->SetName(defaultLabel(2)); + mParam1S = S.Id(ID_Param1) + .Name(defaultLabelUntranslated(2)) + .AddSlider( {}, 0, MAX_Param1, MIN_Param1); S.AddSpace(20, 0); // Parameter2 control mParam2Txt = S.AddVariableText(defaultLabel(3), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mParam2T = S.Id(ID_Param2) + .Name(defaultLabelUntranslated(3)) .Validator>( 2, &mParams.mParam2, NumValidatorStyle::DEFAULT, MIN_Param2, MAX_Param2 ) .AddTextBox( {}, wxT(""), 10); - mParam2T->SetName(defaultLabel(3)); S.SetStyle(wxSL_HORIZONTAL); - mParam2S = S.Id(ID_Param2).AddSlider( {}, 0, MAX_Param2, MIN_Param2); - mParam2S->SetName(defaultLabel(3)); + mParam2S = S.Id(ID_Param2) + .Name(defaultLabelUntranslated(3)) + .AddSlider( {}, 0, MAX_Param2, MIN_Param2); S.AddSpace(20, 0); // Repeats control mRepeatsTxt = S.AddVariableText(defaultLabel(4), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mRepeatsT = S.Id(ID_Repeats) + .Name(defaultLabelUntranslated(4)) .Validator>( &mParams.mRepeats, NumValidatorStyle::DEFAULT, MIN_Repeats, MAX_Repeats ) .AddTextBox( {}, wxT(""), 10); - mRepeatsT->SetName(defaultLabel(4)); S.SetStyle(wxSL_HORIZONTAL); - mRepeatsS = S.Id(ID_Repeats).AddSlider( {}, DEF_Repeats, MAX_Repeats, MIN_Repeats); - mRepeatsS->SetName(defaultLabel(4)); + mRepeatsS = S.Id(ID_Repeats) + .Name(defaultLabelUntranslated(4)) + .AddSlider( {}, DEF_Repeats, MAX_Repeats, MIN_Repeats); S.AddSpace(20, 0); } S.EndMultiColumn(); diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index 8f420361f..7e62806b8 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -349,8 +349,8 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S) mProjectRate, NumericTextCtrl::Options{} .AutoPos(true)); - mDtmfDurationT->SetName(_("Duration")); - S.AddWindow(mDtmfDurationT); + S.Name(XO("Duration")) + .AddWindow(mDtmfDurationT); S.AddFixedText(_("Tone/silence ratio:"), false); S.SetStyle(wxSL_HORIZONTAL | wxEXPAND); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 0acb03a16..9b79f8023 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -797,17 +797,19 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { S.AddVariableText(_("+ dB"), false, wxCENTER); S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); - mdBMaxSlider = S.Id(ID_dBMax).AddSlider( {}, 30, 60, 0); + mdBMaxSlider = S.Id(ID_dBMax) + .Name(XO("Max dB")) + .AddSlider( {}, 30, 60, 0); #if wxUSE_ACCESSIBILITY - mdBMaxSlider->SetName(_("Max dB")); mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB"))); #endif S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); - mdBMinSlider = S.Id(ID_dBMin).AddSlider( {}, -30, -10, -120); + mdBMinSlider = S.Id(ID_dBMin) + .Name(XO("Min dB")) + .AddSlider( {}, -30, -10, -120); S.AddVariableText(_("- dB"), false, wxCENTER); #if wxUSE_ACCESSIBILITY - mdBMinSlider->SetName(_("Min dB")); mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, _("%d dB"))); #endif } @@ -866,18 +868,18 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) // ignore it [](wxEvent&){}); #if wxUSE_ACCESSIBILITY - wxString name; - if( kThirdOct[i] < 1000.) - name.Printf(_("%d Hz"), (int)kThirdOct[i]); - else - name.Printf(_("%g kHz"), kThirdOct[i]/1000.); - mSliders[i]->SetName(name); mSliders[i]->SetAccessible(safenew SliderAx(mSliders[i], _("%d dB"))); #endif mSlidersOld[i] = 0; mEQVals[i] = 0.; //S.SetSizerProportion(1); - S.Prop(1).AddWindow( mSliders[i], wxEXPAND ); + S.Prop(1) + .Name( TranslatableString{ + kThirdOct[i] < 1000. + ? wxString::Format(_("%d Hz"), (int)kThirdOct[i]) + : wxString::Format(_("%g kHz"), kThirdOct[i]/1000.) + } ) + .AddWindow( mSliders[i], wxEXPAND ); } S.AddSpace(15,0); } @@ -905,11 +907,13 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 1); { - mDraw = S.Id(ID_Draw).AddRadioButton(_("&Draw")); - mDraw->SetName(_("Draw Curves")); + mDraw = S.Id(ID_Draw) + .Name(XO("Draw Curves")) + .AddRadioButton(_("&Draw")); - mGraphic = S.Id(ID_Graphic).AddRadioButtonToGroup(_("&Graphic")); - mGraphic->SetName(_("Graphic EQ")); + mGraphic = S.Id(ID_Graphic) + .Name(XO("Graphic EQ")) + .AddRadioButtonToGroup(_("&Graphic")); } S.EndHorizontalLay(); } @@ -925,13 +929,13 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) szrI = S.GetSizer(); mInterpChoice = S.Id(ID_Interp) + .Name(XO("Interpolation type")) .AddChoice( {}, LocalizedStrings(kInterpStrings, nInterpolations), 0 ); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control mInterpChoice->SetAccessible(safenew WindowAccessible(mInterpChoice)); #endif - mInterpChoice->SetName(_("Interpolation type")); } S.EndHorizontalLay(); @@ -939,8 +943,9 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { szrL = S.GetSizer(); - mLinFreq = S.Id(ID_Linear).AddCheckBox(_("Li&near Frequency Scale"), false); - mLinFreq->SetName(_("Linear Frequency Scale")); + mLinFreq = S.Id(ID_Linear) + .Name(XO("Linear Frequency Scale")) + .AddCheckBox(_("Li&near Frequency Scale"), false); } S.EndHorizontalLay(); } @@ -962,8 +967,9 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND, 1); { S.SetStyle(wxSL_HORIZONTAL); - mMSlider = S.Id(ID_Length).AddSlider( {}, (mM - 1) / 2, 4095, 10); - mMSlider->SetName(_("Length of Filter")); + mMSlider = S.Id(ID_Length) + .Name(XO("Length of Filter")) + .AddSlider( {}, (mM - 1) / 2, 4095, 10); } S.EndHorizontalLay(); @@ -971,8 +977,10 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { wxString label; label.Printf(wxT("%ld"), mM); - mMText = S.AddVariableText(label); - mMText->SetName(label); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) + mMText = S.Name( TranslatableString{ label } ) + // fix for bug 577 (NVDA/Narrator screen readers do not + // read static text in dialogs) + .AddVariableText(label); } S.EndHorizontalLay(); } @@ -996,6 +1004,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 1); { mCurve = S.Id(ID_Curve) + .Name(XO("Select Curve")) .AddChoice( {}, [this]{ wxArrayStringEx curves; @@ -1004,7 +1013,6 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) return curves; }() ); - mCurve->SetName(_("Select Curve")); } S.EndHorizontalLay(); } @@ -1018,8 +1026,9 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.Id(ID_Clear).AddButton(_("Fla&tten")); S.Id(ID_Invert).AddButton(_("&Invert")); - mGridOnOff = S.Id(ID_Grid).AddCheckBox(_("Show g&rid lines"), false); - mGridOnOff->SetName(_("Show grid lines")); + mGridOnOff = S.Id(ID_Grid) + .Name(XO("Show grid lines")) + .AddCheckBox(_("Show g&rid lines"), false); } S.EndHorizontalLay(); diff --git a/src/effects/Loudness.cpp b/src/effects/Loudness.cpp index 22f361a40..3a0201998 100644 --- a/src/effects/Loudness.cpp +++ b/src/effects/Loudness.cpp @@ -296,6 +296,8 @@ void EffectLoudness::PopulateOrExchange(ShuttleGui & S) wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mLevelTextCtrl = S + /* i18n-hint: LUFS is a particular method for measuring loudnesss */ + .Name( XO("Loudness LUFS") ) .Validator>( 2, &mLUFSLevel, NumValidatorStyle::ONE_TRAILING_ZERO, @@ -303,8 +305,6 @@ void EffectLoudness::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox( {}, wxT(""), 10); /* i18n-hint: LUFS is a particular method for measuring loudnesss */ - mLevelTextCtrl->SetName( _("Loudness LUFS")); - /* i18n-hint: LUFS is a particular method for measuring loudnesss */ mLeveldB = S.AddVariableText(_("LUFS"), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mWarning = S.AddVariableText( {}, false, diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp index 03ab3841b..a4e6c4b8d 100644 --- a/src/effects/Noise.cpp +++ b/src/effects/Noise.cpp @@ -242,8 +242,8 @@ void EffectNoise::PopulateOrExchange(ShuttleGui & S) mProjectRate, NumericTextCtrl::Options{} .AutoPos(true)); - mNoiseDurationT->SetName(_("Duration")); - S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL); + S.Name(XO("Duration")) + .AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL); } S.EndMultiColumn(); } diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index ce23e126c..5e4975302 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1439,8 +1439,8 @@ struct ControlInfo { S.SetStyle(wxSL_HORIZONTAL); wxSlider *const slider = S.Id(id) + .Name( sliderName ) .AddSlider( {}, 0, sliderMax); - slider->SetName(sliderName.Translation()); slider->SetSizeHints(150, -1); } diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index c7d58db2f..fb10aebb6 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -722,8 +722,8 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Noise re&duction (dB):"), wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); mGainS = S.Id(ID_GAIN_SLIDER) + .Name(XO("Noise reduction")) .AddSlider(wxT(""), 0, GAIN_MAX, GAIN_MIN); - mGainS->SetName(_("Noise reduction")); mGainS->SetSizeHints(150, -1); mSensitivityT = S.Id(ID_SENSITIVITY_TEXT) @@ -731,8 +731,8 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Sensitivity (dB):"), wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); mSensitivityS = S.Id(ID_SENSITIVITY_SLIDER) + .Name(XO("Sensitivity")) .AddSlider(wxT(""), 0, SENSITIVITY_MAX, SENSITIVITY_MIN); - mSensitivityS->SetName(_("Sensitivity")); mSensitivityS->SetSizeHints(150, -1); mFreqT = S.Id(ID_FREQ_TEXT) @@ -740,8 +740,8 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Fr&equency smoothing (Hz):"), wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); mFreqS = S.Id(ID_FREQ_SLIDER) + .Name(XO("Frequency smoothing")) .AddSlider(wxT(""), 0, FREQ_MAX, FREQ_MIN); - mFreqS->SetName(_("Frequency smoothing")); mFreqS->SetSizeHints(150, -1); mTimeT = S.Id(ID_TIME_TEXT) @@ -749,8 +749,8 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Attac&k/decay time (secs):"), wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); mTimeS = S.Id(ID_TIME_SLIDER) + .Name(XO("Attack/decay time")) .AddSlider(wxT(""), 0, TIME_MAX, TIME_MIN); - mTimeS->SetName(_("Attack/decay time")); mTimeS->SetSizeHints(150, -1); S.AddPrompt(_("Noise:")); diff --git a/src/effects/Normalize.cpp b/src/effects/Normalize.cpp index b519e9530..b15a21f0c 100644 --- a/src/effects/Normalize.cpp +++ b/src/effects/Normalize.cpp @@ -306,6 +306,7 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S) mGainCheckBox->SetMinSize( mGainCheckBox->GetSize()); mLevelTextCtrl = S + .Name(XO("Peak amplitude dB")) .Validator>( 2, &mPeakLevel, @@ -314,7 +315,6 @@ void EffectNormalize::PopulateOrExchange(ShuttleGui & S) MAX_PeakLevel ) .AddTextBox( {}, wxT(""), 10); - mLevelTextCtrl->SetName(_("Peak amplitude dB")); mLeveldB = S.AddVariableText(_("dB"), false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); mWarning = S.AddVariableText( {}, false, diff --git a/src/effects/Phaser.cpp b/src/effects/Phaser.cpp index ef0a2f5b7..fde9e3a58 100644 --- a/src/effects/Phaser.cpp +++ b/src/effects/Phaser.cpp @@ -262,8 +262,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Stages:"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mStagesS = S.Id(ID_Stages).AddSlider( {}, DEF_Stages * SCL_Stages, MAX_Stages * SCL_Stages, MIN_Stages * SCL_Stages); - mStagesS->SetName(_("Stages")); + mStagesS = S.Id(ID_Stages) + .Name(XO("Stages")) + .AddSlider( {}, DEF_Stages * SCL_Stages, MAX_Stages * SCL_Stages, MIN_Stages * SCL_Stages); mStagesS->SetLineSize(2); mStagesS->SetMinSize(wxSize(100, -1)); @@ -273,8 +274,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Dry/Wet:"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mDryWetS = S.Id(ID_DryWet).AddSlider( {}, DEF_DryWet * SCL_DryWet, MAX_DryWet * SCL_DryWet, MIN_DryWet * SCL_DryWet); - mDryWetS->SetName(_("Dry Wet")); + mDryWetS = S.Id(ID_DryWet) + .Name(XO("Dry Wet")) + .AddSlider( {}, DEF_DryWet * SCL_DryWet, MAX_DryWet * SCL_DryWet, MIN_DryWet * SCL_DryWet); mDryWetS->SetMinSize(wxSize(100, -1)); mFreqT = S.Id(ID_Freq) @@ -283,8 +285,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("LFO Freq&uency (Hz):"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mFreqS = S.Id(ID_Freq).AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, 0.0); - mFreqS ->SetName(_("LFO frequency in hertz")); + mFreqS = S.Id(ID_Freq) + .Name(XO("LFO frequency in hertz")) + .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, 0.0); mFreqS ->SetMinSize(wxSize(100, -1)); mPhaseT = S.Id(ID_Phase) @@ -293,8 +296,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("LFO Sta&rt Phase (deg.):"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mPhaseS = S.Id(ID_Phase).AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); - mPhaseS->SetName(_("LFO start phase in degrees")); + mPhaseS = S.Id(ID_Phase) + .Name(XO("LFO start phase in degrees")) + .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); mPhaseS->SetLineSize(10); mPhaseS->SetMinSize(wxSize(100, -1)); @@ -304,8 +308,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Dept&h:"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mDepthS = S.Id(ID_Depth).AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); - mDepthS->SetName(_("Depth in percent")); + mDepthS = S.Id(ID_Depth) + .Name(XO("Depth in percent")) + .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); mDepthS->SetMinSize(wxSize(100, -1)); mFeedbackT = S.Id(ID_Feedback) @@ -314,8 +319,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Feedbac&k (%):"), wxT(""), 15); S.SetStyle(wxSL_HORIZONTAL); - mFeedbackS = S.Id(ID_Feedback).AddSlider( {}, DEF_Feedback * SCL_Feedback, MAX_Feedback * SCL_Feedback, MIN_Feedback * SCL_Feedback); - mFeedbackS->SetName(_("Feedback in percent")); + mFeedbackS = S.Id(ID_Feedback) + .Name(XO("Feedback in percent")) + .AddSlider( {}, DEF_Feedback * SCL_Feedback, MAX_Feedback * SCL_Feedback, MIN_Feedback * SCL_Feedback); mFeedbackS->SetLineSize(10); mFeedbackS->SetMinSize(wxSize(100, -1)); @@ -325,8 +331,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Output gain (dB):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mOutGainS = S.Id(ID_OutGain).AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); - mOutGainS->SetName(_("Output gain (dB)")); + mOutGainS = S.Id(ID_OutGain) + .Name(XO("Output gain (dB)")) + .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); mOutGainS->SetMinSize(wxSize(100, -1)); } S.EndMultiColumn(); diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp index 24d2b7758..65bb23b71 100644 --- a/src/effects/ScienFilter.cpp +++ b/src/effects/ScienFilter.cpp @@ -406,19 +406,22 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) { S.AddVariableText(_("+ dB"), false, wxCENTER); S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); - mdBMaxSlider = S.Id(ID_dBMax).AddSlider( {}, 10, 20, 0); + mdBMaxSlider = S.Id(ID_dBMax) + .Name(XO("Max dB")) + .AddSlider( {}, 10, 20, 0); #if wxUSE_ACCESSIBILITY - mdBMaxSlider->SetName(_("Max dB")); mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB"))); #endif S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); - mdBMinSlider = S.Id(ID_dBMin).AddSlider( {}, -10, -10, -120); - S.AddVariableText(_("- dB"), false, wxCENTER); + mdBMinSlider = S.Id(ID_dBMin) + .Name(XO("Min dB")) + .AddSlider( {}, -10, -10, -120); #if wxUSE_ACCESSIBILITY - mdBMinSlider->SetName(_("Min dB")); mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, _("%d dB"))); #endif + + S.AddVariableText(_("- dB"), false, wxCENTER); } S.EndVerticalLay(); @@ -478,11 +481,11 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) mRippleCtlP = S.AddVariableText(_("&Passband Ripple:"), false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); mRippleCtl = S.Id(ID_Ripple) + .Name(XO("Passband Ripple (dB)")) .Validator>( 1, &mRipple, NumValidatorStyle::DEFAULT, MIN_Passband, MAX_Passband) .AddTextBox( {}, wxT(""), 10); - mRippleCtl->SetName(_("Passband Ripple (dB)")); mRippleCtlU = S.AddVariableText(_("dB"), false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); mFilterSubTypeCtl = S.Id(ID_SubType) @@ -493,20 +496,20 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) S.SetSizeHints(-1, -1); mCutoffCtl = S.Id(ID_Cutoff) + .Name(XO("Cutoff (Hz)")) .Validator>( 1, &mCutoff, NumValidatorStyle::DEFAULT, MIN_Cutoff, mNyquist - 1) .AddTextBox(_("C&utoff:"), wxT(""), 10); - mCutoffCtl->SetName(_("Cutoff (Hz)")); S.AddUnits(_("Hz")); mStopbandRippleCtlP = S.AddVariableText(_("Minimum S&topband Attenuation:"), false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); mStopbandRippleCtl = S.Id(ID_StopbandRipple) + .Name(XO("Minimum S&topband Attenuation (dB)")) .Validator>( 1, &mStopbandRipple, NumValidatorStyle::DEFAULT, MIN_Stopband, MAX_Stopband) .AddTextBox( {}, wxT(""), 10); - mStopbandRippleCtl->SetName(_("Minimum S&topband Attenuation (dB)")); mStopbandRippleCtlU = S.AddVariableText(_("dB"), false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } S.EndMultiColumn(); diff --git a/src/effects/ScoreAlignDialog.cpp b/src/effects/ScoreAlignDialog.cpp index 81672426a..f720fc4b0 100644 --- a/src/effects/ScoreAlignDialog.cpp +++ b/src/effects/ScoreAlignDialog.cpp @@ -99,40 +99,44 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mFramePeriodLabel = S.AddVariableText(_("Frame Period:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mFramePeriodSlider = S.Id(ID_FRAMEPERIOD).AddSlider(wxT(""), + mFramePeriodSlider = S.Id(ID_FRAMEPERIOD) + .Name(XO("Frame Period")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mFramePeriod * 100 + 0.5), /*max*/ 50, /*min*/ 5); S.SetSizeHints(300, -1); - mFramePeriodSlider->SetName(_("Frame Period")); mFramePeriodText = S.AddVariableText(SA_DFT_FRAME_PERIOD_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); mWindowSizeLabel = S.AddVariableText(_("Window Size:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mWindowSizeSlider = S.Id(ID_WINDOWSIZE).AddSlider(wxT(""), + mWindowSizeSlider = S.Id(ID_WINDOWSIZE) + .Name(XO("Window Size")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mWindowSize * 100 + 0.5), /*max*/ 100, /*min*/ 5); - mWindowSizeSlider->SetName(_("Window Size")); mWindowSizeText = S.AddVariableText(SA_DFT_WINDOW_SIZE_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); - mForceFinalAlignmentCheckBox = S.Id(ID_FORCEFINALALIGNMENT).AddCheckBox( + mForceFinalAlignmentCheckBox = S.Id(ID_FORCEFINALALIGNMENT) + .Name(XO("Force Final Alignment")) + .AddCheckBox( wxT("Force Final Alignment"), p.mForceFinalAlignment); - mForceFinalAlignmentCheckBox->SetName(_("Force Final Alignment")); - mIgnoreSilenceCheckBox = S.Id(ID_IGNORESILENCE).AddCheckBox( - wxT("Ignore Silence at Beginnings and Endings"), - p.mIgnoreSilence); - mIgnoreSilenceCheckBox->SetName( - _("Ignore Silence at Beginnings and Endings")); + mIgnoreSilenceCheckBox = S.Id(ID_IGNORESILENCE) + .Name(XO("Ignore Silence at Beginnings and Endings")) + .AddCheckBox( + wxT("Ignore Silence at Beginnings and Endings"), + p.mIgnoreSilence ); // need a third column after checkboxes: S.AddVariableText(wxT(""), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); mSilenceThresholdLabel = S.AddVariableText(_("Silence Threshold:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mSilenceThresholdSlider = S.Id(ID_SILENCETHRESHOLD).AddSlider(wxT(""), + mSilenceThresholdSlider = S.Id(ID_SILENCETHRESHOLD) + .Name(XO("Silence Threshold")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mSilenceThreshold * 1000 + 0.5), /*max*/ 500); - mSilenceThresholdSlider->SetName(_("Silence Threshold")); mSilenceThresholdText = S.AddVariableText(SA_DFT_SILENCE_THRESHOLD_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -143,9 +147,10 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mPresmoothLabel = S.AddVariableText(_("Presmooth Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mPresmoothSlider = S.Id(ID_PRESMOOTH).AddSlider(wxT(""), + mPresmoothSlider = S.Id(ID_PRESMOOTH) + .Name(XO("Presmooth Time")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mPresmoothTime * 100 + 0.5), /*max*/ 500); - mPresmoothSlider->SetName(_("Presmooth Time")); mPresmoothText = S.AddVariableText(SA_DFT_PRESMOOTH_TIME_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -156,9 +161,10 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mLineTimeLabel = S.AddVariableText(_("Line Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mLineTimeSlider = S.Id(ID_LINETIME).AddSlider(wxT(""), + mLineTimeSlider = S.Id(ID_LINETIME) + .Name(XO("Line Time")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mLineTime * 100 + 0.5), /*max*/ 500); - mLineTimeSlider->SetName(_("Line Time")); mLineTimeText = S.AddVariableText(SA_DFT_LINE_TIME_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -169,9 +175,10 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mSmoothTimeLabel = S.AddVariableText(_("Smooth Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); - mSmoothTimeSlider = S.Id(ID_SMOOTHTIME).AddSlider(wxT(""), + mSmoothTimeSlider = S.Id(ID_SMOOTHTIME) + .Name(XO("Smooth Time")) + .AddSlider(wxT(""), /*pos*/ (int) (p.mSmoothTime * 100 + 0.5), /*max*/ 500); - mSmoothTimeSlider->SetName(_("Smooth Time")); mSmoothTimeText = S.AddVariableText(SA_DFT_SMOOTH_TIME_TEXT, true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); diff --git a/src/effects/Silence.cpp b/src/effects/Silence.cpp index 3617bea72..b2f262c0c 100644 --- a/src/effects/Silence.cpp +++ b/src/effects/Silence.cpp @@ -73,8 +73,8 @@ void EffectSilence::PopulateOrExchange(ShuttleGui & S) mProjectRate, NumericTextCtrl::Options{} .AutoPos(true)); - mDurationT->SetName(_("Duration")); - S.AddWindow(mDurationT, wxALIGN_CENTER | wxALL); + S.Name(XO("Duration")) + .AddWindow(mDurationT, wxALIGN_CENTER | wxALL); } S.EndHorizontalLay(); } diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index 31d2d2dfc..176d611a5 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -368,7 +368,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxLEFT, 50); { - t = S + t = S.Name(XO("Frequency Hertz Start")) .Validator>( 6, &mFrequency[0], NumValidatorStyle::NO_TRAILING_ZEROES, @@ -376,13 +376,12 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) ProjectSettings::Get( *GetActiveProject() ).GetRate() / 2.0 ) .AddTextBox( {}, wxT(""), 12); - t->SetName(_("Frequency Hertz Start")); } S.EndHorizontalLay(); S.StartHorizontalLay(wxLEFT, 50); { - t = S + t = S.Name(XO("Frequency Hertz End")) .Validator>( 6, &mFrequency[1], NumValidatorStyle::NO_TRAILING_ZEROES, @@ -390,7 +389,6 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) ProjectSettings::Get( *GetActiveProject() ).GetRate() / 2.0 ) .AddTextBox( {}, wxT(""), 12); - t->SetName(_("Frequency Hertz End")); } S.EndHorizontalLay(); } @@ -401,25 +399,23 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxLEFT, 50); { - t = S + t = S.Name(XO("Amplitude Start")) .Validator>( 6, &mAmplitude[0], NumValidatorStyle::NO_TRAILING_ZEROES, MIN_StartAmp, MAX_StartAmp ) .AddTextBox( {}, wxT(""), 12); - t->SetName(_("Amplitude Start")); } S.EndHorizontalLay(); S.StartHorizontalLay(wxLEFT, 50); { - t = S + t = S.Name(XO("Amplitude End")) .Validator>( 6, &mAmplitude[1], NumValidatorStyle::NO_TRAILING_ZEROES, MIN_EndAmp, MAX_EndAmp ) .AddTextBox( {}, wxT(""), 12); - t->SetName(_("Amplitude End")); } S.EndHorizontalLay(); } @@ -454,8 +450,8 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) mProjectRate, NumericTextCtrl::Options{} .AutoPos(true)); - mToneDurationT->SetName(_("Duration")); - S.AddWindow(mToneDurationT, wxALIGN_LEFT | wxALL); + S.Name(XO("Duration")) + .AddWindow(mToneDurationT, wxALIGN_LEFT | wxALL); } S.EndMultiColumn(); diff --git a/src/effects/Wahwah.cpp b/src/effects/Wahwah.cpp index d76700848..1f0083ebe 100644 --- a/src/effects/Wahwah.cpp +++ b/src/effects/Wahwah.cpp @@ -245,8 +245,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) 5, &mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, MIN_Freq, MAX_Freq) .AddTextBox(_("LFO Freq&uency (Hz):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mFreqS = S.Id(ID_Freq).AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq); - mFreqS->SetName(_("LFO frequency in hertz")); + mFreqS = S.Id(ID_Freq) + .Name(XO("LFO frequency in hertz")) + .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq); mFreqS->SetMinSize(wxSize(100, -1)); mPhaseT = S.Id(ID_Phase) @@ -255,8 +256,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("LFO Sta&rt Phase (deg.):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mPhaseS = S.Id(ID_Phase).AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); - mPhaseS->SetName(_("LFO start phase in degrees")); + mPhaseS = S.Id(ID_Phase) + .Name(XO("LFO start phase in degrees")) + .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); mPhaseS->SetLineSize(10); mPhaseS->SetMinSize(wxSize(100, -1)); @@ -266,8 +268,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Dept&h (%):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mDepthS = S.Id(ID_Depth).AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); - mDepthS->SetName(_("Depth in percent")); + mDepthS = S.Id(ID_Depth) + .Name(XO("Depth in percent")) + .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); mDepthS->SetMinSize(wxSize(100, -1)); mResT = S.Id(ID_Res) @@ -276,8 +279,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Reso&nance:"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mResS = S.Id(ID_Res).AddSlider( {}, DEF_Res * SCL_Res, MAX_Res * SCL_Res, MIN_Res * SCL_Res); - mResS->SetName(_("Resonance")); + mResS = S.Id(ID_Res) + .Name(XO("Resonance")) + .AddSlider( {}, DEF_Res * SCL_Res, MAX_Res * SCL_Res, MIN_Res * SCL_Res); mResS->SetMinSize(wxSize(100, -1)); mFreqOfsT = S.Id(ID_FreqOfs) @@ -286,8 +290,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("Wah Frequency Offse&t (%):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mFreqOfsS = S.Id(ID_FreqOfs).AddSlider( {}, DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs); - mFreqOfsT->SetName(_("Wah frequency offset in percent")); + mFreqOfsS = S.Id(ID_FreqOfs) + .Name(XO("Wah frequency offset in percent")) + .AddSlider( {}, DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs); mFreqOfsT->SetMinSize(wxSize(100, -1)); mOutGainT = S.Id(ID_OutGain) @@ -296,8 +301,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .AddTextBox(_("&Output gain (dB):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); - mOutGainS = S.Id(ID_OutGain).AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); - mOutGainS->SetName(_("Output gain (dB)")); + mOutGainS = S.Id(ID_OutGain) + .Name(XO("Output gain (dB)")) + .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); mOutGainS->SetMinSize(wxSize(100, -1)); } S.EndMultiColumn(); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 9d363e9d7..12d1744a9 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2637,8 +2637,8 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) auto item = S.Id(ID_Text + i) .Validator(&ctrl.valStr) + .Name( TranslatableString{ prompt } ) .AddTextBox( {}, wxT(""), 12); - item->SetName(prompt); } else if (ctrl.type == NYQ_CTRL_CHOICE) { @@ -2663,8 +2663,9 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) ctrl.val, mProjectRate, options); - time->SetName(prompt); - S.AddWindow(time, wxALIGN_LEFT | wxALL); + S + .Name( TranslatableString{ prompt } ) + .AddWindow(time, wxALIGN_LEFT | wxALL); } else if (ctrl.type == NYQ_CTRL_FILE) { @@ -2686,9 +2687,10 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) } resolveFilePath(ctrl.valStr, defaultExtension); - wxTextCtrl *item = S.Id(ID_Text+i).AddTextBox( {}, wxT(""), 40); + wxTextCtrl *item = S.Id(ID_Text+i) + .Name( TranslatableString{ prompt } ) + .AddTextBox( {}, wxT(""), 40); item->SetValidator(wxGenericValidator(&ctrl.valStr)); - item->SetName(prompt); if (ctrl.label.empty()) // We'd expect wxFileSelectorPromptStr to already be translated, but apparently not. @@ -2725,10 +2727,11 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) &ctrl.val, NumValidatorStyle::DEFAULT, (int) ctrl.low, (int) ctrl.high); } - wxTextCtrl *item = S.AddTextBox( {}, wxT(""), - (ctrl.type == NYQ_CTRL_INT_TEXT || - ctrl.type == NYQ_CTRL_FLOAT_TEXT) ? 25 : 12); - item->SetName(prompt); + wxTextCtrl *item = S + .Name( TranslatableString{ prompt } ) + .AddTextBox( {}, wxT(""), + (ctrl.type == NYQ_CTRL_INT_TEXT || + ctrl.type == NYQ_CTRL_FLOAT_TEXT) ? 25 : 12); if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_FLOAT) { diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 315aab03a..b2e01d3f6 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -561,7 +561,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) S.AddPrompt(_("Program")); S.Id(ID_Program); - mProgram = S + mProgram = S.Name(XO("Program")) .AddChoice( {}, [&]{ wxArrayStringEx choices; @@ -571,7 +571,6 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) }(), wxString::FromUTF8(mPlugin->getCurrentProgram().c_str()) ); - mProgram->SetName(_("Program")); mProgram->SetSizeHints(-1, -1); wxSizer *s = mProgram->GetContainingSizer(); s->GetItem(mProgram)->SetFlag(wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL); @@ -608,9 +607,9 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) { S.Id(ID_Toggles + p); mToggles[p] = S.ToolTip( TranslatableString{ tip } ) + .Name( TranslatableString{ labelText } ) .AddCheckBox( {}, value > 0.5 ); - mToggles[p]->SetName(labelText); wxSizer *s = mToggles[p]->GetContainingSizer(); s->GetItem(mToggles[p])->SetFlag(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL); @@ -638,8 +637,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) S.Id(ID_Choices + p); mChoices[p] = S.ToolTip( TranslatableString{ tip } ) + .Name( TranslatableString{ labelText } ) .AddChoice( {}, choices, selected ); - mChoices[p]->SetName(labelText); mChoices[p]->SetSizeHints(-1, -1); wxSizer *s = mChoices[p]->GetContainingSizer(); s->GetItem(mChoices[p])->SetFlag(wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL); @@ -656,6 +655,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) S.Id(ID_Texts + p); mFields[p] = S.ToolTip( TranslatableString{ tip } ) + .Name( TranslatableString{ labelText } ) .Validator>( 6, &mValues[p], (range < 10 @@ -665,7 +665,6 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) : NumValidatorStyle::ONE_TRAILING_ZERO), mParameters[p].minValue, mParameters[p].maxValue) .AddTextBox( {}, wxT(""), 12); - mFields[p]->SetName(labelText); wxSizer *s = mFields[p]->GetContainingSizer(); s->GetItem(mFields[p])->SetFlag(wxALIGN_CENTER_VERTICAL | wxALL); @@ -675,8 +674,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) S.SetStyle(wxSL_HORIZONTAL); S.Id(ID_Sliders + p); mSliders[p] = S.ToolTip( TranslatableString{ tip } ) + .Name( TranslatableString{ labelText } ) .AddSlider( {}, 0, 1000, 0); - mSliders[p]->SetName(labelText); mSliders[p]->SetSizeHints(150, -1); str = Internat::ToDisplayString(mParameters[p].maxValue); diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index 6d8c5a8cd..cce4c943c 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -325,12 +325,11 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) S.SetBorder(1); mTrack = S.Id(TrackID) .AddRadioButton(_("Tracks")); - mTrack->SetName(_("Tracks")); // Row 2 S.SetBorder(1); - mLabel = S.Id(LabelID).AddRadioButtonToGroup(_("Labels")); - mLabel->SetName(_("Labels")); + mLabel = S.Id(LabelID) + .AddRadioButtonToGroup(_("Labels")); S.SetBorder(3); S.StartMultiColumn(2, wxEXPAND); @@ -348,10 +347,11 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) { mFirstFileLabel = S.AddVariableText(_("First file name:"), false); mFirstFileName = S.Id(FirstFileNameID) - .Prop(1).TieTextBox( {}, + .Prop(1) + .Name(XO("First file name")) + .TieTextBox( {}, name, 30); - mFirstFileName->SetName(_("First file name")); } S.EndMultiColumn(); } @@ -390,10 +390,10 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) S.AddVariableText(wxT(" "), false); mPrefixLabel = S.AddVariableText(_("File name prefix:"), false); mPrefix = S.Id(PrefixID) + .Name(XO("File name prefix")) .TieTextBox( {}, name, 30); - mPrefix->SetName(_("File name prefix")); } S.EndMultiColumn(); } diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index a0af2e8b8..58b513337 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -185,19 +185,21 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) wxTextCtrl *w; // only show the following controls if we use Portaudio v19, because // for Portaudio v18 we always use default buffer sizes - w = S.TieNumericTextBox(_("&Buffer length:"), + w = S + .NameSuffix(XO("milliseconds")) + .TieNumericTextBox(_("&Buffer length:"), {wxT("/AudioIO/LatencyDuration"), DEFAULT_LATENCY_DURATION}, 9); S.AddUnits(_("milliseconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); - w = S.TieNumericTextBox(_("&Latency compensation:"), + w = S + .NameSuffix(XO("milliseconds")) + .TieNumericTextBox(_("&Latency compensation:"), {wxT("/AudioIO/LatencyCorrection"), DEFAULT_LATENCY_CORRECTION}, 9); S.AddUnits(_("milliseconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); } S.EndThreeColumn(); } diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 4a6668943..4768088db 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -184,12 +184,15 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S) 0 // tree }); { - mViewByTree = S.Id(ViewByTreeID).TieRadioButton(); - if( mViewByTree ) mViewByTree->SetName(_("View by tree")); - mViewByName = S.Id(ViewByNameID).TieRadioButton(); - if( mViewByName ) mViewByName->SetName(_("View by name")); - mViewByKey = S.Id(ViewByKeyID).TieRadioButton(); - if( mViewByKey ) mViewByKey->SetName(_("View by key")); + mViewByTree = S.Id(ViewByTreeID) + .Name(XO("View by tree")) + .TieRadioButton(); + mViewByName = S.Id(ViewByNameID) + .Name(XO("View by name")) + .TieRadioButton(); + mViewByKey = S.Id(ViewByKeyID) + .Name(XO("View by key")) + .TieRadioButton(); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control if (mViewByTree) mViewByTree->SetAccessible(safenew WindowAccessible(mViewByTree)); diff --git a/src/prefs/PlaybackPrefs.cpp b/src/prefs/PlaybackPrefs.cpp index 6b8066a74..2c41639dc 100644 --- a/src/prefs/PlaybackPrefs.cpp +++ b/src/prefs/PlaybackPrefs.cpp @@ -77,7 +77,7 @@ namespace { void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { - wxTextCtrl *w; + const auto suffix = XO("seconds"); S.StartScroller(); S.SetBorder(2); @@ -86,12 +86,12 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieNumericTextBox(_("&Length:"), + S.NameSuffix(suffix) + .TieNumericTextBox(_("&Length:"), {wxT("/AudioIO/EffectsPreviewLen"), 6.0}, 9); S.AddUnits(_("seconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); } S.EndThreeColumn(); } @@ -102,19 +102,19 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieNumericTextBox(_("&Before cut region:"), + S.NameSuffix(suffix) + .TieNumericTextBox(_("&Before cut region:"), {wxT("/AudioIO/CutPreviewBeforeLen"), 2.0}, 9); S.AddUnits(_("seconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); - w = S.TieNumericTextBox(_("&After cut region:"), + S.NameSuffix(suffix) + .TieNumericTextBox(_("&After cut region:"), {wxT("/AudioIO/CutPreviewAfterLen"), 1.0}, 9); S.AddUnits(_("seconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); } S.EndThreeColumn(); } @@ -124,19 +124,19 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieNumericTextBox(_("&Short period:"), + S.NameSuffix(suffix) + .TieNumericTextBox(_("&Short period:"), {wxT("/AudioIO/SeekShortPeriod"), 1.0}, 9); S.AddUnits(_("seconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); - w = S.TieNumericTextBox(_("Lo&ng period:"), + S.NameSuffix(suffix) + .TieNumericTextBox(_("Lo&ng period:"), {wxT("/AudioIO/SeekLongPeriod"), 15.0}, 9); S.AddUnits(_("seconds")); - if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds")); } S.EndThreeColumn(); } diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index 1c86b03f6..b9d90e832 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -157,14 +157,14 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/GUI/TrackNames/RecordingNameCustom"), mUseCustomTrackName}); - mToggleCustomName = S.TieTextBox( {}, - {wxT("/GUI/TrackNames/RecodingTrackName"), - _("Recorded_Audio")}, - 30); - if( mToggleCustomName ) { - mToggleCustomName->SetName(_("Custom name text")); + mToggleCustomName = S + .Name(XO("Custom name text")) + .TieTextBox( {}, + {wxT("/GUI/TrackNames/RecodingTrackName"), + _("Recorded_Audio")}, + 30); + if ( mToggleCustomName ) mToggleCustomName->Enable(mUseCustomTrackName); - } } S.EndMultiColumn(); @@ -239,20 +239,22 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - auto w = S.TieNumericTextBox(_("Pre-ro&ll:"), - {AUDIO_PRE_ROLL_KEY, - DEFAULT_PRE_ROLL_SECONDS}, - 9); + auto w = S + .NameSuffix(XO("seconds")) + .TieNumericTextBox(_("Pre-ro&ll:"), + {AUDIO_PRE_ROLL_KEY, + DEFAULT_PRE_ROLL_SECONDS}, + 9); S.AddUnits(_("seconds")); - w->SetName(w->GetName() + wxT(" ") + _("seconds")); } { - auto w = S.TieNumericTextBox(_("Cross&fade:"), - {AUDIO_ROLL_CROSSFADE_KEY, - DEFAULT_ROLL_CROSSFADE_MS}, - 9); + auto w = S + .NameSuffix(XO("milliseconds")) + .TieNumericTextBox(_("Cross&fade:"), + {AUDIO_ROLL_CROSSFADE_KEY, + DEFAULT_ROLL_CROSSFADE_MS}, + 9); S.AddUnits(_("milliseconds")); - w->SetName(w->GetName() + wxT(" ") + _("milliseconds")); } S.EndThreeColumn(); } diff --git a/src/tracks/labeltrack/ui/LabelTrackControls.cpp b/src/tracks/labeltrack/ui/LabelTrackControls.cpp index ca5de89b5..b913fb8cc 100644 --- a/src/tracks/labeltrack/ui/LabelTrackControls.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackControls.cpp @@ -131,9 +131,10 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) facenames, wxLB_SINGLE); - lb->SetName(_("Face name")); lb->SetSelection( make_iterator_range( facenames ).index( facename )); - S.AddWindow(lb, wxALIGN_LEFT | wxEXPAND | wxALL); + S + .Name(XO("Face name")) + .AddWindow(lb, wxALIGN_LEFT | wxEXPAND | wxALL); /* i18n-hint: (noun) The size of the typeface*/ S.AddPrompt(_("Face size")); @@ -143,8 +144,9 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) wxDefaultSize, wxSP_ARROW_KEYS, 8, 48, fontsize); - sc->SetName(_("Face size")); - S.AddWindow(sc, wxALIGN_LEFT | wxALL); + S + .Name(XO("Face size")) + .AddWindow(sc, wxALIGN_LEFT | wxALL); } S.EndMultiColumn(); S.AddStandardButtons(); diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 25016c146..910fcfc2c 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -2005,14 +2005,13 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event)) S.AddFixedText(_("Higher refresh rates make the meter show more frequent\nchanges. A rate of 30 per second or less should prevent\nthe meter affecting audio quality on slower machines.")); S.StartHorizontalLay(); { - rate = S + rate = S.Name(XO("Meter refresh rate per second [1-100]")) .Validator>( &mMeterRefreshRate, NumValidatorStyle::DEFAULT, MIN_REFRESH_RATE, MAX_REFRESH_RATE) .AddTextBox(_("Meter refresh rate per second [1-100]: "), wxString::Format(wxT("%d"), meterRefreshRate), 10); - rate->SetName(_("Meter refresh rate per second [1-100]")); } S.EndHorizontalLay(); } @@ -2025,9 +2024,7 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event)) S.StartVerticalLay(); { gradient = S.AddRadioButton(_("Gradient"), true, mGradient); - gradient->SetName(_("Gradient")); rms = S.AddRadioButtonToGroup(_("RMS"), false, mGradient); - rms->SetName(_("RMS")); } S.EndVerticalLay(); } @@ -2038,9 +2035,7 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event)) S.StartVerticalLay(); { db = S.AddRadioButton(_("dB"), true, mDB); - db->SetName(_("dB")); linear = S.AddRadioButtonToGroup(_("Linear"), false, mDB); - linear->SetName(_("Linear")); } S.EndVerticalLay(); } @@ -2052,13 +2047,10 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event)) { automatic = S.AddRadioButton( _("Automatic"), AutomaticStereo, mDesiredStyle); - automatic->SetName(_("Automatic")); horizontal = S.AddRadioButtonToGroup( _("Horizontal"), HorizontalStereo, mDesiredStyle); - horizontal->SetName(_("Horizontal")); vertical = S.AddRadioButtonToGroup( _("Vertical"), VerticalStereo, mDesiredStyle); - vertical->SetName(_("Vertical")); } S.EndVerticalLay(); }