X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7407834c46165658c54a11ba91d4c173ceab1e5..a400a8230f751da518c29bd9a1c67132a4ae2b75:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 6262adfd24..fe1ea94cab 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -36,6 +36,10 @@ #include "wx/containr.h" +#ifdef __WXMAC__ + #include "wx/scrolbar.h" +#endif + // ============================================================================ // implementation // ============================================================================ @@ -61,6 +65,12 @@ bool wxControlContainer::AcceptsFocus() const if ( !node ) return TRUE; +#ifdef __WXMAC__ + // wxMac has eventually the two scrollbars as children, they don't count + // as real children in the algorithm mentioned above + bool hasRealChildren = false ; +#endif + while ( node ) { wxWindow *child = node->GetData(); @@ -70,8 +80,18 @@ bool wxControlContainer::AcceptsFocus() const return TRUE; } +#ifdef __WXMAC__ + wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ; + if ( sb == NULL || !m_winParent->MacIsWindowScrollbar( sb ) ) + hasRealChildren = true ; +#endif node = node->GetNext(); } + +#ifdef __WXMAC__ + if ( !hasRealChildren ) + return TRUE ; +#endif } return FALSE;