X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a3caeb594c44e2ad78dc648cf4b4020e2f90101..9cf99fc093f9c45b6b5d8d8b357699d826c9916a:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index ed4fa69c07..72d8437e63 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -1079,6 +1079,14 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg) } #endif // wxUSE_TOOLTIPS + // allow the window to prevent certain messages from being + // translated/processed (this is currently used by wxTextCtrl to always + // grab Ctrl-C/V/X, even if they are also accelerators in some parent) + if ( !wndThis->MSWShouldPreProcessMessage(wxmsg) ) + { + return FALSE; + } + // try translations first: the accelerators override everything wxWindow *wnd; @@ -1094,13 +1102,16 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg) break; } - // now try the other hooks (kbd navigation is handled here) - for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) + // now try the other hooks (kbd navigation is handled here): we start from + // wndThis->GetParent() because wndThis->MSWProcessMessage() was already + // called above + for ( wnd = wndThis->GetParent(); wnd; wnd = wnd->GetParent() ) { if ( wnd->MSWProcessMessage(wxmsg) ) return TRUE; } + // no special preprocessing for this message, dispatch it normally return FALSE; }