]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/slider.cpp
remove file lists on exit
[wxWidgets.git] / samples / widgets / slider.cpp
index ce234a2c4d208b1e6ee2fabd1f1baa0b560436ca..ec7b0bf6045a1018369e383e98a6a3b76e5b39e1 100644 (file)
@@ -95,6 +95,9 @@ public:
     virtual wxControl *GetWidget() const { return m_slider; }
     virtual void RecreateWidget() { CreateSlider(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
@@ -198,16 +201,18 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"),
-                       (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS)
-                       );
+#if defined(__WXUNIVERSAL__)
+    #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+    #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), FAMILY_CTRLS );
 
 SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book,
                                      wxImageList *imaglist)
-                  : WidgetsPage(book)
+                  : WidgetsPage(book, imaglist, slider_xpm)
 {
-    imaglist->Add(wxBitmap(slider_xpm));
-
     // init everything
     m_min = 0;
     m_max = 100;
@@ -221,7 +226,10 @@ SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book,
 
     m_slider = (wxSlider *)NULL;
     m_sizerSlider = (wxSizer *)NULL;
+}
 
+void SliderWidgetsPage::CreateContent()
+{
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane