]> git.saurik.com Git - wxWidgets.git/commitdiff
update the combobox text as soon as we get CBN_SELENDOK as otherwise wxEVT_COMMAND_CO...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 16 Jul 2006 20:22:23 +0000 (20:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 16 Jul 2006 20:22:23 +0000 (20:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/combobox.cpp

index 41b73b447894ab39d9ed317dbd9c2d72aa572da1..25a2c9cd672550027b7bd64b0d87f99fe942099d 100644 (file)
@@ -321,6 +321,12 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
             // CBN_EDITCHANGE below
             sel = GetSelection();
             value = GetStringSelection();
+
+            // this string is going to become the new combobox value soon but
+            // we need it to be done right now, otherwise the event handler
+            // could get a wrong value when it calls our GetValue()
+            ::SetWindowText(GetHwnd(), value);
+
             {
                 wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
                 event.SetInt(sel);