X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e640f8231fbf0417f9ab5d378e7f218587cb6ac2..6344162a81f74b3fbab0803405eebc0c0b83e797:/samples/widgets/combobox.cpp diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index b4a4ecc961..d41699167e 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -30,6 +30,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/bitmap.h" #include "wx/button.h" #include "wx/checkbox.h" #include "wx/combobox.h" @@ -41,7 +42,7 @@ #include "wx/sizer.h" #include "widgets.h" - +#if 1 #include "icons/combobox.xpm" // ---------------------------------------------------------------------------- @@ -277,7 +278,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(wxNotebook *notebook, 0, NULL, 0); sizerRight->Add(m_combobox, 1, wxGROW | wxALL, 5); - sizerRight->SetMinSize(250, 0); + sizerRight->SetMinSize(150, 0); m_sizerCombo = sizerRight; // save it to modify it later // the 3 panes panes compose the window @@ -340,7 +341,7 @@ void ComboboxWidgetsPage::CreateCombo() items.Add(m_combobox->GetString(n)); } - m_sizerCombo->Remove(m_combobox); + m_sizerCombo->Detach( m_combobox ); delete m_combobox; } @@ -411,7 +412,7 @@ void ComboboxWidgetsPage::OnButtonClear(wxCommandEvent& event) void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& event) { - static size_t s_item = 0; + static unsigned int s_item = 0; wxString s = m_textAdd->GetValue(); if ( !m_textAdd->IsModified() ) @@ -426,7 +427,7 @@ void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& event) void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) { // "many" means 1000 here - for ( size_t n = 0; n < 1000; n++ ) + for ( unsigned int n = 0; n < 1000; n++ ) { m_combobox->Append(wxString::Format(_T("item #%u"), n)); } @@ -457,7 +458,7 @@ void ComboboxWidgetsPage::OnUpdateUIDeleteButton(wxUpdateUIEvent& event) { unsigned long n; event.Enable(m_textDelete->GetValue().ToULong(&n) && - (n < (unsigned)m_combobox->GetCount())); + (n < (unsigned)m_combobox->GetCount())); } } @@ -482,8 +483,8 @@ void ComboboxWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) { if (!m_combobox) - return; - + return; + wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), @@ -494,10 +495,10 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { - int sel = event.GetInt(); + long sel = event.GetInt(); m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); - wxLogMessage(_T("Combobox item %d selected"), sel); + wxLogMessage(_T("Combobox item %ld selected"), sel); } void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) @@ -507,3 +508,4 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) #endif //wxUSE_COMBOBOX +#endif