diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index b05a551cd..a6dcbf773 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -1396,6 +1396,7 @@ wxChoice * ShuttleGuiBase::TieChoice( wxASSERT( false ); break; } + SetSizeHints(*pChoices); return pChoice; } @@ -2307,7 +2308,7 @@ wxSizerItem * ShuttleGui::AddSpace( int width, int height ) return mpSizer->Add( width, height, miProp); } -void ShuttleGui::SetSizeHints( wxWindow *window, const wxArrayString & items ) +void ShuttleGuiBase::SetSizeHints( wxWindow *window, const wxArrayString & items ) { int maxw = 0; @@ -2338,19 +2339,7 @@ void ShuttleGui::SetSizeHints( wxWindow *window, const wxArrayString & items ) window->SetSizeHints( maxw, -1 ); } -void ShuttleGui::SetSizeHints( wxWindow *window, const std::vector & items ) -{ - wxArrayString strs; - - for( size_t i = 0; i < items.size(); i++ ) - { - strs.Add( wxString::Format( wxT("%d"), items[i] ) ); - } - - SetSizeHints( window, strs ); -} - -void ShuttleGui::SetSizeHints( const wxArrayString & items ) +void ShuttleGuiBase::SetSizeHints( const wxArrayString & items ) { if( mShuttleMode != eIsCreating ) return; @@ -2358,19 +2347,6 @@ void ShuttleGui::SetSizeHints( const wxArrayString & items ) SetSizeHints( mpLastWind, items ); } -void ShuttleGui::SetSizeHints( const std::vector & items ) -{ - if( mShuttleMode != eIsCreating ) - return; - - SetSizeHints( mpLastWind, items ); -} - -void ShuttleGui::SetSizeHints( int minX, int minY ) -{ - ShuttleGuiBase::SetSizeHints( minX, minY ); -} - /********************************* GetDefinition ******************************/ ShuttleGuiGetDefinition::ShuttleGuiGetDefinition( diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 0f64f526d..bdd96c7e0 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -288,6 +288,12 @@ protected: long Style( long Style ); +private: + void SetSizeHints( const wxArrayString & items ); +public: + static void SetSizeHints( wxWindow *window, const wxArrayString & items ); + +protected: wxWindow * mpLastWind; wxWindow * mpDlg; wxSizer * pSizerStack[ nMaxNestedSizers ]; @@ -389,12 +395,6 @@ public: wxSizerItem * AddSpace( int width, int height ); wxSizerItem * AddSpace( int size ) { return AddSpace( size, size ); }; - void SetSizeHints( int minX = -1, int minY = -1 ); - void SetSizeHints( const wxArrayString & items ); - void SetSizeHints( const std::vector & items ); - static void SetSizeHints( wxWindow *window, const wxArrayString & items ); - static void SetSizeHints( wxWindow *window, const std::vector & items ); - teShuttleMode GetMode() { return mShuttleMode; }; }; diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 23bf2d6e5..f7e04afac 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -123,7 +123,6 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) wxT(""), mHostNames, mHostLabels); - S.SetSizeHints(mHostNames); S.AddPrompt(_("Using:")); S.AddFixedText(wxString(wxSafeConvertMB2WX(Pa_GetVersionText()))); diff --git a/src/prefs/GUIPrefs.cpp b/src/prefs/GUIPrefs.cpp index 9aab79262..344e8e533 100644 --- a/src/prefs/GUIPrefs.cpp +++ b/src/prefs/GUIPrefs.cpp @@ -142,28 +142,24 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S) wxT(""), mLangNames, mLangCodes); - S.SetSizeHints(mLangNames); S.TieChoice(_("Location of &Manual:"), wxT("/GUI/Help"), wxT("Local"), mHtmlHelpChoices, mHtmlHelpCodes); - S.SetSizeHints(mHtmlHelpChoices); S.TieChoice(_("Th&eme:"), wxT("/GUI/Theme"), defaultTheme, mThemeChoices, mThemeCodes); - S.SetSizeHints(mThemeChoices); S.TieChoice(_("Meter dB &range:"), ENV_DB_KEY, defaultRange, mRangeChoices, mRangeCodes); - S.SetSizeHints(mRangeChoices); } S.EndMultiColumn(); // S.AddSpace(10); diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 9f337613c..c8a4629b8 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -128,7 +128,6 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) { wxT(""), mHostNames, mHostLabels); - S.SetSizeHints(mHostNames); S.AddPrompt(_("Using: PortMidi")); } diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index e2a82ab9d..9b1ebd927 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -140,7 +140,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) AudioIO::GetOptimalSupportedSampleRate(), mSampleRateNames, mSampleRateLabels); - S.SetSizeHints(mSampleRateNames); // Now do the edit box... mOtherSampleRate = S.TieNumericTextBox( {}, @@ -154,7 +153,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) floatSample, mSampleFormatNames, mSampleFormatLabels); - S.SetSizeHints(mSampleFormatNames); } S.EndMultiColumn(); } @@ -169,7 +167,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) Resample::GetFastMethodDefault(), mConverterNames, mConverterLabels); - S.SetSizeHints(mConverterNames); /* i18n-hint: technical term for randomization to reduce undesirable resampling artifacts */ S.TieChoice(_("&Dither:"), @@ -177,7 +174,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) Dither::none, mDitherNames, mDitherLabels); - S.SetSizeHints(mDitherNames); } S.EndMultiColumn(); } @@ -192,7 +188,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) Resample::GetBestMethodDefault(), mConverterNames, mConverterLabels); - S.SetSizeHints(mConverterNames); /* i18n-hint: technical term for randomization to reduce undesirable resampling artifacts */ S.TieChoice(_("Dit&her:"), @@ -200,7 +195,6 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) Dither::shaped, mDitherNames, mDitherLabels); - S.SetSizeHints(mDitherNames); } S.EndMultiColumn(); } diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 527982bcc..e5b5eb3f4 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -232,19 +232,16 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"), mTempSettings.windowSize, &mSizeChoices); - S.SetSizeHints(mSizeChoices); S.Id(ID_WINDOW_TYPE).TieChoice(_("Window &type:"), mTempSettings.windowType, &mTypeChoices); - S.SetSizeHints(mTypeChoices); #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS mZeroPaddingChoiceCtrl = S.Id(ID_PADDING_SIZE).TieChoice(_("&Zero padding factor") + wxString(wxT(":")), mTempSettings.zeroPaddingFactor, &mZeroPaddingChoices); - S.SetSizeHints(mZeroPaddingChoices); #endif } S.EndMultiColumn(); diff --git a/src/prefs/TracksBehaviorsPrefs.cpp b/src/prefs/TracksBehaviorsPrefs.cpp index edc736ba9..d4917e399 100644 --- a/src/prefs/TracksBehaviorsPrefs.cpp +++ b/src/prefs/TracksBehaviorsPrefs.cpp @@ -100,7 +100,6 @@ void TracksBehaviorsPrefs::PopulateOrExchange(ShuttleGui & S) wxT("Standard"), mSoloChoices, mSoloCodes); - S.SetSizeHints(mSoloChoices); } S.EndMultiColumn(); } diff --git a/src/prefs/TracksPrefs.cpp b/src/prefs/TracksPrefs.cpp index c4c419e02..c076cdfef 100644 --- a/src/prefs/TracksPrefs.cpp +++ b/src/prefs/TracksPrefs.cpp @@ -157,14 +157,12 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) 0, mViewChoices, mViewCodes); - S.SetSizeHints(mViewChoices); S.TieChoice(_("Display &samples:"), wxT("/GUI/SampleView"), 1, mSampleDisplayChoices, mSampleDisplayCodes); - S.SetSizeHints(mSampleDisplayChoices); S.TieTextBox(_("Default audio track &name:"), wxT("/GUI/TrackNames/DefaultTrackName"), @@ -184,14 +182,12 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S) WaveTrack::kZoomDefault, mZoomChoices, mZoomCodes); - S.SetSizeHints(mZoomChoices); S.TieChoice(_("Preset 2:"), wxT("/GUI/ZoomPreset2"), WaveTrack::kZoom4To1, mZoomChoices, mZoomCodes); - S.SetSizeHints(mZoomChoices); } } S.EndStatic(); diff --git a/src/prefs/WaveformPrefs.cpp b/src/prefs/WaveformPrefs.cpp index 2c6e0ded7..648355c7a 100644 --- a/src/prefs/WaveformPrefs.cpp +++ b/src/prefs/WaveformPrefs.cpp @@ -99,7 +99,6 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S) S.Id(ID_RANGE).TieChoice(_("Waveform dB &range") + wxString(wxT(":")), mTempSettings.dBRange, &mRangeChoices); - S.SetSizeHints(mRangeChoices); } S.EndTwoColumn(); }