remove/replace redundant SetAutoLayout() and Fit() calls, leave just SetSizer[AndFit]() ones (patch 1905759)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-03-15 02:08:02 +00:00
parent adcb6f88ee
commit 92c01615ec
17 changed files with 14 additions and 50 deletions

View File

@ -162,8 +162,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
ok->SetDefault(); ok->SetDefault();
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10); sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
SetSizer(sizer); SetSizerAndFit(sizer);
sizer->Fit(this);
choice->SetSelection(6/*wxART_MESSAGE_BOX*/); choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
SetArtClient(wxART_MESSAGE_BOX); SetArtClient(wxART_MESSAGE_BOX);

View File

@ -1015,7 +1015,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
// sizer // sizer
panel = new wxPanel(m_book); panel = new wxPanel(m_book);
panel->SetAutoLayout( true );
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );

View File

@ -313,7 +313,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(m_book, 1, wxEXPAND); sizer->Add(m_book, 1, wxEXPAND);
panel->SetSizer(sizer); panel->SetSizer(sizer);
sizer->Fit(this);
sizer->SetSizeHints(this); sizer->SetSizeHints(this);
} }

View File

@ -1624,8 +1624,7 @@ DnDShapeDialog::DnDShapeDialog(wxFrame *parent, DnDShape *shape)
buttonSizer->Add( bt, 0, wxALL, 2 ); buttonSizer->Add( bt, 0, wxALL, 2 );
topSizer->Add( buttonSizer, 0, wxALL|wxALIGN_RIGHT, 2 ); topSizer->Add( buttonSizer, 0, wxALL|wxALIGN_RIGHT, 2 );
SetSizer( topSizer ); SetSizerAndFit( topSizer );
topSizer->Fit( this );
} }
DnDShape *DnDShapeDialog::GetShape() const DnDShape *DnDShapeDialog::GetShape() const

View File

@ -48,8 +48,7 @@ bool MyApp::OnInit()
sizer->Add(5,5); sizer->Add(5,5);
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10); sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
dlg.SetSizer(sizer); dlg.SetSizerAndFit(sizer);
sizer->Fit(&dlg);
dlg.Centre(); dlg.Centre();
dlg.ShowModal(); dlg.ShowModal();

View File

@ -475,8 +475,7 @@ MyDialog::MyDialog(wxFrame *parent)
sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")), sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")),
0, wxCENTRE | wxALL, 5); 0, wxCENTRE | wxALL, 5);
SetSizer(sizerTop); SetSizerAndFit(sizerTop);
sizerTop->Fit(this);
} }
void MyDialog::OnThrowInt(wxCommandEvent& WXUNUSED(event)) void MyDialog::OnThrowInt(wxCommandEvent& WXUNUSED(event))

View File

@ -371,10 +371,7 @@ GridFrame::GridFrame()
wxEXPAND ); wxEXPAND );
#endif // wxUSE_LOG #endif // wxUSE_LOG
SetAutoLayout(true); SetSizerAndFit( topSizer );
SetSizer( topSizer );
topSizer->Fit( this );
Centre(); Centre();
SetDefaults(); SetDefaults();

View File

@ -711,10 +711,7 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
SetSizer(sizerTop); SetSizerAndFit(sizerTop);
sizerTop->SetSizeHints(this);
sizerTop->Fit(this);
btnOK->SetFocus(); btnOK->SetFocus();
btnOK->SetDefault(); btnOK->SetDefault();

View File

@ -426,12 +426,10 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title)
wxButton *button2 = new wxButton( panel, wxID_ANY, _T("Hallo") ); wxButton *button2 = new wxButton( panel, wxID_ANY, _T("Hallo") );
panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 ); panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 );
panel->SetAutoLayout( true );
panel->SetSizer( panelsizer ); panel->SetSizer( panelsizer );
// Tell dialog to use sizer // Tell dialog to use sizer
SetSizer( topsizer ); SetSizerAndFit( topsizer );
topsizer->SetSizeHints( this );
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -662,11 +660,7 @@ MyNestedSizerFrame::MyNestedSizerFrame(const wxString &title, int x, int y )
m_target = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80, wxDefaultCoord ) ); m_target = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80, wxDefaultCoord ) );
main_sizer->Add( m_target, 1, wxALL|wxGROW, 5 ); main_sizer->Add( m_target, 1, wxALL|wxGROW, 5 );
SetSizer( main_sizer); SetSizerAndFit( main_sizer);
Layout();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
} }
@ -708,8 +702,6 @@ MyWrapSizerFrame::MyWrapSizerFrame(const wxString &title, int x, int y )
root->Add( ps_bottom, 1, wxEXPAND | wxALL, 5 ); root->Add( ps_bottom, 1, wxEXPAND | wxALL, 5 );
// Set sizer for window // Set sizer for window
SetSizer( root ); SetSizerAndFit( root );
root->Fit( this );
root->SetSizeHints( this );
} }

View File

