Fix Tab navigation when focused control is disabled.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-08-01 10:11:53 +00:00
parent ce5abbf9f5
commit 0826c4d39a
4 changed files with 19 additions and 5 deletions

View File

@@ -699,9 +699,21 @@ wxWindow *wxWindowBase::DoFindFocus()
void wxWindowMSW::DoEnable( bool enable )
{
HWND hWnd = GetHwnd();
if ( hWnd )
::EnableWindow(hWnd, (BOOL)enable);
MSWEnableHWND(GetHwnd(), enable);
}
bool wxWindowMSW::MSWEnableHWND(WXHWND hWnd, bool enable)
{
if ( !hWnd )
return false;
// If disabling focused control, we move focus to the next one, as if the
// user pressed Tab. That's because we can't keep focus on a disabled
// control, Tab-navigation would stop working then.
if ( !enable && ::GetFocus() == hWnd )
Navigate();
return ::EnableWindow(hWnd, (BOOL)enable);
}
bool wxWindowMSW::Show(bool show)