From: Vadim Zeitlin Date: Sun, 25 Nov 2001 00:57:06 +0000 (+0000) Subject: fix for focus handling in case when the panel itself is clicked X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0dcdeee9e74c3bc485c2daf45537e7f5e6431126?ds=inline fix for focus handling in case when the panel itself is clicked git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 04a7794bfe..51a0e1744b 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -273,6 +273,23 @@ bool wxControlContainer::DoSetFocus() // // RR: Removed for now. Let's see what happens.. + // if our child already has focus, don't take it away from it + wxWindow *win = wxWindow::FindFocus(); + while ( win ) + { + if ( win == m_winParent ) + return TRUE; + + if ( win->IsTopLevel() ) + { + // don't look beyond the first top level parent - useless and + // unnecessary + break; + } + + win = win->GetParent(); + } + return SetFocusToChild(); }