]> git.saurik.com Git - wxWidgets.git/commitdiff
fix initial layout of the widgets pages: avoid calling Fit() on them
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Dec 2006 13:43:44 +0000 (13:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Dec 2006 13:43:44 +0000 (13:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

22 files changed:
samples/widgets/bmpcombobox.cpp
samples/widgets/button.cpp
samples/widgets/checkbox.cpp
samples/widgets/clrpicker.cpp
samples/widgets/combobox.cpp
samples/widgets/datepick.cpp
samples/widgets/dirctrl.cpp
samples/widgets/dirpicker.cpp
samples/widgets/filepicker.cpp
samples/widgets/fontpicker.cpp
samples/widgets/gauge.cpp
samples/widgets/hyperlnk.cpp
samples/widgets/listbox.cpp
samples/widgets/notebook.cpp
samples/widgets/odcombobox.cpp
samples/widgets/radiobox.cpp
samples/widgets/slider.cpp
samples/widgets/spinbtn.cpp
samples/widgets/static.cpp
samples/widgets/textctrl.cpp
samples/widgets/toggle.cpp
samples/widgets/widgets.cpp

index ca8ffd6cd4963db9ad5cafb912163c63e641eac2..5cd72b3e284ec2a4b95e25d902e0c98366d71ba8 100644 (file)
@@ -370,8 +370,6 @@ void BitmapComboBoxWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index c06a28bf6929a29a8423549ee6922fd5de410c45..914fa1a08b347d7eb210c85dcb5ed7d41d34b660 100644 (file)
@@ -275,8 +275,6 @@ void ButtonWidgetsPage::CreateContent()
     CreateButton();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index 65a5c1ea4ead0b4967ed3d6420c7db913ae6c358..6ecbfd872a1d36d3070bc8b6ebae4d5638444053 100644 (file)
@@ -233,8 +233,6 @@ void CheckBoxWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void CheckBoxWidgetsPage::Reset()
index 45b297b2384a0ac71513a853614ef71b619fc5cf..346a5ce263324d13cff40b774a83b33ca9728f25 100644 (file)
@@ -168,7 +168,7 @@ void ColourPickerWidgetsPage::CreateContent()
     sz->Add(boxleft, 0, wxGROW|wxALL, 5);
     sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
 
-    SetSizerAndFit(sz);
+    SetSizer(sz);
 }
 
 void ColourPickerWidgetsPage::CreatePicker()
index 5485a1b09fa7c1d64d857b521c2559c40cd20ffa..933864004cede505614612236410c473e2ca8e74 100644 (file)
@@ -335,8 +335,6 @@ void ComboboxWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index f72112cf8b7a78bc71972fa034ea2361b39f1028..04ebb2e20ee41ea93b96882280c05d8fa138bedd 100644 (file)
@@ -178,8 +178,6 @@ void DatePickerWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void DatePickerWidgetsPage::Reset()
index 19e2a3531bfdddabf070a2a2e0623b3ceff220d4..472416f3edbc48150cfda315700c0e2b4b30209e 100644 (file)
@@ -216,8 +216,6 @@ void DirCtrlWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void DirCtrlWidgetsPage::Reset()
index 949be6c803283b23afcd8b1c04d2346955e6b945..d9b97c967b67342204ff68ce35680879a114dd9f 100644 (file)
@@ -170,7 +170,7 @@ void DirPickerWidgetsPage::CreateContent()
     sz->Add(boxleft, 0, wxGROW|wxALL, 5);
     sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
 
-    SetSizerAndFit(sz);
+    SetSizer(sz);
 }
 
 void DirPickerWidgetsPage::CreatePicker()
index e9629fb02eb6f611d0641c6462c6652dc58d7c17..1246f2a5c52c1b3a5b497982b60a97b2a992a4f6 100644 (file)
@@ -191,7 +191,7 @@ void FilePickerWidgetsPage::CreateContent()
     sz->Add(boxleft, 0, wxGROW|wxALL, 5);
     sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
 
-    SetSizerAndFit(sz);
+    SetSizer(sz);
 }
 
 void FilePickerWidgetsPage::CreatePicker()
index 3ea6f75e5ee1e73fc11f1c99cb65b7ee5c328f2c..d26fac62dc97f5ec7a2b1be392a21fce06142c83 100644 (file)
@@ -170,7 +170,7 @@ void FontPickerWidgetsPage::CreateContent()
     sz->Add(boxleft, 0, wxGROW|wxALL, 5);
     sz->Add(m_sizer, 1, wxGROW|wxALL, 5);
 
