]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/combobox.cpp
another segfault fix
[wxWidgets.git] / src / univ / combobox.cpp
index 76544591d44bb34a5987cf3349336d3851e6e85c..dc644e1699d1ed8012946d150aea74e53587a9f5 100644 (file)
@@ -520,7 +520,10 @@ bool wxComboListBox::SetSelection(const wxString& value)
 
 void wxComboListBox::OnSelect(wxCommandEvent& event)
 {
 
 void wxComboListBox::OnSelect(wxCommandEvent& event)
 {
-    // first let the user code have the event
+    // first update the combo and close the listbox
+    m_combo->OnSelect(event.GetString());
+
+    // next let the user code have the event
 
     // all fields are already filled by the listbox, just change the event
     // type and send it to the combo
 
     // all fields are already filled by the listbox, just change the event
     // type and send it to the combo
@@ -529,9 +532,6 @@ void wxComboListBox::OnSelect(wxCommandEvent& event)
     event2.SetEventObject(m_combo);
     event2.SetId(m_combo->GetId());
     m_combo->ProcessEvent(event2);
     event2.SetEventObject(m_combo);
     event2.SetId(m_combo->GetId());
     m_combo->ProcessEvent(event2);
-
-    // next update the combo and close the listbox
-    m_combo->OnSelect(event.GetString());
 }
 
 void wxComboListBox::OnShow()
 }
 
 void wxComboListBox::OnShow()
@@ -775,7 +775,7 @@ wxClientData* wxComboBox::DoGetItemClientObject(int n) const
 // input handling
 // ----------------------------------------------------------------------------
 
 // input handling
 // ----------------------------------------------------------------------------
 
-void wxComboControl::OnKey(wxCommandEvent& event)
+void wxComboControl::OnKey(wxKeyEvent& event)
 {
     if ( m_isPopupShown )
     {
 {
     if ( m_isPopupShown )
     {
@@ -830,7 +830,7 @@ wxStdComboBoxInputHandler::wxStdComboBoxInputHandler(wxInputHandler *inphand)
 {
 }
 
 {
 }
 
-bool wxStdComboBoxInputHandler::HandleKey(wxControl *control,
+bool wxStdComboBoxInputHandler::HandleKey(wxInputConsumer *consumer,
                                           const wxKeyEvent& event,
                                           bool pressed)
 {
                                           const wxKeyEvent& event,
                                           bool pressed)
 {
@@ -850,13 +850,13 @@ bool wxStdComboBoxInputHandler::HandleKey(wxControl *control,
 
         if ( !!action )
         {
 
         if ( !!action )
         {
-            control->PerformAction(action);
+            consumer->PerformAction(action);
 
             return TRUE;
         }
     }
 
 
             return TRUE;
         }
     }
 
-    return wxStdInputHandler::HandleKey(control, event, pressed);
+    return wxStdInputHandler::HandleKey(consumer, event, pressed);
 }
 
 #endif // wxUSE_COMBOBOX
 }
 
 #endif // wxUSE_COMBOBOX