- // call this when the number of children of the window changes
- void UpdateCanFocus() { SetCanFocus(ShouldAcceptFocus()); }
+ // returns whether we or one of our children accepts focus: we always do
+ // because if we don't have any focusable children it probably means that
+ // we're not being used as a container at all (think of wxGrid or generic
+ // wxListCtrl) and so should get focus for ourselves
+ bool AcceptsFocusRecursively() const { return true; }
+
+ // Call this when the number of children of the window changes.
+ // If we have any children, this panel (used just as container for
+ // them) shouldn't get focus for itself.
+ void UpdateCanFocus() { SetCanFocus(!HasAnyFocusableChildren()); }