+
+ // 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); }
+
+ // this function will generate the appropriate call to Navigate() if the
+ // key event is one normally used for keyboard navigation and return true
+ // in this case
+ bool HandleAsNavigationKey(const wxKeyEvent& event);