X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e95c145cc87162726ad3f2b29f28cbdffb64ae7b..8006bf3c49020d4001314df13425c8a0a7e87a16:/samples/widgets/combobox.cpp diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index 9f7046a89b..d3e703bea4 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -88,6 +88,7 @@ public: ComboboxWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); virtual wxControl *GetWidget() const { return m_combobox; } + virtual void RecreateWidget() { CreateCombo(); } protected: // event handlers @@ -334,7 +335,7 @@ void ComboboxWidgetsPage::Reset() void ComboboxWidgetsPage::CreateCombo() { - int flags = 0; + int flags = ms_defaultFlags; if ( m_chkSort->GetValue() ) flags |= wxCB_SORT; @@ -362,8 +363,8 @@ void ComboboxWidgetsPage::CreateCombo() wxArrayString items; if ( m_combobox ) { - int count = m_combobox->GetCount(); - for ( int n = 0; n < count; n++ ) + unsigned int count = m_combobox->GetCount(); + for ( unsigned int n = 0; n < count; n++ ) { items.Add(m_combobox->GetString(n)); } @@ -377,8 +378,8 @@ void ComboboxWidgetsPage::CreateCombo() 0, NULL, flags); - size_t count = items.GetCount(); - for ( size_t n = 0; n < count; n++ ) + unsigned int count = items.GetCount(); + for ( unsigned int n = 0; n < count; n++ ) { m_combobox->Append(items[n]); } @@ -415,7 +416,7 @@ void ComboboxWidgetsPage::OnButtonDelete(wxCommandEvent& WXUNUSED(event)) { unsigned long n; if ( !m_textDelete->GetValue().ToULong(&n) || - (n >= (unsigned)m_combobox->GetCount()) ) + (n >= m_combobox->GetCount()) ) { return; } @@ -426,7 +427,7 @@ void ComboboxWidgetsPage::OnButtonDelete(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnButtonDeleteSel(wxCommandEvent& WXUNUSED(event)) { int sel = m_combobox->GetSelection(); - if ( sel != -1 ) + if ( sel != wxNOT_FOUND ) { m_combobox->Delete(sel); }