X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/043ad13ffe29c618fbf07689f643a383be0b0045..9c34a216817028bc533e07873d047208a96b05a2:/include/wx/containr.h?ds=sidebyside diff --git a/include/wx/containr.h b/include/wx/containr.h index 3783578f40..b465e33c30 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -76,11 +76,13 @@ public: bool DoSetFocus(); // returns whether we should accept focus ourselves or not - bool AcceptsFocus() const { return m_acceptsFocusSelf; } + bool AcceptsFocus() const + { return m_acceptsFocusSelf && m_winParent->CanBeFocused(); } // Returns whether we or one of our children accepts focus. bool AcceptsFocusRecursively() const - { return m_acceptsFocusSelf || m_acceptsFocusChildren; } + { return AcceptsFocus() || + (m_acceptsFocusChildren && HasAnyChildrenAcceptingFocus()); } // We accept focus from keyboard if we accept it at all. bool AcceptsFocusFromKeyboard() const { return AcceptsFocusRecursively(); } @@ -97,6 +99,10 @@ protected: // return true if we have any children accepting focus bool HasAnyFocusableChildren() const; + // return true if we have any children that do accept focus right now + bool HasAnyChildrenAcceptingFocus() const; + + // the parent window we manage the children for wxWindow *m_winParent;