]> git.saurik.com Git - wxWidgets.git/commitdiff
SetValue can add values if not readonly
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 27 Feb 2003 10:06:12 +0000 (10:06 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 27 Feb 2003 10:06:12 +0000 (10:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index feee187143e5a192f0a9ebe4217250aec6bf9420..494f6889215770da2c8980c4b612431db5cefd44 100644 (file)
@@ -311,7 +311,12 @@ wxString wxComboBox::GetValue() const
 
 void wxComboBox::SetValue(const wxString& value)
 {
-    SetStringSelection( value ) ;
+    int s = FindString (value);
+    if (s == wxNOT_FOUND && !HasFlag(wxCB_READONLY) )
+    {
+       m_choice->Append(value) ;
+    }
+       SetStringSelection( value ) ;
 }
 
 // Clipboard operations
index feee187143e5a192f0a9ebe4217250aec6bf9420..494f6889215770da2c8980c4b612431db5cefd44 100644 (file)
@@ -311,7 +311,12 @@ wxString wxComboBox::GetValue() const
 
 void wxComboBox::SetValue(const wxString& value)
 {
-    SetStringSelection( value ) ;
+    int s = FindString (value);
+    if (s == wxNOT_FOUND && !HasFlag(wxCB_READONLY) )
+    {
+       m_choice->Append(value) ;
+    }
+       SetStringSelection( value ) ;
 }
 
 // Clipboard operations