Remove second argument of AddWindow(), use Position() instead

This commit is contained in:
Paul Licameli 2017-10-31 19:44:00 -04:00
parent b5ee7676fd
commit 96291c5476
22 changed files with 120 additions and 55 deletions

View File

@ -993,7 +993,7 @@ void NyqBench::PopulateOrExchange(ShuttleGui & S)
S.AddSpace(5, 1); S.AddSpace(5, 1);
S.Prop(true); S.Prop(true);
S.AddWindow(mSplitter, wxEXPAND); S.Position(wxEXPAND).AddWindow(mSplitter);
S.AddSpace(5, 1); S.AddSpace(5, 1);
mSplitter->SetMinSize(wxSize(600, 400)); mSplitter->SetMinSize(wxSize(600, 400));

View File

@ -396,7 +396,8 @@ visit our [[https://forum.audacityteam.org/|forum]].");
html->SetPage(creditStr); html->SetPage(creditStr);
/* locate the html renderer where it fits in the dialogue */ /* locate the html renderer where it fits in the dialogue */
S.Prop(1).Focus().AddWindow( html, wxEXPAND ); S.Prop(1).Position( wxEXPAND ).Focus()
.AddWindow( html );
S.EndVerticalLay(); S.EndVerticalLay();
S.EndNotebookPage(); S.EndNotebookPage();
@ -650,7 +651,9 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )
informationStr = FormatHtmlText( informationStr ); informationStr = FormatHtmlText( informationStr );
html->SetPage(informationStr); // push the page into the html renderer html->SetPage(informationStr); // push the page into the html renderer
S.Prop(2).AddWindow( html, wxEXPAND ); // make it fill the page S.Prop(2)
.Position( wxEXPAND )
.AddWindow( html ); // make it fill the page
// I think the 2 here goes with the StartVerticalLay() call above? // I think the 2 here goes with the StartVerticalLay() call above?
S.EndVerticalLay(); // end window S.EndVerticalLay(); // end window
S.EndNotebookPage(); // end the tab S.EndNotebookPage(); // end the tab
@ -958,7 +961,9 @@ wxT("POSSIBILITY OF SUCH DAMAGES.\n"));
html->SetPage( PageText ); html->SetPage( PageText );
S.Prop(1).AddWindow( html, wxEXPAND ); S.Prop(1)
.Position( wxEXPAND )
.AddWindow( html );
S.EndVerticalLay(); S.EndVerticalLay();
S.EndNotebookPage(); S.EndNotebookPage();

View File