-    SetSizerAndFit(sz);
+    SetSizer(sz);
 }
 
 void FontPickerWidgetsPage::CreatePicker()
index 3584330e8216c7cd1699b0f599971685054e0ddb..8ff34d47d2f6e769c5695b4c810177b60899c14d 100644 (file)
@@ -261,8 +261,6 @@ void GaugeWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 GaugeWidgetsPage::~GaugeWidgetsPage()
index f1331d10c98660e4c94c06b8be36b54a7fcbcd9d..f93cc97acd9393c076fcbc34634673f986b0a03f 100644 (file)
@@ -223,8 +223,6 @@ void HyperlinkWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void HyperlinkWidgetsPage::Reset()
index b189d3b22b55ba4915f9defc7542b6b26814c602..a766ef441f2c5c6aee2193e38ecafa88cf66157a 100644 (file)
@@ -334,8 +334,6 @@ void ListboxWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index 74ef9c3e69e5113ece148297b18e1ec013da7950..116ee5d91b6e88e8545f77c95f5d5bdb37aebb79 100644 (file)
@@ -295,8 +295,6 @@ void BookWidgetsPage::CreateContent()
 #endif // USE_ICONS_IN_BOOK
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 BookWidgetsPage::~BookWidgetsPage()
index ee531cfa94f8f85a55e359e27fe402e448b3912d..a20d439a43fd346410fe7a9e3062eae44c440c00 100644 (file)
@@ -464,8 +464,6 @@ void ODComboboxWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index a4e73f24cca788a58eeb43da0988c08e0c05a1f0..d0729c6f10c85e9c7be567a14a492f0c47d29b11 100644 (file)
@@ -302,8 +302,6 @@ void RadioWidgetsPage::CreateContent()
 
     // final initializations
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index 214be60ae14cc95fb0aa23f9cea743ea03897b1d..cf2af0159802e2a4608e65d908b3fd296a2c4845 100644 (file)
@@ -360,8 +360,6 @@ void SliderWidgetsPage::CreateContent()
 
     // final initializations
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index f7e793ac8c851a2e42e73e916f3bb483aab39d99..63f8e9c353f7550941cb73e098f6ff3c58fa0c28 100644 (file)
@@ -266,8 +266,6 @@ void SpinBtnWidgetsPage::CreateContent()
 
     // final initializations
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index fe33e6667cab7b31b650bea5838380c3e0234d77..c40d3bccc02e78f7a0f00f4205f5c87dbfdffc0e 100644 (file)
@@ -307,8 +307,6 @@ void StaticWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index c1e6afb816b134a7c883147651bc865273b4af04..e3f6c7845ed9f13e06bcb11d3c1267e0bd0ca819 100644 (file)
@@ -559,8 +559,6 @@ void TextWidgetsPage::CreateContent()
     sizerTop->Add(m_sizerText, 1, wxGROW | (wxALL & ~wxRIGHT), 10);
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
index 6c4734d7ab15c0e6c1da25041194d2ed2941d048..a44b1ff900c2a032d40880d0cf9bce6aa0d29388 100644 (file)
@@ -163,8 +163,6 @@ void ToggleWidgetsPage::CreateContent()
     Reset();
 
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 void ToggleWidgetsPage::Reset()
index 510cdbc6589f8a01aaf52bc97daeb95f5c02865d..fde4f53272f909bfbd6681742eb2ff4b139416a9 100644 (file)
@@ -653,12 +653,16 @@ void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent& event)
 
     GetMenuBar()->Check(Widgets_BusyCursor, false);
 
-    // lazy creation of the pages
+    // create the pages on demand, otherwise the sample startup is too slow as
+    // it creates hundreds of controls
     WidgetsPage *page = CurrentPage();
     if ( page->GetChildren().empty() )
     {
         wxWindowUpdateLocker noUpdates(page);
         page->CreateContent();
+        //page->Layout();
+        page->GetSizer()->Fit(page);
+
         WidgetsBookCtrl *book = wxStaticCast(page->GetParent(), WidgetsBookCtrl);
         wxSize size;
         for ( size_t i = 0; i < book->GetPageCount(); ++i )