]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/radiobox.cpp
use wxFD_XXX instead of deprecated wxXXX in the documentation
[wxWidgets.git] / samples / widgets / radiobox.cpp
index 088da04a98c271e6cb726df049bb800976400a81..d0729c6f10c85e9c7be567a14a492f0c47d29b11 100644 (file)
@@ -89,6 +89,9 @@ public:
     virtual wxControl *GetWidget() const { return m_radio; }
     virtual void RecreateWidget() { CreateRadio(); }
 
     virtual wxControl *GetWidget() const { return m_radio; }
     virtual void RecreateWidget() { CreateRadio(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnCheckOrRadioBox(wxCommandEvent& event);
 protected:
     // event handlers
     void OnCheckOrRadioBox(wxCommandEvent& event);
@@ -185,10 +188,8 @@ IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"),
 
 RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
                                    wxImageList *imaglist)
 
 RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
                                    wxImageList *imaglist)
-                  : WidgetsPage(book)
+                  : WidgetsPage(book, imaglist, radio_xpm)
 {
 {
-    imaglist->Add(wxBitmap(radio_xpm));
-
     // init everything
     m_chkVert = (wxCheckBox *)NULL;
     m_chkEnableItem = (wxCheckBox *)NULL;
     // init everything
     m_chkVert = (wxCheckBox *)NULL;
     m_chkEnableItem = (wxCheckBox *)NULL;
@@ -201,7 +202,10 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
     m_radio =
     m_radioDir = (wxRadioBox *)NULL;
     m_sizerRadio = (wxSizer *)NULL;
     m_radio =
     m_radioDir = (wxRadioBox *)NULL;
     m_sizerRadio = (wxSizer *)NULL;
+}
 
 
+void RadioWidgetsPage::CreateContent()
+{
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane
     wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
 
     // left pane
@@ -298,8 +302,6 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
 
     // final initializations
     SetSizer(sizerTop);
 
     // final initializations
     SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------