]> git.saurik.com Git - wxWidgets.git/commitdiff
The combobox didn't like empty strings at all. It
authorRobert Roebling <robert@roebling.de>
Thu, 23 May 2002 20:35:14 +0000 (20:35 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 23 May 2002 20:35:14 +0000 (20:35 +0000)
    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

src/mac/carbon/combobox.cpp
src/mac/combobox.cpp

index 7bac2630c465cd8748c4c63ca68df9b141bd3554..db47c86aaaddaea953e3bc4d3bff996240806bbc 100644 (file)
@@ -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)
index 7bac2630c465cd8748c4c63ca68df9b141bd3554..db47c86aaaddaea953e3bc4d3bff996240806bbc 100644 (file)
@@ -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)