From 0cf90d65e665661271fcaa19e33d0e6fa92711f9 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 20 Oct 2017 12:45:27 -0400 Subject: [PATCH 1/6] S.GetParent() for all windows passed to ShuttleGui::AddWindow()... ... Verified that this makes no real change. --- src/FreqWindow.cpp | 16 ++++++++-------- src/LabelDialog.cpp | 2 +- src/effects/Equalization.cpp | 8 +++----- src/effects/Equalization.h | 2 +- src/effects/ScienFilter.cpp | 10 ++++------ src/prefs/PrefsDialog.cpp | 4 ++-- src/tracks/labeltrack/ui/LabelTrackControls.cpp | 4 ++-- src/widgets/ASlider.cpp | 2 +- src/widgets/HelpSystem.cpp | 4 ++-- 9 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index f5d3ed798..6729bc1d5 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -292,7 +292,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.StartVerticalLay(2); { vRuler = safenew RulerPanel( - this, wxID_ANY, wxVERTICAL, + S.GetParent(), wxID_ANY, wxVERTICAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ 0.0, -dBRange }, Ruler::LinearDBFormat, @@ -310,7 +310,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, } S.EndVerticalLay(); - mFreqPlot = safenew FreqPlot(this, wxID_ANY); + mFreqPlot = safenew FreqPlot(S.GetParent(), wxID_ANY); S.Prop(1) .Position(wxEXPAND) .MinSize( { wxDefaultCoord, FREQ_WINDOW_HEIGHT } ) @@ -320,7 +320,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, { S.StartVerticalLay(); { - mPanScroller = safenew wxScrollBar(this, FreqPanScrollerID, + mPanScroller = safenew wxScrollBar(S.GetParent(), FreqPanScrollerID, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control @@ -336,13 +336,13 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.StartVerticalLay(); { - wxStaticBitmap *zi = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomIn)); + wxStaticBitmap *zi = safenew wxStaticBitmap(S.GetParent(), wxID_ANY, wxBitmap(ZoomIn)); S.Position(wxALIGN_CENTER) .AddWindow(zi); S.AddSpace(5); - mZoomSlider = safenew wxSliderWrapper(this, FreqZoomSliderID, 100, 1, 100, + mZoomSlider = safenew wxSliderWrapper(S.GetParent(), FreqZoomSliderID, 100, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL); S.Prop(1); S @@ -356,7 +356,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.AddSpace(5); - wxStaticBitmap *zo = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomOut)); + wxStaticBitmap *zo = safenew wxStaticBitmap(S.GetParent(), wxID_ANY, wxBitmap(ZoomOut)); S.Position(wxALIGN_CENTER) .AddWindow(zo); } @@ -375,7 +375,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.StartHorizontalLay(wxEXPAND, 0); { hRuler = safenew RulerPanel( - this, wxID_ANY, wxHORIZONTAL, + S.GetParent(), wxID_ANY, wxHORIZONTAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ 10, 20000 }, Ruler::RealFormat, @@ -508,7 +508,7 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.AddSpace(5); - mProgress = safenew FreqGauge(this, wxID_ANY); //, wxST_SIZEGRIP); + mProgress = safenew FreqGauge(S.GetParent(), wxID_ANY); //, wxST_SIZEGRIP); S.Position(wxEXPAND) .AddWindow(mProgress); diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 22a6031a3..e84688d81 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -255,7 +255,7 @@ void LabelDialog::PopulateOrExchange( ShuttleGui & S ) { S.StartVerticalLay(wxEXPAND,1); { - mGrid = safenew Grid(this, wxID_ANY); + mGrid = safenew Grid(S.GetParent(), wxID_ANY); S.Prop(1).AddWindow( mGrid ); } S.EndVerticalLay(); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 7b26b5e47..fa609b651 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -725,8 +725,6 @@ bool EffectEqualization::CloseUI() void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { - wxWindow *const parent = S.GetParent(); - //LoadCurves(); auto trackList = inputTracks(); @@ -770,7 +768,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartVerticalLay(wxEXPAND, 1); { mdBRuler = safenew RulerPanel( - parent, wxID_ANY, wxVERTICAL, + S.GetParent(), wxID_ANY, wxVERTICAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ 60.0, -120.0 }, Ruler::LinearDBFormat, @@ -789,7 +787,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) } S.EndVerticalLay(); - mPanel = safenew EqualizationPanel(parent, wxID_ANY, this); + mPanel = safenew EqualizationPanel(S.GetParent(), wxID_ANY, this); S.Prop(1) .Position(wxEXPAND) .MinSize( { wxDefaultCoord, wxDefaultCoord } ) @@ -827,7 +825,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.AddSpace(1, 1); mFreqRuler = safenew RulerPanel( - parent, wxID_ANY, wxHORIZONTAL, + S.GetParent(), wxID_ANY, wxHORIZONTAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ mLoFreq, mHiFreq }, Ruler::IntFormat, diff --git a/src/effects/Equalization.h b/src/effects/Equalization.h index 4a38f522d..a71e40ca0 100644 --- a/src/effects/Equalization.h +++ b/src/effects/Equalization.h @@ -263,7 +263,7 @@ private: wxSizerItem *mLeftSpacer; EqualizationPanel *mPanel; - wxPanel *mGraphicPanel; + //wxPanel *mGraphicPanel; wxRadioButton *mDraw; wxRadioButton *mGraphic; wxCheckBox *mLinFreq; diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp index ce1e44d6b..09acac3b3 100644 --- a/src/effects/ScienFilter.cpp +++ b/src/effects/ScienFilter.cpp @@ -359,8 +359,6 @@ bool EffectScienFilter::Init() void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) { - wxWindow *const parent = S.GetParent(); - S.AddSpace(5); S.SetSizerProportion(1); S.StartMultiColumn(3, wxEXPAND); @@ -375,7 +373,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) S.StartVerticalLay(); { mdBRuler = safenew RulerPanel( - parent, wxID_ANY, wxVERTICAL, + S.GetParent(), wxID_ANY, wxVERTICAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ 30.0, -120.0 }, Ruler::LinearDBFormat, @@ -394,7 +392,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) S.EndVerticalLay(); mPanel = safenew EffectScienFilterPanel( - parent, wxID_ANY, + S.GetParent(), wxID_ANY, this, mLoFreq, mNyquist ); @@ -432,8 +430,8 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) S.AddSpace(1, 1); - mfreqRuler = safenew RulerPanel( - parent, wxID_ANY, wxHORIZONTAL, + mfreqRuler = safenew RulerPanel( + S.GetParent(), wxID_ANY, wxHORIZONTAL, wxSize{ 100, 100 }, // Ruler can't handle small sizes RulerPanel::Range{ mLoFreq, mNyquist }, Ruler::IntFormat, diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index 26ac6b555..a72fe325d 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -551,7 +551,7 @@ PrefsDialog::PrefsDialog { wxASSERT(factories.size() > 0); if (!uniquePage) { - mCategories = safenew wxTreebookExt(this, wxID_ANY, mTitlePrefix); + mCategories = safenew wxTreebookExt(S.GetParent(), wxID_ANY, mTitlePrefix); #if wxUSE_ACCESSIBILITY // so that name can be set on a standard control mCategories->GetTreeCtrl()->SetAccessible( @@ -602,7 +602,7 @@ PrefsDialog::PrefsDialog // Unique page, don't show the factory const PrefsNode &node = factories[0]; const PrefsPanel::Factory &factory = node.factory; - mUniquePage = factory(this, wxID_ANY); + mUniquePage = factory(S.GetParent(), wxID_ANY); wxWindow * uniquePageWindow = S.Prop(1) .Position(wxEXPAND) .AddWindow(mUniquePage); diff --git a/src/tracks/labeltrack/ui/LabelTrackControls.cpp b/src/tracks/labeltrack/ui/LabelTrackControls.cpp index f522e8260..ed08dd0ba 100644 --- a/src/tracks/labeltrack/ui/LabelTrackControls.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackControls.cpp @@ -125,7 +125,7 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) /* i18n-hint: (noun) The name of the typeface*/ S.AddPrompt(_("Face name")); - lb = safenew wxListBox(&dlg, wxID_ANY, + lb = safenew wxListBox(S.GetParent(), wxID_ANY, wxDefaultPosition, wxDefaultSize, facenames, @@ -139,7 +139,7 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) /* i18n-hint: (noun) The size of the typeface*/ S.AddPrompt(_("Face size")); - sc = safenew wxSpinCtrl(&dlg, wxID_ANY, + sc = safenew wxSpinCtrl(S.GetParent(), wxID_ANY, wxString::Format(wxT("%ld"), fontsize), wxDefaultPosition, wxDefaultSize, diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index f424225bc..1403226df 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -283,7 +283,7 @@ SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id, mTextCtrl = S.Validator(wxFILTER_NUMERIC) .AddTextBox( {}, wxEmptyString, 15); - mSlider = safenew ASlider(this, + mSlider = safenew ASlider(S.GetParent(), wxID_ANY, title, wxDefaultPosition, diff --git a/src/widgets/HelpSystem.cpp b/src/widgets/HelpSystem.cpp index df724f010..9e4141fe3 100644 --- a/src/widgets/HelpSystem.cpp +++ b/src/widgets/HelpSystem.cpp @@ -160,7 +160,7 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent, pFrame->SetTransparent(0); ShuttleGui S( pWnd, eIsCreating ); - wxPanel *pPan = S.Style( wxNO_BORDER | wxTAB_TRAVERSAL ) + S.Style( wxNO_BORDER | wxTAB_TRAVERSAL ) .Prop(true) .StartPanel(); { @@ -181,7 +181,7 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent, } S.EndHorizontalLay(); - html = safenew LinkingHtmlWindow(pPan, wxID_ANY, + html = safenew LinkingHtmlWindow(S.GetParent(), wxID_ANY, wxDefaultPosition, bIsFile ? wxSize(500, 400) : wxSize(480, 240), wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER); From 1802b9316e9c418e06fceb0598c8a4a124444042 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 27 Oct 2017 14:38:26 -0400 Subject: [PATCH 2/6] ShuttleGui::AddStandardButtons takes more general wxWindow *extra... ... This will be needed to rewrite the EffectUIHost dialog --- src/ShuttleGui.cpp | 2 +- src/ShuttleGui.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 896527e92..3aaa4bcd9 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -2381,7 +2381,7 @@ std::unique_ptr CreateStdButtonSizer(wxWindow *parent, long buttons, wx return std::unique_ptr{ s.release() }; } -void ShuttleGui::AddStandardButtons(long buttons, wxButton *extra) +void ShuttleGui::AddStandardButtons(long buttons, wxWindow *extra) { if( mShuttleMode != eIsCreating ) return; diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index f74d48bcf..054238e8d 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -697,7 +697,7 @@ public: // The first of these buttons, if any, that is included will be default: // Apply, Yes, OK void AddStandardButtons( - long buttons = eOkButton | eCancelButton, wxButton *extra = NULL ); + long buttons = eOkButton | eCancelButton, wxWindow *extra = NULL ); wxSizerItem * AddSpace( int width, int height ); wxSizerItem * AddSpace( int size ) { return AddSpace( size, size ); }; From 3b69a038c847478881d8b3dade92781524a4cb03 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 20 Oct 2017 10:45:04 -0400 Subject: [PATCH 3/6] Add ShuttleGui functions to make simple book controls... ... analogous to StartNotebook() and EndNotebook() This will be needed to rewrite export dialogs --- src/ShuttleGui.cpp | 26 ++++++++++++++++++++++++-- src/ShuttleGui.h | 6 ++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 3aaa4bcd9..cdec607bb 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -107,6 +107,7 @@ for registering for changes. #include #include #include +#include #include #include #include @@ -977,12 +978,33 @@ void ShuttleGuiBase::EndNotebook() } +wxSimplebook * ShuttleGuiBase::StartSimplebook() +{ + UseUpId(); + if( mShuttleMode != eIsCreating ) + return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSimplebook); + wxSimplebook * pNotebook; + mpWind = pNotebook = safenew wxSimplebook(GetParent(), + miId, wxDefaultPosition, wxDefaultSize, GetStyle( 0 )); + SetProportions( 1 ); + UpdateSizers(); + mpParent = pNotebook; + return pNotebook; +} + +void ShuttleGuiBase::EndSimplebook() +{ + //PopSizer(); + mpParent = mpParent->GetParent(); +} + + wxNotebookPage * ShuttleGuiBase::StartNotebookPage( const wxString & Name ) { if( mShuttleMode != eIsCreating ) return NULL; // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx); - wxNotebook * pNotebook = (wxNotebook*)mpParent; + auto pNotebook = static_cast< wxBookCtrlBase* >( mpParent ); wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent()); pPage->SetName(Name); @@ -1004,7 +1026,7 @@ void ShuttleGuiBase::StartNotebookPage( const wxString & Name, wxNotebookPage * if( mShuttleMode != eIsCreating ) return; // return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx); - wxNotebook * pNotebook = (wxNotebook*)mpParent; + auto pNotebook = static_cast< wxBookCtrlBase* >( mpParent ); // wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent()); pPage->Create( mpParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel")); pPage->SetName(Name); diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 054238e8d..9f047f7d8 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -58,6 +58,7 @@ class wxTreeCtrl; class wxTextCtrl; class wxSlider; class wxNotebook; +class wxSimplebook; typedef wxWindow wxNotebookPage; // so far, any window can be a page class wxButton; class wxBitmapButton; @@ -360,11 +361,16 @@ public: wxNotebook * StartNotebook(); void EndNotebook(); + wxSimplebook * StartSimplebook(); + void EndSimplebook(); + + // Use within any kind of book control: // IDs of notebook pages cannot be chosen by the caller wxNotebookPage * StartNotebookPage( const wxString & Name ); void StartNotebookPage( const wxString & Name, wxNotebookPage * pPage ); void EndNotebookPage(); + wxPanel * StartInvisiblePanel(); void EndInvisiblePanel(); From bb3159c7586410feed08061496f5fb0d9963715c Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 9 Dec 2019 11:06:27 -0500 Subject: [PATCH 4/6] Don't SetMinSize in ShuttleGui::StartNotebookPage... ... This could only affect the About dialog now, but does not have noticeable effects. StartNotebookPage will be reused for Export and Export Multiple dialogs, and the effects of this SetMinSize call would be undesirable for them. --- src/ShuttleGui.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index cdec607bb..72bb0bfba 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -1016,7 +1016,6 @@ wxNotebookPage * ShuttleGuiBase::StartNotebookPage( const wxString & Name ) mpParent = pPage; pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL)); PushSizer(); - mpSizer->SetMinSize(250, 500); // UpdateSizers(); return pPage; } @@ -1039,7 +1038,6 @@ void ShuttleGuiBase::StartNotebookPage( const wxString & Name, wxNotebookPage * mpParent = pPage; pPage->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL)); PushSizer(); - mpSizer->SetMinSize(250, 500); // UpdateSizers(); } From f825c32a504eaab86cfc4c6629130f801f4c1817 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 10 Dec 2019 09:04:05 -0500 Subject: [PATCH 5/6] ShuttleGui can specify orientation and minimum size... ... This will be needed for rewrite of EffectUIHost dialog --- src/ShuttleGui.cpp | 19 +++++++++++-------- src/ShuttleGui.h | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 72bb0bfba..42d9d1388 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -120,21 +120,22 @@ for registering for changes. #include "widgets/WindowAccessible.h" #endif -ShuttleGuiBase::ShuttleGuiBase(wxWindow * pParent, teShuttleMode ShuttleMode ) +ShuttleGuiBase::ShuttleGuiBase( + wxWindow * pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize ) : mpDlg{ pParent } { wxASSERT( (pParent != NULL ) || ( ShuttleMode != eIsCreating)); mpbOptionalFlag = nullptr; mpParent = pParent; mShuttleMode = ShuttleMode; - Init(); + Init( vertical, minSize ); } ShuttleGuiBase::~ShuttleGuiBase() { } -void ShuttleGuiBase::Init() +void ShuttleGuiBase::Init(bool vertical, wxSize minSize) { mpShuttle = NULL; mpSizer = NULL; @@ -172,10 +173,11 @@ void ShuttleGuiBase::Init() if( !mpSizer ) { - mpParent->SetSizer(mpSizer = safenew wxBoxSizer(wxVERTICAL)); + mpParent->SetSizer( + mpSizer = safenew wxBoxSizer(vertical ? wxVERTICAL : wxHORIZONTAL)); } PushSizer(); - mpSizer->SetMinSize(250,100); + mpSizer->SetMinSize(minSize); } void ShuttleGuiBase::ResetId() @@ -2198,13 +2200,14 @@ void SetIfCreated( wxStaticText *&Var, wxStaticText * Val ) #include "../extnpanel-src/GuiWaveTrack.h" #endif -ShuttleGui::ShuttleGui(wxWindow * pParent, teShuttleMode ShuttleMode) : - ShuttleGuiBase( pParent, ShuttleMode ) +ShuttleGui::ShuttleGui( + wxWindow * pParent, teShuttleMode ShuttleMode, bool vertical, wxSize minSize) + : ShuttleGuiBase( pParent, ShuttleMode, vertical, minSize ) { if( ShuttleMode == eIsCreatingFromPrefs ) { mShuttleMode = eIsCreating; - Init(); // Wasn't fully done in base constructor because it is only done when eIsCreating is set. + Init( vertical, minSize ); // Wasn't fully done in base constructor because it is only done when eIsCreating is set. } else if( ShuttleMode == eIsSavingToPrefs ) { diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 9f047f7d8..59a167e44 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -256,9 +256,14 @@ struct Item { class AUDACITY_DLL_API ShuttleGuiBase /* not final */ { public: - ShuttleGuiBase(wxWindow * pParent,teShuttleMode ShuttleMode); + ShuttleGuiBase( + wxWindow * pParent, + teShuttleMode ShuttleMode, + bool vertical, // Choose layout direction of topmost level sizer + wxSize minSize + ); virtual ~ShuttleGuiBase(); - void Init(); + void Init( bool vertical, wxSize minSize ); void ResetId(); //-- Add functions. These only add a widget or 2. @@ -596,7 +601,11 @@ AUDACITY_DLL_API std::unique_ptr CreateStdButtonSizer( wxWindow *parent class AUDACITY_DLL_API ShuttleGui /* not final */ : public ShuttleGuiBase { public: - ShuttleGui(wxWindow * pParent,teShuttleMode ShuttleMode); + ShuttleGui( + wxWindow * pParent, teShuttleMode ShuttleMode, + bool vertical = true, // Choose layout direction of topmost level sizer + wxSize minSize = { 250, 100 } + ); ~ShuttleGui(void); public: ShuttleGui & Optional( bool & bVar ); From 7d38500ecf340582b34bb725342dc5ad3735d240 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 26 Oct 2017 23:34:42 -0400 Subject: [PATCH 6/6] ShuttleGui::AddSpace takes prop argument... ... This will be needed to rewrite EffectRack --- src/ShuttleGui.cpp | 9 ++++++--- src/ShuttleGui.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 42d9d1388..42bd79f00 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -2419,12 +2419,15 @@ void ShuttleGui::AddStandardButtons(long buttons, wxWindow *extra) EndVerticalLay(); } -wxSizerItem * ShuttleGui::AddSpace( int width, int height ) +wxSizerItem * ShuttleGui::AddSpace( int width, int height, int prop ) { if( mShuttleMode != eIsCreating ) return NULL; - SetProportions(0); - return mpSizer->Add( width, height, miProp); + +// SetProportions(0); + // return mpSizer->Add( width, height, miProp); + + return mpSizer->Add( width, height, prop ); } void ShuttleGui::SetMinSize( wxWindow *window, const wxArrayStringEx & items ) diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 59a167e44..d8ea8f4e5 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -714,7 +714,7 @@ public: void AddStandardButtons( long buttons = eOkButton | eCancelButton, wxWindow *extra = NULL ); - wxSizerItem * AddSpace( int width, int height ); + wxSizerItem * AddSpace( int width, int height, int prop = 0 ); wxSizerItem * AddSpace( int size ) { return AddSpace( size, size ); }; // Calculate width of a choice control adequate for the items, maybe after