]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/widgets.cpp
changes wxDirExists() to accept wxString instead of wxChar*, so that it can be used...
[wxWidgets.git] / samples / widgets / widgets.cpp
index 4c16ebb83c76cd73b06227e98abf1b6ce1693d21..fde4f53272f909bfbd6681742eb2ff4b139416a9 100644 (file)
@@ -637,6 +637,8 @@ void WidgetsFrame::OnPageChanging(WidgetsBookCtrlEvent& event)
     // don't allow selection of entries without pages (categories)
     if ( !m_book->GetPage(event.GetSelection()) )
         event.Veto();
+#else
+    wxUnusedVar(event);
 #endif
 }
 
@@ -651,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 )