]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
assert is raised when using the thread sample (which works) so the test is
[wxWidgets.git] / src / common / containr.cpp
index cf52acee49c312a271a956b9afa6acfb96cc92a6..5f251fda7b828ebd6de91fd2eb9190b6cadffa87 100644 (file)
@@ -49,6 +49,28 @@ wxControlContainer::wxControlContainer(wxWindow *winParent)
     m_winDefault = NULL;
 }
 
+bool wxControlContainer::AcceptsFocus() const
+{
+    // We can accept focus only when at last one child will accept focus
+    if ( m_winParent->IsShown() && m_winParent->IsEnabled() )
+    {
+        wxWindowList::Node *node = m_winParent->GetChildren().GetFirst();
+        while ( node )
+        {
+            wxWindow *child = node->GetData();
+
+            if ( child->AcceptsFocus() )
+            {
+                return TRUE;
+            }
+
+            node = node->GetNext();
+        }
+    }
+
+    return FALSE;
+}
+
 void wxControlContainer::SetLastFocus(wxWindow *win)
 {
     // the panel itself should never get the focus at all but if it does happen
@@ -386,3 +408,4 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
 
     return FALSE;
 }
+