@ -303,16 +303,18 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
); );
S.AddSpace(wxDefaultCoord, 1); S.AddSpace(wxDefaultCoord, 1);
S.Prop(1); S.Prop(1)
S.AddWindow(vRuler, wxALIGN_RIGHT | wxALIGN_TOP); .Position(wxALIGN_RIGHT | wxALIGN_TOP)
.AddWindow(vRuler);
S.AddSpace(wxDefaultCoord, 1); S.AddSpace(wxDefaultCoord, 1);
} }
S.EndVerticalLay(); S.EndVerticalLay();
mFreqPlot = safenew FreqPlot(this, wxID_ANY); mFreqPlot = safenew FreqPlot(this, wxID_ANY);
S.Prop(1) S.Prop(1)
.Position(wxEXPAND)
.MinSize( { wxDefaultCoord, FREQ_WINDOW_HEIGHT } ) .MinSize( { wxDefaultCoord, FREQ_WINDOW_HEIGHT } )
.AddWindow(mFreqPlot, wxEXPAND); .AddWindow(mFreqPlot);
S.StartHorizontalLay(wxEXPAND, 0); S.StartHorizontalLay(wxEXPAND, 0);
{ {
@ -327,14 +329,16 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.Prop(1); S.Prop(1);
S S
.Name(XO("Scroll")) .Name(XO("Scroll"))
.AddWindow(mPanScroller, wxALIGN_LEFT | wxTOP); .Position( wxALIGN_LEFT | wxTOP)
.AddWindow(mPanScroller);
} }
S.EndVerticalLay(); S.EndVerticalLay();
S.StartVerticalLay(); S.StartVerticalLay();
{ {
wxStaticBitmap *zi = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomIn)); wxStaticBitmap *zi = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomIn));
S.AddWindow((wxWindow *) zi, wxALIGN_CENTER); S.Position(wxALIGN_CENTER)
.AddWindow(zi);
S.AddSpace(5); S.AddSpace(5);
@ -343,7 +347,8 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.Prop(1); S.Prop(1);
S S
.Name(XO("Zoom")) .Name(XO("Zoom"))
.AddWindow(mZoomSlider, wxALIGN_CENTER_HORIZONTAL); .Position(wxALIGN_CENTER_HORIZONTAL)
.AddWindow(mZoomSlider);
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control // so that name can be set on a standard control
mZoomSlider->SetAccessible(safenew WindowAccessible(mZoomSlider)); mZoomSlider->SetAccessible(safenew WindowAccessible(mZoomSlider));
@ -352,7 +357,8 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.AddSpace(5); S.AddSpace(5);
wxStaticBitmap *zo = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomOut)); wxStaticBitmap *zo = safenew wxStaticBitmap(this, wxID_ANY, wxBitmap(ZoomOut));
S.AddWindow((wxWindow *) zo, wxALIGN_CENTER); S.Position(wxALIGN_CENTER)
.AddWindow(zo);
} }
S.EndVerticalLay(); S.EndVerticalLay();
@ -382,8 +388,9 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
); );
S.AddSpace(1, wxDefaultCoord); S.AddSpace(1, wxDefaultCoord);
S.Prop(1); S.Prop(1)
S.AddWindow(hRuler, wxALIGN_LEFT | wxALIGN_TOP); .Position(wxALIGN_LEFT | wxALIGN_TOP)
.AddWindow(hRuler);
S.AddSpace(1, wxDefaultCoord); S.AddSpace(1, wxDefaultCoord);
} }
S.EndHorizontalLay(); S.EndHorizontalLay();
@ -502,7 +509,8 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.AddSpace(5); S.AddSpace(5);
mProgress = safenew FreqGauge(this, wxID_ANY); //, wxST_SIZEGRIP); mProgress = safenew FreqGauge(this, wxID_ANY); //, wxST_SIZEGRIP);
S.AddWindow(mProgress, wxEXPAND); S.Position(wxEXPAND)
.AddWindow(mProgress);
// Log-frequency axis works for spectrum plots only. // Log-frequency axis works for spectrum plots only.
if (mAlg != SpectrumAnalyst::Spectrum) if (mAlg != SpectrumAnalyst::Spectrum)

View File

