]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
Accepts Focus was incorrectly returning FALSE for a panel w/o children on mac because...
[wxWidgets.git] / src / common / containr.cpp
index 6262adfd24d32931216fa0e418711ea18fe5eaf8..ea61df47e39e24e7437d80c7769129fd1995f89d 100644 (file)
@@ -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;