X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0c05e79b20d6ca372ece6ac5995b0e3db18a29b..5ca9771ff389ba5981d12ee7ac8b7f23edc6118a:/src/generic/odcombo.cpp diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 47b567d1ef..fb9d6b43af 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -370,11 +370,15 @@ bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar keychar // (good for consistency) return true; - m_value = value; - if ( value >= 0 ) m_combo->SetValue(m_strings[value]); + // The m_combo->SetValue() call above sets m_value to the index of this + // string. But if there are more identical string, the index is of the + // first occurence, which may be wrong, so set the index explicitly here, + // _after_ the SetValue() call. + m_value = value; + SendComboBoxEvent(m_value); return true;