@ -271,13 +271,13 @@ void ShuttleGuiBase::AddTitle(const wxString &Prompt)
/// Very generic 'Add' function. We can add anything we like. /// Very generic 'Add' function. We can add anything we like.
/// Useful for unique controls /// Useful for unique controls
wxWindow * ShuttleGuiBase::AddWindow(wxWindow * pWindow, int Flags ) wxWindow * ShuttleGuiBase::AddWindow(wxWindow * pWindow)
{ {
if( mShuttleMode != eIsCreating ) if( mShuttleMode != eIsCreating )
return pWindow; return pWindow;
mpWind = pWindow; mpWind = pWindow;
SetProportions( 0 ); SetProportions( 0 );
UpdateSizersCore(false, Flags); UpdateSizersCore(false, wxALIGN_CENTRE | wxALL);
return pWindow; return pWindow;
} }
@ -2042,14 +2042,20 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt)
{ {
if( mpWind && mpParent ) if( mpWind && mpParent )
{ {
int useFlags = Flags;
if ( !prompt && mItem.mWindowPositionFlags )
// override the given Flags
useFlags = mItem.mWindowPositionFlags;
if( mpSizer){ if( mpSizer){
if( bPrepend ) if( bPrepend )
{ {
mpSizer->Prepend(mpWind, miProp, Flags,miBorder); mpSizer->Prepend(mpWind, miProp, useFlags, miBorder);
} }
else else
{ {
mpSizer->Add(mpWind, miProp, Flags,miBorder); mpSizer->Add(mpWind, miProp, useFlags, miBorder);
} }
} }

View File

@ -215,6 +215,12 @@ struct Item {
return std::move ( *this ); return std::move ( *this );
} }
Item&& Position( int flags ) &&
{
mWindowPositionFlags = flags;
return std::move( *this );
}
std::function< void(wxWindow*) > mValidatorSetter; std::function< void(wxWindow*) > mValidatorSetter;
TranslatableString mToolTip; TranslatableString mToolTip;
TranslatableString mName; TranslatableString mName;
@ -224,6 +230,9 @@ struct Item {
long miStyle{}; long miStyle{};
// Applies to windows, not to subsizers
int mWindowPositionFlags{ 0 };
wxSize mMinSize{ -1, -1 }; wxSize mMinSize{ -1, -1 };
bool mHasMinSize{ false }; bool mHasMinSize{ false };
bool mUseBestSize{ false }; bool mUseBestSize{ false };
@ -248,8 +257,8 @@ public:
void AddPrompt(const wxString &Prompt); void AddPrompt(const wxString &Prompt);
void AddUnits(const wxString &Prompt); void AddUnits(const wxString &Prompt);
void AddTitle(const wxString &Prompt); void AddTitle(const wxString &Prompt);
// Applies wxALL (which affects borders) only when in Flags: wxWindow * AddWindow(wxWindow * pWindow);
wxWindow * AddWindow(wxWindow * pWindow, int Flags = wxALIGN_CENTRE | wxALL );
wxSlider * AddSlider(const wxString &Prompt, int pos, int Max, int Min = 0); wxSlider * AddSlider(const wxString &Prompt, int pos, int Max, int Min = 0);
wxSlider * AddVSlider(const wxString &Prompt, int pos, int Max); wxSlider * AddVSlider(const wxString &Prompt, int pos, int Max);
wxSpinCtrl * AddSpinCtrl(const wxString &Prompt, int Value, int Max, int Min); wxSpinCtrl * AddSpinCtrl(const wxString &Prompt, int Value, int Max, int Min);
@ -648,6 +657,12 @@ public:
return *this; return *this;
} }
ShuttleGui & Position( int flags )
{
std::move( mItem ).Position( flags );
return *this;
}
// Prop() sets the proportion value, defined as in wxSizer::Add(). // 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 & Prop( int iProp ){ ShuttleGuiBase::Prop(iProp); return *this;}; // Has to be here too, to return a ShuttleGui and not a ShuttleGuiBase.

View File

@ -135,7 +135,9 @@ void SplashDialog::Populate( ShuttleGui & S )
wxSize(506, 280), wxSize(506, 280),
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER ); wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER );
mpHtml->SetPage(HelpText( wxT("welcome") )); mpHtml->SetPage(HelpText( wxT("welcome") ));
S.Prop(1).AddWindow( mpHtml, wxEXPAND ); S.Prop(1)
.Position( wxEXPAND )
.AddWindow( mpHtml );
S.Prop(0).StartMultiColumn(2, wxEXPAND); S.Prop(0).StartMultiColumn(2, wxEXPAND);
S.SetStretchyCol( 1 );// Column 1 is stretchy... S.SetStretchyCol( 1 );// Column 1 is stretchy...
{ {

View File

@ -925,8 +925,9 @@ void TagsEditor::PopulateOrExchange(ShuttleGui & S)
mGrid->SetColSize(0, tc.GetSize().x); mGrid->SetColSize(0, tc.GetSize().x);
mGrid->SetColMinimalWidth(0, tc.GetSize().x); mGrid->SetColMinimalWidth(0, tc.GetSize().x);
} }
S.Prop(1); S.Prop(1)
S.AddWindow(mGrid, wxEXPAND | wxALL); .Position(wxEXPAND | wxALL)
.AddWindow(mGrid);
S.StartMultiColumn(4, wxALIGN_CENTER); S.StartMultiColumn(4, wxALIGN_CENTER);
{ {

View File

@ -381,7 +381,8 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S)
S.ToolTip(XO("Current length of selection.")) S.ToolTip(XO("Current length of selection."))
/* i18n-hint: changing a quantity "from" one value "to" another */ /* i18n-hint: changing a quantity "from" one value "to" another */
.Name(XO("from")) .Name(XO("from"))
.AddWindow(mpFromLengthCtrl, wxALIGN_LEFT); .Position(wxALIGN_LEFT)
.AddWindow(mpFromLengthCtrl);
S.AddPrompt(_("New Length:")); S.AddPrompt(_("New Length:"));
@ -394,7 +395,8 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S)
/* i18n-hint: changing a quantity "from" one value "to" another */ /* i18n-hint: changing a quantity "from" one value "to" another */
S.Name(XO("to")) S.Name(XO("to"))
.AddWindow(mpToLengthCtrl, wxALIGN_LEFT); .Position(wxALIGN_LEFT)
.AddWindow(mpToLengthCtrl);
} }
S.EndMultiColumn(); S.EndMultiColumn();
} }

