From ee771c51aae7314a16f0290a666114fc4c2d4b0f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 Apr 2019 18:32:50 +0200 Subject: [PATCH] Fix TAB handling for controls with wxTE_PROCESS_ENTER in wxMSW When this style is specified, TAB has to be handled manually as well and we do it by calling our Navigate() method explicitly. But for it to work correctly we need to pretend that it's called in response to a real TAB press by specifying FromTab flag and the code forgot to do this -- just add the missing flag to fix it now. In particular, this ensures that the special code handling radio buttons in wxControlContainer::HandleOnNavigationKey() is really executed and fixes a bug with pressing TAB on a wxTextCtrl with wxTE_PROCESS_ENTER before a radio button group would select the first radio button of this group instead of jumping to the currently selected button. Closes #18392. --- src/msw/textctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 52637d901c..fed5741b58 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2080,7 +2080,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) { if ( ::GetFocus() == GetHwnd() ) { - int flags = 0; + int flags = wxNavigationKeyEvent::FromTab; if (!event.ShiftDown()) flags |= wxNavigationKeyEvent::IsForward ; if (event.ControlDown())