Fix sending wxEVT_TEXT_ENTER when using auto-completion in wxMSW

We need to explicitly generate this event from the char hook handler as
we don't get the normal WM_CHAR for it, it is apparently intercepted by
the window proc installed by the auto-completing code, so check if
wxTE_PROCESS_ENTER is used for the text entry and call a special new
MSWProcessSpecialKey() method to do the right thing if it is.

Similarly, handle Tab presses correctly if wxTE_PROCESS_TAB is used.

Closes #12613.
This commit is contained in:
Vadim Zeitlin
2017-12-25 19:29:25 +01:00
parent f32edbe1fc
commit 5a949efc5c
7 changed files with 144 additions and 51 deletions

View File

@@ -2103,6 +2103,19 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
event.Skip();
}
#if wxUSE_OLE
void wxTextCtrl::MSWProcessSpecialKey(wxKeyEvent& event)
{
// It is not a good idea, in general, to manually call another event
// handler, but here we need to do exactly the same thing as in OnChar()
// above, so it doesn't seem to make much sense to add another function to
// forward to when we can just call it directly.
OnChar(event);
}
#endif // wxUSE_OLE
void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
{
// richedit control doesn't send WM_PASTE, WM_CUT and WM_COPY messages