Preserve wxComboBox selection when modifying the selected item in wxGTK too.

This does the same thing as r70018 did for wxMSW but for wxGTK, i.e. it keeps
the combo box item selected when its text is modified.

This fixes [Bitmap]ComboBox unit tests under wxGTK.

See #13769.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-04-29 23:22:01 +00:00
parent b90aca4cba
commit 182cad34aa

View File

@@ -292,6 +292,10 @@ void wxComboBox::SetString(unsigned int n, const wxString& text)
// with wxMSW and also because it makes sense as leaving the old string
// in the text but not in the list would be confusing to the user.
SetValue(text);
// And we need to keep the selection unchanged, modifying the item is
// not supposed to deselect it.
SetSelection(n);
}
}