View File

@ -214,8 +214,9 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S)
mNoiseFloorDB, mNoiseFloorDB,
mRatio); mRatio);
S.Prop(true) S.Prop(true)
.Position(wxEXPAND | wxALL)
.MinSize( { 400, 200 } ) .MinSize( { 400, 200 } )
.AddWindow(mPanel, wxEXPAND | wxALL); .AddWindow(mPanel);
S.SetBorder(5); S.SetBorder(5);
} }
S.EndHorizontalLay(); S.EndHorizontalLay();

View File

@ -782,16 +782,18 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
); );
S.Prop(0).AddSpace(0, 1); S.Prop(0).AddSpace(0, 1);
S.Prop(1).AddWindow(mdBRuler, wxEXPAND ); S.Prop(1)
.Position(wxEXPAND)
.AddWindow(mdBRuler);
S.AddSpace(0, 1); S.AddSpace(0, 1);
} }
S.EndVerticalLay(); S.EndVerticalLay();
mPanel = safenew EqualizationPanel(parent, wxID_ANY, this); mPanel = safenew EqualizationPanel(parent, wxID_ANY, this);
S.Prop(1); S.Prop(1)
S .Position(wxEXPAND)
.MinSize( { wxDefaultCoord, wxDefaultCoord } ) .MinSize( { wxDefaultCoord, wxDefaultCoord } )
.AddWindow(mPanel, wxEXPAND ); .AddWindow(mPanel);
S.SetBorder(5); S.SetBorder(5);
S.StartVerticalLay(); S.StartVerticalLay();
@ -839,7 +841,9 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
); );
S.SetBorder(1); S.SetBorder(1);
S.Prop(1).AddWindow(mFreqRuler, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxLEFT); S.Prop(1)
.Position(wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxLEFT)
.AddWindow(mFreqRuler);
S.SetBorder(0); S.SetBorder(0);
// Column 3 is empty // Column 3 is empty
@ -857,9 +861,12 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
// Panel used to host the sliders since they will be positioned manually. // Panel used to host the sliders since they will be positioned manually.
//mGraphicPanel = safenew wxPanelWrapper(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, 150)); //mGraphicPanel = safenew wxPanelWrapper(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, 150));
//S.Prop(1).AddWindow(mGraphicPanel, wxEXPAND); //S.Prop(1)
//.Position(wxEXPAND)
//.AddWindow(mGraphicPanel);
wxWindow *pParent = S.GetParent(); wxWindow *pParent = S.GetParent();
S.AddSpace(15,0); S.AddSpace(15,0);
for (int i = 0; (i < NUMBER_OF_BANDS) && (kThirdOct[i] <= mHiFreq); ++i) for (int i = 0; (i < NUMBER_OF_BANDS) && (kThirdOct[i] <= mHiFreq); ++i)
{ {
mSliders[i] = safenew wxSliderWrapper(pParent, ID_Slider + i, 0, -20, +20, mSliders[i] = safenew wxSliderWrapper(pParent, ID_Slider + i, 0, -20, +20,
@ -880,7 +887,8 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
} ) } )
.ConnectRoot( .ConnectRoot(
wxEVT_ERASE_BACKGROUND, &EffectEqualization::OnErase) wxEVT_ERASE_BACKGROUND, &EffectEqualization::OnErase)
.AddWindow( mSliders[i], wxEXPAND ); .Position(wxEXPAND)
.AddWindow( mSliders[i] );
} }
S.AddSpace(15,0); S.AddSpace(15,0);
} }

View File

@ -243,7 +243,8 @@ void EffectNoise::PopulateOrExchange(ShuttleGui & S)
NumericTextCtrl::Options{} NumericTextCtrl::Options{}
.AutoPos(true)); .AutoPos(true));
S.Name(XO("Duration")) S.Name(XO("Duration"))
.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL); .Position(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL)
.AddWindow(mNoiseDurationT);
} }
S.EndMultiColumn(); S.EndMultiColumn();
} }

View File

