]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/listbox.cpp
Don't cache the best size until we get a non-zero value back from the
[wxWidgets.git] / samples / widgets / listbox.cpp
index 1bbd3faa46257f0f1327b31d575b32d23cb412b9..b189d3b22b55ba4915f9defc7542b6b26814c602 100644 (file)
@@ -81,6 +81,9 @@ public:
     virtual wxControl *GetWidget() const { return m_lbox; }
     virtual void RecreateWidget() { CreateLbox(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
@@ -145,7 +148,7 @@ protected:
 #ifdef __WXWINCE__
     wxListBoxBase
 #else
-    wxListBox 
+    wxListBox
 #endif
                   *m_lbox;
 
@@ -225,6 +228,10 @@ ListboxWidgetsPage::ListboxWidgetsPage(WidgetsBookCtrl *book,
     m_lbox = NULL;
     m_sizerLbox = (wxSizer *)NULL;
 
+}
+
+void ListboxWidgetsPage::CreateContent()
+{
     /*
        What we create here is a frame having 3 panes: style pane is the
        leftmost one, in the middle the pane with buttons allowing to perform