Restore the check for wxTAB_TRAVERSAL in wxMSW wxWindow code.

This check was replaced with a check for WS_EX_CONTROLPARENT in r74732 to
avoid using ::IsDialogMessage() when WS_EX_CONTROLPARENT is not set, but it
also resulted in using it when WS_EX_CONTROLPARENT is set but wxTAB_TRAVERSAL
is not.

Check for both of them now so that we only use IsDialogMessage() when we need
it (wxTAB_TRAVERSAL) and when it is safe to do it (WS_EX_CONTROLPARENT).

Closes #15565.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-10-25 12:17:38 +00:00
parent bdfbcbfd91
commit 958dd805c2

View File

@ -2303,12 +2303,14 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
{
// wxUniversal implements tab traversal itself
#ifndef __WXUNIVERSAL__
// Notice that we check for WS_EX_CONTROLPARENT and not wxTAB_TRAVERSAL
// here. While usually they are both set or both unset, doing it like this
// also works if there is ever a bug that results in wxTAB_TRAVERSAL being
// set but not WS_EX_CONTROLPARENT as we must not call IsDialogMessage() in
// this case, it would simply hang (see #15458).
if ( m_hWnd != 0 && (wxGetWindowExStyle(this) & WS_EX_CONTROLPARENT) )
// Notice that we check for both wxTAB_TRAVERSAL and WS_EX_CONTROLPARENT
// being set here. While normally the latter should always be set if the
// former is, doing it like this also works if there is ever a bug that
// results in wxTAB_TRAVERSAL being set but not WS_EX_CONTROLPARENT as we
// must not call IsDialogMessage() then, it would simply hang (see #15458).
if ( m_hWnd &&
HasFlag(wxTAB_TRAVERSAL) &&
(wxGetWindowExStyle(this) & WS_EX_CONTROLPARENT) )
{
// intercept dialog navigation keys
MSG *msg = (MSG *)pMsg;