diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index afba9ce85b..d9ba02cd4c 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -299,7 +299,6 @@ void wxControlWithItemsBase::SendSelectionChangedEvent(wxEventType eventType) wxCommandEvent event(eventType, m_windowId); event.SetInt(n); - event.SetEventObject(this); event.SetString(GetStringSelection()); InitCommandEventWithItems(event, n); diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 156facae6c..fd3061e414 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -233,11 +233,18 @@ void wxVListBoxComboPopup::DismissWithEvent() void wxVListBoxComboPopup::SendComboBoxEvent( int selection ) { + // TODO: wxVListBox should be refactored to inherit from wxItemContainer + // and then we would be able to just call SendSelectionChangedEvent() + // (which, itself, should be moved down to wxItemContainer from + // wxControlWithItemsBase) instead of duplicating its code. + wxCommandEvent evt(wxEVT_COMBOBOX,m_combo->GetId()); evt.SetEventObject(m_combo); evt.SetInt(selection); + if ( selection != wxNOT_FOUND ) + evt.SetString(m_strings[selection]); // Set client data, if any if ( selection >= 0 && (int)m_clientDatas.size() > selection )