From 2f64c3bb2348ecd31a2f3973a6a10d1abff34e55 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 7 Jun 2003 21:40:32 +0000 Subject: [PATCH] Accepts Focus was incorrectly returning FALSE for a panel w/o children on mac because of the two implicit scrollbars... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/containr.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 6262adfd24..ea61df47e3 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -61,6 +61,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 +76,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; -- 2.49.0