break;
}
+ // to make the dialog navigation work with the nested panels we must
+ // use this style
if ( flags & wxTAB_TRAVERSAL )
{
*exstyle |= WS_EX_CONTROLPARENT;
// place edit control from being closed with Escape in a dialog
if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE )
{
- if ( ::IsDialogMessage(GetHwnd(), msg) )
+ // ::IsDialogMessage() can enter in an infinite loop when
+ // WS_EX_CONTROLPARENT is specified and the currently focused
+ // window is disabled or hidden, so don't call it in this case
+ HWND hwndFocus = ::GetFocus();
+ if ( !hwndFocus ||
+ ::IsWindowEnabled(hwndFocus) && ::IsWindowVisible(hwndFocus) )
{
- // IsDialogMessage() did something...
- return TRUE;
+ if ( ::IsDialogMessage(GetHwnd(), msg) )
+ {
+ // IsDialogMessage() did something...
+ return TRUE;
+ }
}
}
}