@ -386,8 +386,9 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
S.SetBorder(1); S.SetBorder(1);
S.AddSpace(1, 1); S.AddSpace(1, 1);
S.Prop(1); S.Prop(1)
S.AddWindow(mdBRuler, wxALIGN_RIGHT | wxTOP); .Position(wxALIGN_RIGHT | wxTOP)
.AddWindow(mdBRuler);
S.AddSpace(1, 1); S.AddSpace(1, 1);
} }
S.EndVerticalLay(); S.EndVerticalLay();
@ -399,8 +400,9 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
S.SetBorder(5); S.SetBorder(5);
S.Prop(1) S.Prop(1)
.Position(wxEXPAND | wxRIGHT)
.MinSize( { -1, -1 } ) .MinSize( { -1, -1 } )
.AddWindow(mPanel, wxEXPAND | wxRIGHT); .AddWindow(mPanel);
S.StartVerticalLay(); S.StartVerticalLay();
{ {
@ -442,8 +444,9 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
.LabelEdges(true) .LabelEdges(true)
); );
S.Prop(1); S.Prop(1)
S.AddWindow(mfreqRuler, wxEXPAND | wxALIGN_LEFT | wxRIGHT); .Position(wxEXPAND | wxALIGN_LEFT | wxRIGHT)
.AddWindow(mfreqRuler);
S.AddSpace(1, 1); S.AddSpace(1, 1);

View File

@ -74,7 +74,8 @@ void EffectSilence::PopulateOrExchange(ShuttleGui & S)
NumericTextCtrl::Options{} NumericTextCtrl::Options{}
.AutoPos(true)); .AutoPos(true));
S.Name(XO("Duration")) S.Name(XO("Duration"))
.AddWindow(mDurationT, wxALIGN_CENTER | wxALL); .Position(wxALIGN_CENTER | wxALL)
.AddWindow(mDurationT);
} }
S.EndHorizontalLay(); S.EndHorizontalLay();
} }

View File

@ -451,7 +451,8 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
NumericTextCtrl::Options{} NumericTextCtrl::Options{}
.AutoPos(true)); .AutoPos(true));
S.Name(XO("Duration")) S.Name(XO("Duration"))
.AddWindow(mToneDurationT, wxALIGN_LEFT | wxALL); .Position(wxALIGN_LEFT | wxALL)
.AddWindow(mToneDurationT);
} }
S.EndMultiColumn(); S.EndMultiColumn();

View File

@ -2664,7 +2664,8 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S)
options); options);
S S
.Name( TranslatableString{ prompt } ) .Name( TranslatableString{ prompt } )
.AddWindow(time, wxALIGN_LEFT | wxALL); .Position(wxALIGN_LEFT | wxALL)
.AddWindow(time);
} }
else if (ctrl.type == NYQ_CTRL_FILE) else if (ctrl.type == NYQ_CTRL_FILE)
{ {

View File

@ -986,7 +986,8 @@ void Exporter::CreateUserPane(wxWindow *parent)
S.StartStatic(_("Format Options"), 1); S.StartStatic(_("Format Options"), 1);
{ {
mBook = safenew wxSimplebook(S.GetParent()); mBook = safenew wxSimplebook(S.GetParent());
S.AddWindow(mBook, wxEXPAND); S.Position(wxEXPAND)
.AddWindow(mBook);
for (const auto &pPlugin : mPlugins) for (const auto &pPlugin : mPlugins)
{ {

View File

@ -146,7 +146,8 @@ void ExtImportPrefs::PopulateOrExchange(ShuttleGui & S)
RuleTable->EnableDragCell (true); RuleTable->EnableDragCell (true);
fillRuleTable = true; fillRuleTable = true;
} }
S.AddWindow(RuleTable, wxEXPAND | wxALL); S.Position(wxEXPAND | wxALL)
.AddWindow(RuleTable);
PluginList = S.Id(EIPPluginList).AddListControl( PluginList = S.Id(EIPPluginList).AddListControl(
{ { _("Importer order"), wxLIST_FORMAT_LEFT, { { _("Importer order"), wxLIST_FORMAT_LEFT,

View File

@ -227,12 +227,12 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
wxTE_PROCESS_ENTER); wxTE_PROCESS_ENTER);
mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel())); mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
} }
S S.Position(wxALIGN_NOT | wxALIGN_LEFT)
.ConnectRoot(wxEVT_KEY_DOWN, .ConnectRoot(wxEVT_KEY_DOWN,
&KeyConfigPrefs::OnFilterKeyDown) &KeyConfigPrefs::OnFilterKeyDown)
.ConnectRoot(wxEVT_CHAR, .ConnectRoot(wxEVT_CHAR,
&KeyConfigPrefs::OnFilterChar) &KeyConfigPrefs::OnFilterChar)
.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT); .AddWindow(mFilter);
} }
S.EndHorizontalLay(); S.EndHorizontalLay();
} }
@ -245,8 +245,9 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
mView = safenew KeyView(S.GetParent(), CommandsListID); mView = safenew KeyView(S.GetParent(), CommandsListID);
mView->SetName(_("Bindings")); mView->SetName(_("Bindings"));
} }
S.Prop(true); S.Prop(true)
S.AddWindow(mView, wxEXPAND); .Position(wxEXPAND)
.AddWindow(mView);
} }
S.EndHorizontalLay(); S.EndHorizontalLay();