@ -1534,7 +1534,6 @@ wxMediaPlayerNotebookPage::wxMediaPlayerNotebookPage(wxMediaPlayerFrame* parentF
// //
wxFlexGridSizer* sizer = new wxFlexGridSizer(2, 1, 0, 0); wxFlexGridSizer* sizer = new wxFlexGridSizer(2, 1, 0, 0);
this->SetSizer(sizer); this->SetSizer(sizer);
this->SetAutoLayout(true);
sizer->AddGrowableRow(0); sizer->AddGrowableRow(0);
sizer->AddGrowableCol(0); sizer->AddGrowableCol(0);

View File

@ -332,7 +332,6 @@ MyFrame::MyFrame()
m_panel->SetSizer(m_sizerFrame); m_panel->SetSizer(m_sizerFrame);
m_sizerFrame->Fit(this);
m_sizerFrame->SetSizeHints(this); m_sizerFrame->SetSizeHints(this);
Centre(wxBOTH); Centre(wxBOTH);

View File

@ -142,7 +142,6 @@ SimpleTransientPopup::SimpleTransientPopup( wxWindow *parent )
topSizer->Add( m_spinCtrl, 0, wxALL, 5 ); topSizer->Add( m_spinCtrl, 0, wxALL, 5 );
topSizer->Add( m_mouseText, 0, wxCENTRE|wxALL, 5 ); topSizer->Add( m_mouseText, 0, wxCENTRE|wxALL, 5 );
m_panel->SetAutoLayout( true );
m_panel->SetSizer( topSizer ); m_panel->SetSizer( topSizer );
topSizer->Fit(m_panel); topSizer->Fit(m_panel);
topSizer->Fit(this); topSizer->Fit(this);
@ -365,7 +364,6 @@ MyFrame::MyFrame(const wxString& title)
topSizer->Add( button2, 0, wxALL, 5 ); topSizer->Add( button2, 0, wxALL, 5 );
topSizer->Add( m_logWin, 1, wxEXPAND|wxALL, 5 ); topSizer->Add( m_logWin, 1, wxEXPAND|wxALL, 5 );
panel->SetAutoLayout( true );
panel->SetSizer( topSizer ); panel->SetSizer( topSizer );
} }
@ -452,9 +450,7 @@ MyDialog::MyDialog(const wxString& title)
topSizer->AddSpacer(40); topSizer->AddSpacer(40);
topSizer->Add( okButton, 0, wxALL, 5 ); topSizer->Add( okButton, 0, wxALL, 5 );
panel->SetAutoLayout( true ); panel->SetSizerAndFit( topSizer );
panel->SetSizer( topSizer );
topSizer->Fit(this);
} }
void MyDialog::OnStartSimplePopup(wxCommandEvent& event) void MyDialog::OnStartSimplePopup(wxCommandEvent& event)

View File

@ -174,7 +174,6 @@ MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id,
mainsizer->Add( middlesizer, 1, wxEXPAND ); mainsizer->Add( middlesizer, 1, wxEXPAND );
SetAutoLayout( true );
SetSizer( mainsizer ); SetSizer( mainsizer );
} }
@ -421,7 +420,6 @@ MyFrame::MyFrame()
topsizer->Add( m_log, 0, wxEXPAND ); topsizer->Add( m_log, 0, wxEXPAND );
#endif // wxUSE_LOG #endif // wxUSE_LOG
SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
} }

View File

@ -576,10 +576,7 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
sizerTop->Add(-1, 10, 1, wxGROW); sizerTop->Add(-1, 10, 1, wxGROW);
sizerTop->Add(statbarBottom, 0, wxGROW); sizerTop->Add(statbarBottom, 0, wxGROW);
SetSizer(sizerTop); SetSizerAndFit(sizerTop);
sizerTop->Fit(this);
sizerTop->SetSizeHints(this);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -1145,7 +1145,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
topSizer->Add( m_log, 1, wxALL | wxEXPAND, 10 ); topSizer->Add( m_log, 1, wxALL | wxEXPAND, 10 );
#endif #endif
SetAutoLayout( true );
SetSizer(topSizer); SetSizer(topSizer);
} }

View File

@ -448,7 +448,6 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
m_panel->SetSizer(sizerTop); m_panel->SetSizer(sizerTop);
sizerTop->Fit(this);
sizerTop->SetSizeHints(this); sizerTop->SetSizeHints(this);
#if USE_LOG && !defined(__WXCOCOA__) #if USE_LOG && !defined(__WXCOCOA__)

View File

@ -146,8 +146,7 @@ public:
wxALL, wxALL,
5 // Border 5 // Border
); );
SetSizer(mainSizer); SetSizerAndFit(mainSizer);
mainSizer->Fit(this);
} }
virtual bool TransferDataFromWindow() virtual bool TransferDataFromWindow()
@ -204,8 +203,7 @@ public:
5 // Border 5 // Border
); );
SetSizer(mainSizer); SetSizerAndFit(mainSizer);
mainSizer->Fit(this);
} }
// wizard event handlers // wizard event handlers
@ -314,8 +312,7 @@ public:
wxTextCtrl* textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, textSize, wxTE_MULTILINE); wxTextCtrl* textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, textSize, wxTE_MULTILINE);
mainSizer->Add(textCtrl, 0, wxALL|wxEXPAND, 5); mainSizer->Add(textCtrl, 0, wxALL|wxEXPAND, 5);
SetSizer(mainSizer); SetSizerAndFit(mainSizer);
mainSizer->Fit(this);
} }
// implement wxWizardPage functions // implement wxWizardPage functions