From d0b6344dda3b46c359330f92ac49c256891b3f11 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 16 Jul 2006 20:22:23 +0000 Subject: [PATCH] update the combobox text as soon as we get CBN_SELENDOK as otherwise wxEVT_COMMAND_COMBOBOX_SELECTED handler got wrong value from our GetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/combobox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 41b73b4478..25a2c9cd67 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -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); -- 2.45.2