]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/combobox.cpp
Warning fix.
[wxWidgets.git] / samples / widgets / combobox.cpp
index 77e8962012ff2fe1cb6886760a94b5a0b05ba844..2ac76337af76d209f2b99a49c6627040a3dc7e33 100644 (file)
@@ -90,6 +90,9 @@ public:
     virtual wxControl *GetWidget() const { return m_combobox; }
     virtual void RecreateWidget() { CreateCombo(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // event handlers
     void OnButtonReset(wxCommandEvent& event);
@@ -212,7 +215,10 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(WidgetsBookCtrl *book,
 
     m_combobox = (wxComboBox *)NULL;
     m_sizerCombo = (wxSizer *)NULL;
+}
 
+void ComboboxWidgetsPage::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
@@ -408,7 +414,7 @@ void ComboboxWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
 void ComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event))
 {
     int sel = m_combobox->GetSelection();
-    if ( sel != -1 )
+    if ( sel != wxNOT_FOUND )
     {
 #ifndef __WXGTK__
         m_combobox->SetString(sel, m_textChange->GetValue());
@@ -531,7 +537,7 @@ void ComboboxWidgetsPage::OnUpdateUIDeleteButton(wxUpdateUIEvent& event)
 void ComboboxWidgetsPage::OnUpdateUIDeleteSelButton(wxUpdateUIEvent& event)
 {
     if (m_combobox)
-        event.Enable(m_combobox->GetSelection() != -1);
+        event.Enable(m_combobox->GetSelection() != wxNOT_FOUND);
 }
 
 void ComboboxWidgetsPage::OnUpdateUIClearButton(wxUpdateUIEvent& event)