From 483993222782c53ae0be72f6dbd42d1a4ffc56a1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 18 Jan 2018 22:20:58 +0100 Subject: [PATCH] Allow tabbing to the windows inside non-notebook wxBookCtrl Remove wxBookCtrlBase::AcceptsFocus() returning false as it didn't make any sense: even though wxBookCtrlBase doesn't, indeed, accept focus on itself, it does accept it for its children and returning false prevented the focus from ever getting inside it. This fixes, for example, keyboard navigation in a window containing wxSimplebook and TAB can now be used to move to the controls inside it from the outside. Also remove the now unnecessary AcceptsFocus() override which was just undoing the damage of the base class method and is not needed any more. --- include/wx/bookctrl.h | 3 --- include/wx/notebook.h | 4 ---- 2 files changed, 7 deletions(-) diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 0149ba4d94..aad4834a55 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -228,9 +228,6 @@ public: // we do have multiple pages virtual bool HasMultiplePages() const wxOVERRIDE { return true; } - // we don't want focus for ourselves - virtual bool AcceptsFocus() const wxOVERRIDE { return false; } - // returns true if the platform should explicitly apply a theme border virtual bool CanApplyThemeBorder() const wxOVERRIDE { return false; } diff --git a/include/wx/notebook.h b/include/wx/notebook.h index 61c2d2e6b8..8416c695a5 100644 --- a/include/wx/notebook.h +++ b/include/wx/notebook.h @@ -139,10 +139,6 @@ public: // new is wxNOT_FOUND) void SendPageChangedEvent(int nPageOld, int nPageNew = wxNOT_FOUND); - // wxBookCtrlBase overrides this method to return false but we do need - // focus because we have tabs - virtual bool AcceptsFocus() const wxOVERRIDE { return wxControl::AcceptsFocus(); } - #if wxUSE_EXTENDED_RTTI // XTI accessors virtual void AddPageInfo( wxNotebookPageInfo* info );