]> git.saurik.com Git - wxWidgets.git/commitdiff
Preserve wxComboBox selection when modifying the selected item in wxGTK too.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Apr 2012 23:22:01 +0000 (23:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Apr 2012 23:22:01 +0000 (23:22 +0000)
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

src/gtk/combobox.cpp

index 445a6cddb130b7354ddfbceabe041f8608b364c9..62da3070c9d58f0160d52c141d1f7355d29d5c14 100644 (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);
     }
 }