X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/44f4f7dda0e604608f0344d72a88c3920f69d035..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 53d4e01348..ecc7570e70 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -47,14 +47,17 @@ // wxControlContainerBase // ---------------------------------------------------------------------------- -void wxControlContainerBase::SetCanFocus(bool acceptsFocus) +bool wxControlContainerBase::UpdateCanFocusChildren() { - if ( acceptsFocus == m_acceptsFocus ) - return; + const bool acceptsFocusChildren = HasAnyFocusableChildren(); + if ( acceptsFocusChildren != m_acceptsFocusChildren ) + { + m_acceptsFocusChildren = acceptsFocusChildren; - m_acceptsFocus = acceptsFocus; + m_winParent->SetCanFocus(AcceptsFocusRecursively()); + } - m_winParent->SetCanFocus(m_acceptsFocus); + return m_acceptsFocusChildren; } bool wxControlContainerBase::HasAnyFocusableChildren() const