fix for dialog navigation in the modal dialogs: do call IsDialogMessage() in this case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1916,14 +1916,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
// here we try to do all the job which ::IsDialogMessage() usually does
|
// here we try to do all the job which ::IsDialogMessage() usually does
|
||||||
// internally
|
// internally
|
||||||
#if 1
|
#if 1
|
||||||
bool bProcess = TRUE;
|
if ( msg->message == WM_KEYDOWN )
|
||||||
if ( msg->message != WM_KEYDOWN )
|
|
||||||
bProcess = FALSE;
|
|
||||||
|
|
||||||
if ( bProcess && (HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN )
|
|
||||||
bProcess = FALSE;
|
|
||||||
|
|
||||||
if ( bProcess )
|
|
||||||
{
|
{
|
||||||
bool bCtrlDown = wxIsCtrlDown();
|
bool bCtrlDown = wxIsCtrlDown();
|
||||||
bool bShiftDown = wxIsShiftDown();
|
bool bShiftDown = wxIsShiftDown();
|
||||||
@@ -1940,6 +1933,8 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
bool bForward = TRUE,
|
bool bForward = TRUE,
|
||||||
bWindowChange = FALSE;
|
bWindowChange = FALSE;
|
||||||
|
|
||||||
|
// should we process this message specially?
|
||||||
|
bool bProcess = TRUE;
|
||||||
switch ( msg->wParam )
|
switch ( msg->wParam )
|
||||||
{
|
{
|
||||||
case VK_TAB:
|
case VK_TAB:
|
||||||
@@ -2084,24 +2079,21 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
// place edit control from being closed with Escape in a dialog
|
// place edit control from being closed with Escape in a dialog
|
||||||
if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE )
|
if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE )
|
||||||
{
|
{
|
||||||
// ::IsDialogMessage() can enter in an infinite loop when
|
// ::IsDialogMessage() can enter in an infinite loop when the
|
||||||
// WS_EX_CONTROLPARENT is specified and the currently focused
|
// currently focused window is disabled or hidden and its parent
|
||||||
// window is disabled or hidden, so don't call it in this case
|
// has WS_EX_CONTROLPARENT style, so don't call it in this case
|
||||||
bool canSafelyCallIsDlgMsg = TRUE;
|
bool canSafelyCallIsDlgMsg = TRUE;
|
||||||
|
|
||||||
HWND hwndFocus = ::GetFocus();
|
HWND hwnd = ::GetFocus();
|
||||||
while ( hwndFocus )
|
if ( hwnd && !(::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd)) )
|
||||||
{
|
{
|
||||||
if ( !::IsWindowEnabled(hwndFocus) ||
|
hwnd = ::GetParent(hwnd);
|
||||||
!::IsWindowVisible(hwndFocus) )
|
if ( hwnd &&
|
||||||
|
(::GetWindowLong(hwnd, GWL_STYLE) & WS_EX_CONTROLPARENT) )
|
||||||
{
|
{
|
||||||
// it would enter an infinite loop if we do this!
|
// it would enter an infinite loop if we do this!
|
||||||
canSafelyCallIsDlgMsg = FALSE;
|
canSafelyCallIsDlgMsg = FALSE;
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hwndFocus = ::GetParent(hwndFocus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( canSafelyCallIsDlgMsg && ::IsDialogMessage(GetHwnd(), msg) )
|
if ( canSafelyCallIsDlgMsg && ::IsDialogMessage(GetHwnd(), msg) )
|
||||||
|
Reference in New Issue
Block a user