diff --git a/src/AudacityLogger.cpp b/src/AudacityLogger.cpp index 54219e2b6..d3b7ecc3e 100644 --- a/src/AudacityLogger.cpp +++ b/src/AudacityLogger.cpp @@ -156,13 +156,12 @@ void AudacityLogger::Show(bool show) // Log text ShuttleGui S(frame.get(), eIsCreating); - S.SetStyle(wxNO_BORDER | wxTAB_TRAVERSAL); - S.Prop(true).StartPanel(); + S.Style(wxNO_BORDER | wxTAB_TRAVERSAL).Prop(true).StartPanel(); { S.StartVerticalLay(true); { - S.SetStyle(wxTE_MULTILINE | wxHSCROLL | wxTE_READONLY); - mText = S.AddTextWindow(mBuffer); + mText = S.Style(wxTE_MULTILINE | wxHSCROLL | wxTE_READONLY) + .AddTextWindow(mBuffer); S.AddSpace(0, 5); S.StartHorizontalLay(wxALIGN_CENTER, 0); diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index a840439b7..108c3490b 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -112,8 +112,9 @@ void MacroCommandDialog::PopulateOrExchange(ShuttleGui &S) S.Prop(10).StartStatic(_("Choose command"), true); { - S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL); - mChoices = S.Id(CommandsListID).AddListControl(); + mChoices = S.Id(CommandsListID) + .Style(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL) + .AddListControl(); } S.EndStatic(); } diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 92b4541c8..babc70203 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -135,10 +135,11 @@ void ApplyMacroDialog::PopulateOrExchange(ShuttleGui &S) * to one or more audio files.*/ S.StartStatic(_("Select Macro"), 1); { - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | - wxLC_SINGLE_SEL); mMacros = S.Id(MacrosListID).Prop(1) - .AddListControlReportMode( { _("Macro") } ); + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | + wxLC_SINGLE_SEL) + // i18n-hint: This is the heading for a column in the edit macros dialog + .AddListControlReportMode( { _("Macro") } ); } S.EndStatic(); @@ -410,9 +411,9 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) imageList->Add(wxIcon(empty9x16_xpm)); imageList->Add(wxIcon(arrow_xpm)); - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | - wxLC_SINGLE_SEL); fileList = S.Id(CommandsListID) + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | + wxLC_SINGLE_SEL) .AddListControlReportMode( { _("File") } ); // AssignImageList takes ownership fileList->AssignImageList(imageList.release(), wxIMAGE_LIST_SMALL); @@ -618,11 +619,11 @@ void MacrosWindow::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND,1); { - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_SINGLE_SEL | - wxLC_EDIT_LABELS); mMacros = S.Id(MacrosListID).Prop(1) - // i18n-hint: This is the heading for a column in the edit macros dialog - .AddListControlReportMode( { _("Macro") } ); + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES + | wxLC_SINGLE_SEL | wxLC_EDIT_LABELS) + // i18n-hint: This is the heading for a column in the edit macros dialog + .AddListControlReportMode( { _("Macro") } ); S.StartVerticalLay(wxALIGN_TOP, 0); { S.Id(AddButtonID).AddButton(_("&New")); @@ -646,9 +647,9 @@ void MacrosWindow::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND,1); { - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | - wxLC_SINGLE_SEL); mList = S.Id(CommandsListID) + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | + wxLC_SINGLE_SEL) .AddListControlReportMode({ /* i18n-hint: This is the number of the command in the list */ { _("Num"), wxLIST_FORMAT_RIGHT }, diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index d1df45cd8..6d4955ea8 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -412,13 +412,13 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id, { S.AddPrompt(_("Cursor:")); - S.SetStyle(wxTE_READONLY); - mCursorText = S.AddTextBox( {}, wxT(""), 10); + mCursorText = S.Style(wxTE_READONLY) + .AddTextBox( {}, wxT(""), 10); S.AddPrompt(_("Peak:")); - S.SetStyle(wxTE_READONLY); - mPeakText = S.AddTextBox( {}, wxT(""), 10); + mPeakText = S.Style(wxTE_READONLY) + .AddTextBox( {}, wxT(""), 10); S.AddSpace(5); mGridOnOff = S.Id(GridOnOffID).AddCheckBox(_("&Grids"), mDrawGrid); diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index c4c618b8e..17a7eeddb 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -576,8 +576,8 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) } S.EndHorizontalLay(); - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES ); mEffects = S.Id(ID_List) + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES ) .AddListControlReportMode({ _("Name"), _("State"), _("Path") }); mEffects->Bind(wxEVT_KEY_DOWN, &PluginRegistrationDialog::OnListChar, diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 7032630eb..4e9f8db40 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -144,7 +144,6 @@ void ShuttleGuiBase::Init() mRadioCount = -1; miBorder = 5; - miStyle = 0; miProp=0; miPropSetByUser=-1; miSizerProp=0; @@ -253,7 +252,7 @@ void ShuttleGuiBase::AddPrompt(const wxString &Prompt) return; miProp=1; mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, - Style( wxALIGN_RIGHT )); + GetStyle( wxALIGN_RIGHT )); mpWind->SetName(wxStripMenuCodes(Prompt)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL, true ); } @@ -267,7 +266,7 @@ void ShuttleGuiBase::AddUnits(const wxString &Prompt) return; miProp=1; mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, - Style( wxALIGN_LEFT )); + GetStyle( wxALIGN_LEFT )); mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL ); } @@ -280,7 +279,7 @@ void ShuttleGuiBase::AddTitle(const wxString &Prompt) if( mShuttleMode != eIsCreating ) return; mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, - Style( wxALIGN_CENTRE )); + GetStyle( wxALIGN_CENTRE )); mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizers(); } @@ -313,7 +312,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, bool Selected) wxCheckBox * pCheckBox; miProp=0; mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize, - Style( 0 )); + GetStyle( 0 )); pCheckBox->SetValue(Selected); if (realPrompt.empty()) { // NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have @@ -341,7 +340,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight( const wxString &Prompt, bool Se wxCheckBox * pCheckBox; miProp=0; mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, wxT(""), wxDefaultPosition, wxDefaultSize, - Style( 0 )); + GetStyle( 0 )); pCheckBox->SetValue(Selected); pCheckBox->SetName(wxStripMenuCodes(Prompt)); UpdateSizers(); @@ -356,7 +355,7 @@ wxButton * ShuttleGuiBase::AddButton( return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxButton); wxButton * pBtn; mpWind = pBtn = safenew wxButton(GetParent(), miId, Text, wxDefaultPosition, wxDefaultSize, - Style( 0 ) ); + GetStyle( 0 ) ); mpWind->SetName(wxStripMenuCodes(Text)); miProp=0; UpdateSizersCore(false, PositionFlags | wxALL); @@ -373,7 +372,7 @@ wxBitmapButton * ShuttleGuiBase::AddBitmapButton( return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxBitmapButton); wxBitmapButton * pBtn; mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, Bitmap, - wxDefaultPosition, wxDefaultSize, Style( wxNO_BORDER ) ); + wxDefaultPosition, wxDefaultSize, GetStyle( wxNO_BORDER ) ); pBtn->SetBackgroundColour( wxColour( 246,246,243)); // wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); @@ -401,7 +400,7 @@ wxChoice * ShuttleGuiBase::AddChoice( const wxString &Prompt, wxDefaultPosition, wxDefaultSize, choices, - Style( 0 ) ); + GetStyle( 0 ) ); pChoice->SetMinSize( { 180, -1 } );// Use -1 for 'default size' - Platform specific. #ifdef __WXMAC__ @@ -430,7 +429,7 @@ void ShuttleGuiBase::AddFixedText(const wxString &Str, bool bCenter) if( mShuttleMode != eIsCreating ) return; mpWind = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize, - Style( wxALIGN_LEFT )); + GetStyle( wxALIGN_LEFT )); mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) if( bCenter ) { @@ -449,7 +448,7 @@ wxStaticText * ShuttleGuiBase::AddVariableText(const wxString &Str, bool bCenter wxStaticText *pStatic; mpWind = pStatic = safenew wxStaticText(GetParent(), miId, Str, wxDefaultPosition, wxDefaultSize, - Style( wxALIGN_LEFT )); + GetStyle( wxALIGN_LEFT )); mpWind->SetName(wxStripMenuCodes(Str)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) if( bCenter ) { @@ -487,7 +486,7 @@ wxComboBox * ShuttleGuiBase::AddCombo( const wxString &Prompt, const wxString &S } mpWind = pCombo = safenew wxComboBox(GetParent(), miId, Selected, wxDefaultPosition, wxDefaultSize, - n, Choices, Style( style )); + n, Choices, GetStyle( style )); mpWind->SetName(wxStripMenuCodes(Prompt)); UpdateSizers(); @@ -505,7 +504,7 @@ wxRadioButton * ShuttleGuiBase::DoAddRadioButton( return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton); wxRadioButton * pRad; mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt, - wxDefaultPosition, wxDefaultSize, Style( style ) ); + wxDefaultPosition, wxDefaultSize, GetStyle( style ) ); mpWind->SetName(wxStripMenuCodes(Prompt)); if ( style ) pRad->SetValue( true ); @@ -546,7 +545,7 @@ wxSlider * ShuttleGuiBase::AddSlider(const wxString &Prompt, int pos, int Max, i mpWind = pSlider = safenew wxSliderWrapper(GetParent(), miId, pos, Min, Max, wxDefaultPosition, wxDefaultSize, - Style( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS ) + GetStyle( wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS ) ); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control @@ -569,7 +568,7 @@ wxSpinCtrl * ShuttleGuiBase::AddSpinCtrl(const wxString &Prompt, int Value, int mpWind = pSpinCtrl = safenew wxSpinCtrl(GetParent(), miId, wxEmptyString, wxDefaultPosition, wxDefaultSize, - Style( wxSP_VERTICAL | wxSP_ARROW_KEYS ), + GetStyle( wxSP_VERTICAL | wxSP_ARROW_KEYS ), Min, Max, Value ); mpWind->SetName(wxStripMenuCodes(Prompt)); @@ -600,7 +599,7 @@ wxTextCtrl * ShuttleGuiBase::AddTextBox(const wxString &Caption, const wxString #endif mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value, - wxDefaultPosition, Size, Style( flags )); + wxDefaultPosition, Size, GetStyle( flags )); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control mpWind->SetAccessible(safenew WindowAccessible(mpWind)); @@ -633,7 +632,7 @@ wxTextCtrl * ShuttleGuiBase::AddNumericTextBox(const wxString &Caption, const wx wxTextValidator Validator(wxFILTER_NUMERIC); mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value, - wxDefaultPosition, Size, Style( flags ), + wxDefaultPosition, Size, GetStyle( flags ), Validator // It's OK to pass this. It will be cloned. ); #if wxUSE_ACCESSIBILITY @@ -654,7 +653,7 @@ wxTextCtrl * ShuttleGuiBase::AddTextWindow(const wxString &Value) wxTextCtrl * pTextCtrl; SetProportions( 1 ); mpWind = pTextCtrl = safenew wxTextCtrl(GetParent(), miId, Value, - wxDefaultPosition, wxDefaultSize, Style( wxTE_MULTILINE )); + wxDefaultPosition, wxDefaultSize, GetStyle( wxTE_MULTILINE )); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control mpWind->SetAccessible(safenew WindowAccessible(mpWind)); @@ -679,7 +678,7 @@ void ShuttleGuiBase::AddConstTextBox(const wxString &Prompt, const wxString &Val UpdateSizers(); miProp=0; mpWind = safenew wxStaticText(GetParent(), miId, Value, wxDefaultPosition, wxDefaultSize, - Style( 0 )); + GetStyle( 0 )); mpWind->SetName(Value); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizers(); } @@ -707,7 +706,7 @@ wxGrid * ShuttleGuiBase::AddGrid() wxGrid * pGrid; SetProportions( 1 ); mpWind = pGrid = safenew wxGrid(GetParent(), miId, wxDefaultPosition, - wxDefaultSize, Style( wxWANTS_CHARS )); + wxDefaultSize, GetStyle( wxWANTS_CHARS )); pGrid->SetMinSize( wxSize( 120, 150 )); UpdateSizers(); return pGrid; @@ -724,7 +723,7 @@ wxListCtrl * ShuttleGuiBase::AddListControl( wxListCtrl * pListCtrl; SetProportions( 1 ); mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId, - wxDefaultPosition, wxDefaultSize, Style( wxLC_ICON )); + wxDefaultPosition, wxDefaultSize, GetStyle( wxLC_ICON )); pListCtrl->SetMinSize( wxSize( 120,150 )); UpdateSizers(); @@ -745,7 +744,7 @@ wxListCtrl * ShuttleGuiBase::AddListControlReportMode( SetProportions( 1 ); mpWind = pListCtrl = safenew wxListCtrl(GetParent(), miId, wxDefaultPosition, wxSize(230,120),//wxDefaultSize, - Style( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER )); + GetStyle( wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxSUNKEN_BORDER )); // pListCtrl->SetMinSize( wxSize( 120,150 )); UpdateSizers(); @@ -793,7 +792,7 @@ wxTreeCtrl * ShuttleGuiBase::AddTree() wxTreeCtrl * pTreeCtrl; SetProportions( 1 ); mpWind = pTreeCtrl = safenew wxTreeCtrl(GetParent(), miId, wxDefaultPosition, wxDefaultSize, - Style( wxTR_HAS_BUTTONS )); + GetStyle( wxTR_HAS_BUTTONS )); pTreeCtrl->SetMinSize( wxSize( 120,650 )); UpdateSizers(); return pTreeCtrl; @@ -807,7 +806,7 @@ void ShuttleGuiBase::AddIcon(wxBitmap *pBmp) return; wxBitmapButton * pBtn; mpWind = pBtn = safenew wxBitmapButton(GetParent(), miId, *pBmp, - wxDefaultPosition, wxDefaultSize, Style( wxBU_AUTODRAW ) ); + wxDefaultPosition, wxDefaultSize, GetStyle( wxBU_AUTODRAW ) ); pBtn->SetWindowStyle( 0 ); UpdateSizersC(); } @@ -892,7 +891,7 @@ wxScrolledWindow * ShuttleGuiBase::StartScroller(int iStyle) wxScrolledWindow * pScroller; mpWind = pScroller = safenew wxScrolledWindow(GetParent(), miId, wxDefaultPosition, wxDefaultSize, - Style( wxSUNKEN_BORDER ) ); + GetStyle( wxSUNKEN_BORDER ) ); pScroller->SetScrollRate( 20,20 ); // This fools NVDA into not saying "Panel" when the dialog gets focus @@ -943,7 +942,7 @@ wxPanel * ShuttleGuiBase::StartPanel(int iStyle) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel); wxPanel * pPanel; mpWind = pPanel = safenew wxPanelWrapper( GetParent(), miId, wxDefaultPosition, wxDefaultSize, - Style( wxNO_BORDER )); + GetStyle( wxNO_BORDER )); if( iStyle != 0 ) { @@ -979,7 +978,7 @@ wxNotebook * ShuttleGuiBase::StartNotebook() return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxNotebook); wxNotebook * pNotebook; mpWind = pNotebook = safenew wxNotebook(GetParent(), - miId, wxDefaultPosition, wxDefaultSize, Style( 0 )); + miId, wxDefaultPosition, wxDefaultSize, GetStyle( 0 )); SetProportions( 1 ); UpdateSizers(); mpParent = pNotebook; @@ -2139,11 +2138,11 @@ void ShuttleGuiBase::PushSizer() pSizerStack[ mSizerDepth ] = mpSizer; } -long ShuttleGuiBase::Style( long style ) +long ShuttleGuiBase::GetStyle( long style ) { - if( miStyle ) - style = miStyle; - miStyle = 0; + if( mItem.miStyle ) + style = mItem.miStyle; + mItem.miStyle = 0; return style; } diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index b2a2ace4a..ef5300153 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -161,10 +161,18 @@ struct Item { return std::move( *this ); } + Item&& Style( long style ) && + { + miStyle = style; + return std::move( *this ); + } + std::function< void(wxWindow*) > mValidatorSetter; TranslatableString mToolTip; TranslatableString mName; TranslatableString mNameSuffix; + + long miStyle{}; }; } @@ -373,7 +381,6 @@ public: void EnableCtrl( bool bEnable ); void SetSizeHints( int minX, int minY ); void SetBorder( int Border ) {miBorder = Border;}; - void SetStyle( int Style ) {miStyle = Style;}; void SetSizerProportion( int iProp ) {miSizerProp = iProp;}; void SetStretchyCol( int i ); void SetStretchyRow( int i ); @@ -401,7 +408,7 @@ protected: void UpdateSizersC(); void UpdateSizersAtStart(); - long Style( long Style ); + long GetStyle( long Style ); private: void SetSizeHints( const wxArrayStringEx & items ); @@ -428,7 +435,6 @@ protected: int miSizerProp; int mSizerDepth; int miBorder; - long miStyle; int miProp; // See UseUpId() for explanation of these three. @@ -563,6 +569,13 @@ public: // Prop() sets the proportion value, defined as in wxSizer::Add(). ShuttleGui & Prop( int iProp ){ ShuttleGuiBase::Prop(iProp); return *this;}; // Has to be here too, to return a ShuttleGui and not a ShuttleGuiBase. + + ShuttleGui & Style( long iStyle ) + { + std::move( mItem ).Style( iStyle ); + return *this; + } + GuiWaveTrack * AddGuiWaveTrack( const wxString & Name); AttachableScrollBar * AddAttachableScrollBar( long style = wxSB_HORIZONTAL ); diff --git a/src/effects/Amplify.cpp b/src/effects/Amplify.cpp index f7bc7f52d..b65107e9a 100644 --- a/src/effects/Amplify.cpp +++ b/src/effects/Amplify.cpp @@ -244,8 +244,8 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S) // Amplitude S.StartHorizontalLay(wxEXPAND); { - S.SetStyle(wxSL_HORIZONTAL); mAmpS = S.Id(ID_Amp) + .Style(wxSL_HORIZONTAL) .Name(XO("Amplification dB")) .AddSlider( {}, 0, MAX_Amp * SCL_Amp, MIN_Amp * SCL_Amp); } diff --git a/src/effects/BassTreble.cpp b/src/effects/BassTreble.cpp index 1e9e55237..deda6b9f6 100644 --- a/src/effects/BassTreble.cpp +++ b/src/effects/BassTreble.cpp @@ -233,9 +233,9 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) 1, &mBass, NumValidatorStyle::DEFAULT, MIN_Bass, MAX_Bass) .AddTextBox(_("Ba&ss (dB):"), wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mBassS = S.Id(ID_Bass) .Name(XO("Bass")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, MAX_Bass * SCL_Bass, MIN_Bass * SCL_Bass); // Treble control @@ -244,9 +244,9 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) 1, &mTreble, NumValidatorStyle::DEFAULT, MIN_Treble, MAX_Treble) .AddTextBox(_("&Treble (dB):"), wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mTrebleS = S.Id(ID_Treble) .Name(XO("Treble")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, MAX_Treble * SCL_Treble, MIN_Treble * SCL_Treble); } S.EndMultiColumn(); @@ -265,9 +265,9 @@ void EffectBassTreble::PopulateOrExchange(ShuttleGui & S) 1, &mGain, NumValidatorStyle::DEFAULT, MIN_Gain, MAX_Gain) .AddTextBox(_("&Volume (dB):"), wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mGainS = S.Id(ID_Gain) .Name(XO("Level")) + .Style(wxSL_HORIZONTAL) .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 7cf2042f6..0d5717d36 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -353,9 +353,9 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND); { - S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_PercentChange) .Name(XO("Percent Change")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); } S.EndHorizontalLay(); diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp index 6c469cc5c..cc253b596 100644 --- a/src/effects/ChangeSpeed.cpp +++ b/src/effects/ChangeSpeed.cpp @@ -334,9 +334,9 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) // Percent change slider. S.StartHorizontalLay(wxEXPAND); { - S.SetStyle(wxSL_HORIZONTAL); mpSlider_PercentChange = S.Id(ID_PercentChange) .Name(XO("Percent Change")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); } S.EndHorizontalLay(); diff --git a/src/effects/ChangeTempo.cpp b/src/effects/ChangeTempo.cpp index 4019dfe12..2e93908c6 100644 --- a/src/effects/ChangeTempo.cpp +++ b/src/effects/ChangeTempo.cpp @@ -244,9 +244,9 @@ void EffectChangeTempo::PopulateOrExchange(ShuttleGui & S) // S.StartHorizontalLay(wxEXPAND); { - S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_PercentChange) .Name(XO("Percent Change")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage); } S.EndHorizontalLay(); diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index b8c15c348..f1f36761d 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -347,9 +347,9 @@ void EffectClickRemoval::PopulateOrExchange(ShuttleGui & S) wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mThreshS = S.Id(ID_Thresh) .Name(XO("Threshold")) + .Style(wxSL_HORIZONTAL) .Validator(&mThresholdLevel) .AddSlider( {}, mThresholdLevel, MAX_Threshold, MIN_Threshold); mThreshS->SetMinSize(wxSize(150, -1)); @@ -362,9 +362,9 @@ void EffectClickRemoval::PopulateOrExchange(ShuttleGui & S) wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mWidthS = S.Id(ID_Width) .Name(XO("Max Spike Width")) + .Style(wxSL_HORIZONTAL) .Validator(&mClickWidth) .AddSlider( {}, mClickWidth, MAX_Width, MIN_Width); mWidthS->SetMinSize(wxSize(150, -1)); diff --git a/src/effects/Compressor.cpp b/src/effects/Compressor.cpp index 0d11fcb70..289c1e681 100644 --- a/src/effects/Compressor.cpp +++ b/src/effects/Compressor.cpp @@ -226,9 +226,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) S.SetStretchyCol(1); mThresholdLabel = S.AddVariableText(_("Threshold:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mThresholdSlider = S.Id(ID_Threshold) .Name(XO("Threshold")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Threshold * SCL_Threshold, MAX_Threshold * SCL_Threshold, @@ -238,9 +238,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) mNoiseFloorLabel = S.AddVariableText(_("Noise Floor:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mNoiseFloorSlider = S.Id(ID_NoiseFloor) .Name(XO("Noise Floor")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_NoiseFloor / SCL_NoiseFloor, MAX_NoiseFloor / SCL_NoiseFloor, @@ -250,9 +250,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) mRatioLabel = S.AddVariableText(_("Ratio:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mRatioSlider = S.Id(ID_Ratio) .Name(XO("Ratio")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Ratio * SCL_Ratio, MAX_Ratio * SCL_Ratio, @@ -266,9 +266,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) * sound dies away. So this means 'onset duration'. */ mAttackLabel = S.AddVariableText(_("Attack Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mAttackSlider = S.Id(ID_Attack) .Name(XO("Attack Time")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_AttackTime * SCL_AttackTime, MAX_AttackTime * SCL_AttackTime, @@ -278,9 +278,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S) mDecayLabel = S.AddVariableText(_("Release Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mDecaySlider = S.Id(ID_Decay) .Name(XO("Release Time")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_ReleaseTime * SCL_ReleaseTime, MAX_ReleaseTime * SCL_ReleaseTime, diff --git a/src/effects/Distortion.cpp b/src/effects/Distortion.cpp index 425b9244e..627832f8b 100644 --- a/src/effects/Distortion.cpp +++ b/src/effects/Distortion.cpp @@ -396,9 +396,9 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) MIN_Threshold_dB, MAX_Threshold_dB) .AddTextBox( {}, wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mThresholdS = S.Id(ID_Threshold) .Name(defaultLabelUntranslated(0)) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, DB_TO_LINEAR(MAX_Threshold_dB) * SCL_Threshold_dB, DB_TO_LINEAR(MIN_Threshold_dB) * SCL_Threshold_dB); @@ -414,9 +414,9 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox( {}, wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mNoiseFloorS = S.Id(ID_NoiseFloor) .Name(defaultLabelUntranslated(1)) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, MAX_NoiseFloor, MIN_NoiseFloor); S.AddSpace(20, 0); } @@ -442,9 +442,9 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox( {}, wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mParam1S = S.Id(ID_Param1) .Name(defaultLabelUntranslated(2)) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, MAX_Param1, MIN_Param1); S.AddSpace(20, 0); @@ -458,9 +458,9 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox( {}, wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mParam2S = S.Id(ID_Param2) .Name(defaultLabelUntranslated(3)) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, MAX_Param2, MIN_Param2); S.AddSpace(20, 0); @@ -474,9 +474,9 @@ void EffectDistortion::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox( {}, wxT(""), 10); - S.SetStyle(wxSL_HORIZONTAL); mRepeatsS = S.Id(ID_Repeats) .Name(defaultLabelUntranslated(4)) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Repeats, MAX_Repeats, MIN_Repeats); S.AddSpace(20, 0); } diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index 7e62806b8..76d72e713 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -353,11 +353,12 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S) .AddWindow(mDtmfDurationT); S.AddFixedText(_("Tone/silence ratio:"), false); - S.SetStyle(wxSL_HORIZONTAL | wxEXPAND); - mDtmfDutyCycleS = S.Id(ID_DutyCycle).AddSlider( {}, - dtmfDutyCycle * SCL_DutyCycle, - MAX_DutyCycle * SCL_DutyCycle, - MIN_DutyCycle * SCL_DutyCycle); + mDtmfDutyCycleS = S.Id(ID_DutyCycle) + .Style(wxSL_HORIZONTAL | wxEXPAND) + .AddSlider( {}, + dtmfDutyCycle * SCL_DutyCycle, + MAX_DutyCycle * SCL_DutyCycle, + MIN_DutyCycle * SCL_DutyCycle); S.SetSizeHints(-1,-1); } S.EndMultiColumn(); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 9b79f8023..bf5121076 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -796,17 +796,17 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartVerticalLay(); { S.AddVariableText(_("+ dB"), false, wxCENTER); - S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMaxSlider = S.Id(ID_dBMax) .Name(XO("Max dB")) + .Style(wxSL_VERTICAL | wxSL_INVERSE) .AddSlider( {}, 30, 60, 0); #if wxUSE_ACCESSIBILITY mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB"))); #endif - S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMinSlider = S.Id(ID_dBMin) .Name(XO("Min dB")) + .Style(wxSL_VERTICAL | wxSL_INVERSE) .AddSlider( {}, -30, -10, -120); S.AddVariableText(_("- dB"), false, wxCENTER); #if wxUSE_ACCESSIBILITY @@ -966,9 +966,9 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(wxEXPAND, 1); { - S.SetStyle(wxSL_HORIZONTAL); mMSlider = S.Id(ID_Length) .Name(XO("Length of Filter")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, (mM - 1) / 2, 4095, 10); } S.EndHorizontalLay(); @@ -3344,8 +3344,8 @@ void EditCurvesDialog::PopulateOrExchange(ShuttleGui & S) { S.StartStatic(_("&Curves"), 1); { - S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES ); mList = S.Id(CurvesListID) + .Style(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES ) .AddListControlReportMode({ { _("Curve Name"), wxLIST_FORMAT_RIGHT } }); diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index 5e4975302..bba839b23 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1436,10 +1436,10 @@ struct ControlInfo { ) .AddTextBox(textBoxCaption.Translation(), wxT(""), 0); - S.SetStyle(wxSL_HORIZONTAL); wxSlider *const slider = S.Id(id) .Name( sliderName ) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, sliderMax); slider->SetSizeHints(150, -1); } diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index fb10aebb6..07161276b 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -720,36 +720,37 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) mGainT = S.Id(ID_GAIN_TEXT) .Validator(wxFILTER_NUMERIC) .AddTextBox(_("Noise re&duction (dB):"), wxT(""), 0); - S.SetStyle(wxSL_HORIZONTAL); + mGainS = S.Id(ID_GAIN_SLIDER) .Name(XO("Noise reduction")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), 0, GAIN_MAX, GAIN_MIN); mGainS->SetSizeHints(150, -1); mSensitivityT = S.Id(ID_SENSITIVITY_TEXT) .Validator(wxFILTER_NUMERIC) .AddTextBox(_("&Sensitivity (dB):"), wxT(""), 0); - S.SetStyle(wxSL_HORIZONTAL); mSensitivityS = S.Id(ID_SENSITIVITY_SLIDER) .Name(XO("Sensitivity")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), 0, SENSITIVITY_MAX, SENSITIVITY_MIN); mSensitivityS->SetSizeHints(150, -1); mFreqT = S.Id(ID_FREQ_TEXT) .Validator(wxFILTER_NUMERIC) .AddTextBox(_("Fr&equency smoothing (Hz):"), wxT(""), 0); - S.SetStyle(wxSL_HORIZONTAL); mFreqS = S.Id(ID_FREQ_SLIDER) .Name(XO("Frequency smoothing")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), 0, FREQ_MAX, FREQ_MIN); mFreqS->SetSizeHints(150, -1); mTimeT = S.Id(ID_TIME_TEXT) .Validator(wxFILTER_NUMERIC) .AddTextBox(_("Attac&k/decay time (secs):"), wxT(""), 0); - S.SetStyle(wxSL_HORIZONTAL); mTimeS = S.Id(ID_TIME_SLIDER) .Name(XO("Attack/decay time")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), 0, TIME_MAX, TIME_MIN); mTimeS->SetSizeHints(150, -1); diff --git a/src/effects/Phaser.cpp b/src/effects/Phaser.cpp index fde9e3a58..a7e8a2390 100644 --- a/src/effects/Phaser.cpp +++ b/src/effects/Phaser.cpp @@ -261,9 +261,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) &mStages, NumValidatorStyle::DEFAULT, MIN_Stages, MAX_Stages) .AddTextBox(_("&Stages:"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mStagesS = S.Id(ID_Stages) .Name(XO("Stages")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Stages * SCL_Stages, MAX_Stages * SCL_Stages, MIN_Stages * SCL_Stages); mStagesS->SetLineSize(2); mStagesS->SetMinSize(wxSize(100, -1)); @@ -273,9 +273,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) &mDryWet, NumValidatorStyle::DEFAULT, MIN_DryWet, MAX_DryWet) .AddTextBox(_("&Dry/Wet:"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mDryWetS = S.Id(ID_DryWet) .Name(XO("Dry Wet")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_DryWet * SCL_DryWet, MAX_DryWet * SCL_DryWet, MIN_DryWet * SCL_DryWet); mDryWetS->SetMinSize(wxSize(100, -1)); @@ -284,9 +284,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) 5, &mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, MIN_Freq, MAX_Freq) .AddTextBox(_("LFO Freq&uency (Hz):"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mFreqS = S.Id(ID_Freq) .Name(XO("LFO frequency in hertz")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, 0.0); mFreqS ->SetMinSize(wxSize(100, -1)); @@ -295,9 +295,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) 1, &mPhase, NumValidatorStyle::DEFAULT, MIN_Phase, MAX_Phase) .AddTextBox(_("LFO Sta&rt Phase (deg.):"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mPhaseS = S.Id(ID_Phase) .Name(XO("LFO start phase in degrees")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); mPhaseS->SetLineSize(10); mPhaseS->SetMinSize(wxSize(100, -1)); @@ -307,9 +307,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) &mDepth, NumValidatorStyle::DEFAULT, MIN_Depth, MAX_Depth) .AddTextBox(_("Dept&h:"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mDepthS = S.Id(ID_Depth) .Name(XO("Depth in percent")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); mDepthS->SetMinSize(wxSize(100, -1)); @@ -318,9 +318,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) &mFeedback, NumValidatorStyle::DEFAULT, MIN_Feedback, MAX_Feedback) .AddTextBox(_("Feedbac&k (%):"), wxT(""), 15); - S.SetStyle(wxSL_HORIZONTAL); mFeedbackS = S.Id(ID_Feedback) .Name(XO("Feedback in percent")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Feedback * SCL_Feedback, MAX_Feedback * SCL_Feedback, MIN_Feedback * SCL_Feedback); mFeedbackS->SetLineSize(10); mFeedbackS->SetMinSize(wxSize(100, -1)); @@ -330,9 +330,9 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S) 1, &mOutGain, NumValidatorStyle::DEFAULT, MIN_OutGain, MAX_OutGain) .AddTextBox(_("&Output gain (dB):"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mOutGainS = S.Id(ID_OutGain) .Name(XO("Output gain (dB)")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); mOutGainS->SetMinSize(wxSize(100, -1)); } diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index de8266a60..c992466ea 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -439,9 +439,10 @@ void EffectReverb::PopulateOrExchange(ShuttleGui & S) #define SpinSlider(n, p) \ m ## n ## T = S.Id(ID_ ## n). \ AddSpinCtrl( p, DEF_ ## n, MAX_ ## n, MIN_ ## n); \ - S.SetStyle(wxSL_HORIZONTAL); \ - m ## n ## S = S.Id(ID_ ## n). \ - AddSlider( {}, DEF_ ## n, MAX_ ## n, MIN_ ## n); + S; \ + m ## n ## S = S.Id(ID_ ## n) \ + .Style(wxSL_HORIZONTAL) \ + .AddSlider( {}, DEF_ ## n, MAX_ ## n, MIN_ ## n); SpinSlider(RoomSize, _("&Room Size (%):")) SpinSlider(PreDelay, _("&Pre-delay (ms):")) diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp index 65bb23b71..8749aa0c8 100644 --- a/src/effects/ScienFilter.cpp +++ b/src/effects/ScienFilter.cpp @@ -405,17 +405,16 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) S.StartVerticalLay(); { S.AddVariableText(_("+ dB"), false, wxCENTER); - S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMaxSlider = S.Id(ID_dBMax) .Name(XO("Max dB")) + .Style(wxSL_VERTICAL | wxSL_INVERSE) .AddSlider( {}, 10, 20, 0); #if wxUSE_ACCESSIBILITY mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB"))); #endif - - S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMinSlider = S.Id(ID_dBMin) .Name(XO("Min dB")) + .Style(wxSL_VERTICAL | wxSL_INVERSE) .AddSlider( {}, -10, -10, -120); #if wxUSE_ACCESSIBILITY mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, _("%d dB"))); diff --git a/src/effects/ScoreAlignDialog.cpp b/src/effects/ScoreAlignDialog.cpp index f720fc4b0..73fe8eaab 100644 --- a/src/effects/ScoreAlignDialog.cpp +++ b/src/effects/ScoreAlignDialog.cpp @@ -98,9 +98,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mFramePeriodLabel = S.AddVariableText(_("Frame Period:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mFramePeriodSlider = S.Id(ID_FRAMEPERIOD) .Name(XO("Frame Period")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mFramePeriod * 100 + 0.5), /*max*/ 50, /*min*/ 5); S.SetSizeHints(300, -1); @@ -109,9 +109,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mWindowSizeLabel = S.AddVariableText(_("Window Size:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mWindowSizeSlider = S.Id(ID_WINDOWSIZE) .Name(XO("Window Size")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mWindowSize * 100 + 0.5), /*max*/ 100, /*min*/ 5); mWindowSizeText = S.AddVariableText(SA_DFT_WINDOW_SIZE_TEXT, true, @@ -132,9 +132,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) mSilenceThresholdLabel = S.AddVariableText(_("Silence Threshold:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mSilenceThresholdSlider = S.Id(ID_SILENCETHRESHOLD) .Name(XO("Silence Threshold")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mSilenceThreshold * 1000 + 0.5), /*max*/ 500); mSilenceThresholdText = S.AddVariableText(SA_DFT_SILENCE_THRESHOLD_TEXT, @@ -146,9 +146,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) It is OK to leave it in English. */ mPresmoothLabel = S.AddVariableText(_("Presmooth Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mPresmoothSlider = S.Id(ID_PRESMOOTH) .Name(XO("Presmooth Time")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mPresmoothTime * 100 + 0.5), /*max*/ 500); mPresmoothText = S.AddVariableText(SA_DFT_PRESMOOTH_TIME_TEXT, true, @@ -160,9 +160,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) It is OK to leave it in English. */ mLineTimeLabel = S.AddVariableText(_("Line Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mLineTimeSlider = S.Id(ID_LINETIME) .Name(XO("Line Time")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mLineTime * 100 + 0.5), /*max*/ 500); mLineTimeText = S.AddVariableText(SA_DFT_LINE_TIME_TEXT, true, @@ -174,9 +174,9 @@ ScoreAlignDialog::ScoreAlignDialog(ScoreAlignParams ¶ms) It is OK to leave it in English. */ mSmoothTimeLabel = S.AddVariableText(_("Smooth Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - S.SetStyle(wxSL_HORIZONTAL); mSmoothTimeSlider = S.Id(ID_SMOOTHTIME) .Name(XO("Smooth Time")) + .Style(wxSL_HORIZONTAL) .AddSlider(wxT(""), /*pos*/ (int) (p.mSmoothTime * 100 + 0.5), /*max*/ 500); mSmoothTimeText = S.AddVariableText(SA_DFT_SMOOTH_TIME_TEXT, true, diff --git a/src/effects/TimeScale.cpp b/src/effects/TimeScale.cpp index 86985aa3a..87a9d1347 100644 --- a/src/effects/TimeScale.cpp +++ b/src/effects/TimeScale.cpp @@ -217,8 +217,8 @@ void EffectTimeScale::PopulateOrExchange(ShuttleGui & S) S.EndMultiColumn(); S.StartHorizontalLay(wxEXPAND, 0); { - S.SetStyle(wxSL_HORIZONTAL); m_pSlider_RatePercentChangeStart = S.Id(ID_RatePercentChangeStart) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_RatePercentStart, MAX_RatePercentStart, MIN_RatePercentStart); } S.EndHorizontalLay(); @@ -240,8 +240,8 @@ void EffectTimeScale::PopulateOrExchange(ShuttleGui & S) S.EndMultiColumn(); S.StartHorizontalLay(wxEXPAND, 0); { - S.SetStyle(wxSL_HORIZONTAL); m_pSlider_RatePercentChangeEnd = S.Id(ID_RatePercentChangeEnd) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_RatePercentEnd, MAX_RatePercentEnd, MIN_RatePercentEnd); } S.EndHorizontalLay(); diff --git a/src/effects/Wahwah.cpp b/src/effects/Wahwah.cpp index 1f0083ebe..e8079610f 100644 --- a/src/effects/Wahwah.cpp +++ b/src/effects/Wahwah.cpp @@ -244,9 +244,10 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) .Validator>( 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) .Name(XO("LFO frequency in hertz")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq); mFreqS->SetMinSize(wxSize(100, -1)); @@ -255,9 +256,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) 1, &mPhase, NumValidatorStyle::DEFAULT, MIN_Phase, MAX_Phase) .AddTextBox(_("LFO Sta&rt Phase (deg.):"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mPhaseS = S.Id(ID_Phase) .Name(XO("LFO start phase in degrees")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Phase * SCL_Phase, MAX_Phase * SCL_Phase, MIN_Phase * SCL_Phase); mPhaseS->SetLineSize(10); mPhaseS->SetMinSize(wxSize(100, -1)); @@ -267,9 +268,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) &mDepth, NumValidatorStyle::DEFAULT, MIN_Depth, MAX_Depth) .AddTextBox(_("Dept&h (%):"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mDepthS = S.Id(ID_Depth) .Name(XO("Depth in percent")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Depth * SCL_Depth, MAX_Depth * SCL_Depth, MIN_Depth * SCL_Depth); mDepthS->SetMinSize(wxSize(100, -1)); @@ -278,9 +279,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) 1, &mRes, NumValidatorStyle::DEFAULT, MIN_Res, MAX_Res) .AddTextBox(_("Reso&nance:"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mResS = S.Id(ID_Res) .Name(XO("Resonance")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_Res * SCL_Res, MAX_Res * SCL_Res, MIN_Res * SCL_Res); mResS->SetMinSize(wxSize(100, -1)); @@ -289,9 +290,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) &mFreqOfs, NumValidatorStyle::DEFAULT, MIN_FreqOfs, MAX_FreqOfs) .AddTextBox(_("Wah Frequency Offse&t (%):"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mFreqOfsS = S.Id(ID_FreqOfs) .Name(XO("Wah frequency offset in percent")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_FreqOfs * SCL_FreqOfs, MAX_FreqOfs * SCL_FreqOfs, MIN_FreqOfs * SCL_FreqOfs); mFreqOfsT->SetMinSize(wxSize(100, -1)); @@ -300,9 +301,9 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S) 1, &mOutGain, NumValidatorStyle::DEFAULT, MIN_OutGain, MAX_OutGain) .AddTextBox(_("&Output gain (dB):"), wxT(""), 12); - S.SetStyle(wxSL_HORIZONTAL); mOutGainS = S.Id(ID_OutGain) .Name(XO("Output gain (dB)")) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, DEF_OutGain * SCL_OutGain, MAX_OutGain * SCL_OutGain, MIN_OutGain * SCL_OutGain); mOutGainS->SetMinSize(wxSize(100, -1)); } diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index cfc48eb02..e05bd4c92 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -509,9 +509,8 @@ void AudioUnitEffectExportDialog::PopulateOrExchange(ShuttleGui & S) { S.StartStatic(_("Presets (may select multiple)")); { - S.SetStyle(wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | - wxLC_NO_SORT_HEADER); - mList = S + mList = S.Style(wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | + wxLC_NO_SORT_HEADER) .AddListControlReportMode( { _("Preset") } ); } S.EndStatic(); @@ -682,9 +681,8 @@ void AudioUnitEffectImportDialog::PopulateOrExchange(ShuttleGui & S) { S.StartStatic(_("Presets (may select multiple)")); { - S.SetStyle(wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | - wxLC_NO_SORT_HEADER); - mList = S + mList = S.Style(wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | + wxLC_NO_SORT_HEADER) .AddListControlReportMode( { _("Preset"), _("Location") } ); } S.EndStatic(); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 12d1744a9..82dc0387c 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2606,8 +2606,8 @@ void NyquistEffect::BuildPromptWindow(ShuttleGui & S) void NyquistEffect::BuildEffectWindow(ShuttleGui & S) { - S.SetStyle(wxVSCROLL | wxTAB_TRAVERSAL); - wxScrolledWindow *scroller = S.StartScroller(2); + wxScrolledWindow *scroller = S.Style(wxVSCROLL | wxTAB_TRAVERSAL) + .StartScroller(2); { S.StartMultiColumn(4); { @@ -2735,8 +2735,9 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) if (ctrl.type == NYQ_CTRL_INT || ctrl.type == NYQ_CTRL_FLOAT) { - S.SetStyle(wxSL_HORIZONTAL); - S.Id(ID_Slider + i).AddSlider( {}, 0, ctrl.ticks, 0); + S.Id(ID_Slider + i) + .Style(wxSL_HORIZONTAL) + .AddSlider( {}, 0, ctrl.ticks, 0); S.SetSizeHints(150, -1); } } diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index b2e01d3f6..95a380f85 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -547,8 +547,8 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mChoices.reinit( count ); mValues.reinit( count ); - S.SetStyle(wxVSCROLL | wxTAB_TRAVERSAL); - wxScrolledWindow *scroller = S.StartScroller(2); + wxScrolledWindow *scroller = S.Style(wxVSCROLL | wxTAB_TRAVERSAL) + .StartScroller(2); { S.StartStatic(_("Plugin Settings")); { @@ -671,10 +671,10 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) wxString str = Internat::ToDisplayString(mParameters[p].minValue); S.AddPrompt(str); - S.SetStyle(wxSL_HORIZONTAL); S.Id(ID_Sliders + p); mSliders[p] = S.ToolTip( TranslatableString{ tip } ) .Name( TranslatableString{ labelText } ) + .Style(wxSL_HORIZONTAL) .AddSlider( {}, 0, 1000, 0); mSliders[p]->SetSizeHints(150, -1); diff --git a/src/menus/HelpMenus.cpp b/src/menus/HelpMenus.cpp index 4ff226cae..be161aa2c 100644 --- a/src/menus/HelpMenus.cpp +++ b/src/menus/HelpMenus.cpp @@ -45,8 +45,9 @@ void ShowDiagnostics( wxTextCtrl *text; S.StartVerticalLay(); { - S.SetStyle(wxTE_MULTILINE | wxTE_READONLY); - text = S.Id(wxID_STATIC).AddTextWindow(info); + text = S.Id(wxID_STATIC) + .Style(wxTE_MULTILINE | wxTE_READONLY) + .AddTextWindow(info); S.AddStandardButtons(eOkButton | eCancelButton); } S.EndVerticalLay(); diff --git a/src/widgets/HelpSystem.cpp b/src/widgets/HelpSystem.cpp index f3b54e89a..4cbe9125d 100644 --- a/src/widgets/HelpSystem.cpp +++ b/src/widgets/HelpSystem.cpp @@ -106,9 +106,9 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent, S.StartVerticalLay(1); { S.AddTitle( shortMsg); - S.SetStyle( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | - wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL ); - S.AddTextWindow(message); + S.Style( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 | + wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL ) + .AddTextWindow(message); S.SetBorder( 0 ); S.StartHorizontalLay(wxALIGN_CENTER_HORIZONTAL, 0); @@ -160,8 +160,9 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent, pFrame->SetTransparent(0); ShuttleGui S( pWnd, eIsCreating ); - S.SetStyle( wxNO_BORDER | wxTAB_TRAVERSAL ); - wxPanel *pPan = S.Prop(true).StartPanel(); + wxPanel *pPan = S.Style( wxNO_BORDER | wxTAB_TRAVERSAL ) + .Prop(true) + .StartPanel(); { S.StartHorizontalLay( wxEXPAND, false ); {