]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/static.cpp
Correct 'markup' for GetResourceHandle after recent change in wx/gdiobj.h.
[wxWidgets.git] / samples / widgets / static.cpp
index 0082fde6fd9a47cf192976d1c38bf373acafa223..fe33e6667cab7b31b650bea5838380c3e0234d77 100644 (file)
@@ -145,6 +145,9 @@ public:
     virtual wxControl *GetWidget() const { return m_statText; }
     virtual void RecreateWidget() { CreateStatic(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnCheckOrRadioBox(wxCommandEvent& event);
@@ -205,15 +208,13 @@ END_EVENT_TABLE()
 // ============================================================================
 
 IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"),
-                       (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS)
+                       (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS)
                        );
 
 StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book,
                                      wxImageList *imaglist)
-                  : WidgetsPage(book)
+                  : WidgetsPage(book, imaglist, statbox_xpm)
 {
-    imaglist->Add(wxBitmap(statbox_xpm));
-
     // init everything
     m_chkVert =
     m_chkAutoResize = (wxCheckBox *)NULL;
@@ -229,7 +230,10 @@ StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book,
     m_staticBox = (wxStaticBox *)NULL;
     m_sizerStatBox = (wxStaticBoxSizer *)NULL;
     m_sizerStatic = (wxSizer *)NULL;
+}
 
+void StaticWidgetsPage::CreateContent()
+{
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane