]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/combobox_osx.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / osx / combobox_osx.cpp
index 00a8e571fe659f939354c47020c3096c55735317..faf325a86746c010659eb0372a55e2f511bbc0d0 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -189,6 +188,14 @@ wxString wxComboBox::GetStringSelection() const
     return sel == wxNOT_FOUND ? wxString() : GetString(sel);
 }
 
+void wxComboBox::SetValue(const wxString& value)
+{
+    if ( HasFlag(wxCB_READONLY) )
+        SetStringSelection( value ) ;
+    else
+        wxTextEntry::SetValue( value );
+}
+
 void wxComboBox::SetString(unsigned int n, const wxString& s)
 {
     // Notice that we shouldn't delete and insert the item in this control
@@ -207,7 +214,7 @@ void wxComboBox::EnableTextChangedEvents(bool WXUNUSED(enable))
 
 bool wxComboBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
 {
-    wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId );
+    wxCommandEvent event(wxEVT_COMBOBOX, m_windowId );
     event.SetInt(GetSelection());
     event.SetEventObject(this);
     event.SetString(GetStringSelection());