- // get the default child of this parent, i.e. the one which is
- // activated by pressing <Enter>
- virtual wxWindow *GetDefaultItem() const { return NULL; }
+ // this is mostly a helper for the various functions using it below
+ bool CanBeFocused() const { return IsShown() && IsEnabled(); }
+
+ // can this window itself have focus?
+ bool IsFocusable() const { return AcceptsFocus() && CanBeFocused(); }
+
+ // can this window have focus right now?
+ //
+ // if this method returns true, it means that calling SetFocus() will
+ // put focus either to this window or one of its children, if you need
+ // to know whether this window accepts focus itself, use IsFocusable()
+ bool CanAcceptFocus() const
+ { return AcceptsFocusRecursively() && CanBeFocused(); }
+
+ // can this window be assigned focus from keyboard right now?
+ bool CanAcceptFocusFromKeyboard() const
+ { return AcceptsFocusFromKeyboard() && CanBeFocused(); }
+
+ // call this when the return value of AcceptsFocus() changes
+ virtual void SetCanFocus(bool WXUNUSED(canFocus)) { }
+
+ // navigates inside this window
+ bool NavigateIn(int flags = wxNavigationKeyEvent::IsForward)
+ { return DoNavigateIn(flags); }
+
+ // navigates in the specified direction from this window, this is
+ // equivalent to GetParent()->NavigateIn()
+ bool Navigate(int flags = wxNavigationKeyEvent::IsForward)
+ { return m_parent && ((wxWindowBase *)m_parent)->DoNavigateIn(flags); }