]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/combobox_osx.cpp
use GTK-specific method to delete selection
[wxWidgets.git] / src / osx / combobox_osx.cpp
index 9a1f1b75e22ddada20d7fdb0c237eedd0072327d..3487ef9b178b6470cc504da89311d710bc48e928 100644 (file)
@@ -131,11 +131,13 @@ unsigned int wxComboBox::GetCount() const
 
 void wxComboBox::DoDeleteOneItem(unsigned int n)
 {
+    m_datas.RemoveAt(n);
     GetComboPeer()->RemoveItem(n);
 }
 
 void wxComboBox::DoClear()
 {
+    m_datas.Clear();
     GetComboPeer()->Clear();
 }
 
@@ -187,6 +189,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
@@ -205,7 +215,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());