View File

@ -561,8 +561,9 @@ PrefsDialog::PrefsDialog
mCategories->GetTreeCtrl()->SetName(_("Category")); mCategories->GetTreeCtrl()->SetName(_("Category"));
S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, true); S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, true);
{ {
S.Prop(1); S.Prop(1)
S.AddWindow(mCategories, wxEXPAND); .Position(wxEXPAND)
.AddWindow(mCategories);
{ {
typedef std::pair<int, int> IntPair; typedef std::pair<int, int> IntPair;
@ -602,7 +603,9 @@ PrefsDialog::PrefsDialog
const PrefsNode &node = factories[0]; const PrefsNode &node = factories[0];
const PrefsPanel::Factory &factory = node.factory; const PrefsPanel::Factory &factory = node.factory;
mUniquePage = factory(this, wxID_ANY); mUniquePage = factory(this, wxID_ANY);
wxWindow * uniquePageWindow = S.Prop(1).AddWindow(mUniquePage, wxEXPAND); wxWindow * uniquePageWindow = S.Prop(1)
.Position(wxEXPAND)
.AddWindow(mUniquePage);
// We're not in the wxTreebook, so add the accelerator here // We're not in the wxTreebook, so add the accelerator here
wxAcceleratorEntry entries[1]; wxAcceleratorEntry entries[1];
#if defined(__WXMAC__) #if defined(__WXMAC__)

View File

@ -134,7 +134,8 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &)
lb->SetSelection( make_iterator_range( facenames ).index( facename )); lb->SetSelection( make_iterator_range( facenames ).index( facename ));
S S
.Name(XO("Face name")) .Name(XO("Face name"))
.AddWindow(lb, wxALIGN_LEFT | wxEXPAND | wxALL); .Position( wxALIGN_LEFT | wxEXPAND | wxALL )
.AddWindow(lb);
/* i18n-hint: (noun) The size of the typeface*/ /* i18n-hint: (noun) The size of the typeface*/
S.AddPrompt(_("Face size")); S.AddPrompt(_("Face size"));
@ -146,7 +147,8 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &)
8, 48, fontsize); 8, 48, fontsize);
S S
.Name(XO("Face size")) .Name(XO("Face size"))
.AddWindow(sc, wxALIGN_LEFT | wxALL); .Position( wxALIGN_LEFT | wxALL )
.AddWindow(sc);
} }
S.EndMultiColumn(); S.EndMultiColumn();
S.AddStandardButtons(); S.AddStandardButtons();

View File

@ -290,7 +290,8 @@ SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id,
size, size,
ASlider::Options{} ASlider::Options{}
.Style( style ).Line( line ).Page( page ) ); .Style( style ).Line( line ).Page( page ) );
S.AddWindow(mSlider, wxEXPAND); S.Position(wxEXPAND)
.AddWindow(mSlider);
} }
S.EndVerticalLay(); S.EndVerticalLay();

View File

@ -192,7 +192,8 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent,
else else
html->SetPage( HtmlText); html->SetPage( HtmlText);
S.Prop(1).Focus().AddWindow( html, wxEXPAND ); S.Prop(1).Focus().Position( wxEXPAND )
.AddWindow( html );
S.Id( wxID_CANCEL ).AddButton( _("Close"), wxALIGN_CENTER, true ); S.Id( wxID_CANCEL ).AddButton( _("Close"), wxALIGN_CENTER, true );
} }