X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15f7c30516facfb272fc116aec4d3f9c3a9de085..fe9fb970bbcf5be35c18cc526b12fd08c7644652:/samples/layout/layout.cpp diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 110b6ef213..3cd1269b08 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -30,6 +30,7 @@ #include "wx/statline.h" #include "wx/notebook.h" #include "wx/spinctrl.h" +#include "wx/wrapsizer.h" #include "layout.h" @@ -426,12 +427,10 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title) wxButton *button2 = new wxButton( panel, wxID_ANY, _T("Hallo") ); panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 ); - panel->SetAutoLayout( true ); panel->SetSizer( panelsizer ); // Tell dialog to use sizer - SetSizer( topsizer ); - topsizer->SetSizeHints( this ); + SetSizerAndFit( topsizer ); } // ---------------------------------------------------------------------------- @@ -662,11 +661,7 @@ MyNestedSizerFrame::MyNestedSizerFrame(const wxString &title, int x, int y ) m_target = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80, wxDefaultCoord ) ); main_sizer->Add( m_target, 1, wxALL|wxGROW, 5 ); - SetSizer( main_sizer); - - Layout(); - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); + SetSizerAndFit( main_sizer); } @@ -708,8 +703,6 @@ MyWrapSizerFrame::MyWrapSizerFrame(const wxString &title, int x, int y ) root->Add( ps_bottom, 1, wxEXPAND | wxALL, 5 ); // Set sizer for window - SetSizer( root ); - root->Fit( this ); - root->SetSizeHints( this ); + SetSizerAndFit( root ); }