X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1690c2ce3629e96ba25539c2524d1435546d1e37..4a21ea9d9eec67383ffba7c86f7c413ddee28114:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 84b1bca018..98f3c867a1 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -300,7 +300,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) // fall through case WM_SYSCHAR: - return HandleChar(wParam, lParam, true /* isASCII */); + return HandleChar(wParam, lParam); case WM_SYSKEYDOWN: case WM_KEYDOWN: @@ -702,6 +702,22 @@ void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event) event.Enable(IsEditable() && !wxTextEntry::IsEmpty()); } +void wxComboBox::MSWDoPopupOrDismiss(bool show) +{ + wxASSERT_MSG( !HasFlag(wxCB_SIMPLE), + wxT("can't popup/dismiss the list for simple combo box") ); + + // we *must* set focus to the combobox before showing or hiding the drop + // down as without this we get WM_LBUTTONDOWN messages with invalid HWND + // when hiding it (whether programmatically or manually) resulting in a + // crash when we pass them to IsDialogMessage() + // + // this can be seen in the combo page of the widgets sample under Windows 7 + SetFocus(); + + ::SendMessage(GetHwnd(), CB_SHOWDROPDOWN, show, 0); +} + #if wxUSE_TOOLTIPS void wxComboBox::DoSetToolTip(wxToolTip *tip)