From: Robert Roebling Date: Thu, 23 May 2002 20:35:14 +0000 (+0000) Subject: The combobox didn't like empty strings at all. It X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/22a70443dbfca84686b01c42c98e7cc61a21f307 The combobox didn't like empty strings at all. It caused the pop-up-list to get skrewed up. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 7bac2630c4..db47c86aaa 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -60,8 +60,9 @@ protected: void OnTextChange( wxCommandEvent& event ) { wxString s = GetValue(); - - m_cb->DelegateTextChanged( s ); + + if (!s.IsEmpty()) + m_cb->DelegateTextChanged( s ); event.Skip(); } @@ -366,7 +367,11 @@ void wxComboBox::SetSelection(long from, long to) void wxComboBox::Append(const wxString& item) { - m_choice->DoAppend( item ); + // I am not sure what other ports do, + // but wxMac chokes on empty entries. + + if (!item.IsEmpty()) + m_choice->DoAppend( item ); } void wxComboBox::Delete(int n) diff --git a/src/mac/combobox.cpp b/src/mac/combobox.cpp index 7bac2630c4..db47c86aaa 100644 --- a/src/mac/combobox.cpp +++ b/src/mac/combobox.cpp @@ -60,8 +60,9 @@ protected: void OnTextChange( wxCommandEvent& event ) { wxString s = GetValue(); - - m_cb->DelegateTextChanged( s ); + + if (!s.IsEmpty()) + m_cb->DelegateTextChanged( s ); event.Skip(); } @@ -366,7 +367,11 @@ void wxComboBox::SetSelection(long from, long to) void wxComboBox::Append(const wxString& item) { - m_choice->DoAppend( item ); + // I am not sure what other ports do, + // but wxMac chokes on empty entries. + + if (!item.IsEmpty()) + m_choice->DoAppend( item ); } void wxComboBox::Delete(int n)