Fix keyboard navigation in wx{List,Choice,Tree,Tool}book controls.

Inherit from wxNavigationEnabled<wxBookCtrlBase> instead of just
wxBookCtrlBase to ensure that the keyboard navigation works correctly for
these controls.

The toolbar in wxToolbook still doesn't accept focus from keyboard but at
least the pages can be TAB-bed too and from. And the rest of the controls
are now fully accessible using only the keyboard.

Closes #14303.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-15 10:03:57 +00:00
parent c833f0cdb0
commit 28e42e023c
4 changed files with 8 additions and 4 deletions

View File

@@ -18,6 +18,7 @@
#include "wx/bookctrl.h" #include "wx/bookctrl.h"
#include "wx/choice.h" #include "wx/choice.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxChoice; class WXDLLIMPEXP_FWD_CORE wxChoice;
@@ -36,7 +37,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGI
// wxChoicebook // wxChoicebook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxChoicebook : public wxBookCtrlBase class WXDLLIMPEXP_CORE wxChoicebook : public wxNavigationEnabled<wxBookCtrlBase>
{ {
public: public:
wxChoicebook() { } wxChoicebook() { }

View File

@@ -17,6 +17,7 @@
#if wxUSE_LISTBOOK #if wxUSE_LISTBOOK
#include "wx/bookctrl.h" #include "wx/bookctrl.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxListView; class WXDLLIMPEXP_FWD_CORE wxListView;
class WXDLLIMPEXP_FWD_CORE wxListEvent; class WXDLLIMPEXP_FWD_CORE wxListEvent;
@@ -36,7 +37,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING
// wxListbook // wxListbook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListbook : public wxBookCtrlBase class WXDLLIMPEXP_CORE wxListbook : public wxNavigationEnabled<wxBookCtrlBase>
{ {
public: public:
wxListbook() { } wxListbook() { }

View File

@@ -17,6 +17,7 @@
#if wxUSE_TOOLBOOK #if wxUSE_TOOLBOOK
#include "wx/bookctrl.h" #include "wx/bookctrl.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxToolBarBase; class WXDLLIMPEXP_FWD_CORE wxToolBarBase;
class WXDLLIMPEXP_FWD_CORE wxCommandEvent; class WXDLLIMPEXP_FWD_CORE wxCommandEvent;
@@ -40,7 +41,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING
// wxToolbook // wxToolbook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToolbook : public wxBookCtrlBase class WXDLLIMPEXP_CORE wxToolbook : public wxNavigationEnabled<wxBookCtrlBase>
{ {
public: public:
wxToolbook() wxToolbook()

View File

@@ -17,6 +17,7 @@
#if wxUSE_TREEBOOK #if wxUSE_TREEBOOK
#include "wx/bookctrl.h" #include "wx/bookctrl.h"
#include "wx/containr.h"
#include "wx/treectrl.h" // for wxArrayTreeItemIds #include "wx/treectrl.h" // for wxArrayTreeItemIds
typedef wxWindow wxTreebookPage; typedef wxWindow wxTreebookPage;
@@ -27,7 +28,7 @@ class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
// wxTreebook // wxTreebook
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTreebook : public wxBookCtrlBase class WXDLLIMPEXP_CORE wxTreebook : public wxNavigationEnabled<wxBookCtrlBase>
{ {
public: public:
// Constructors and such // Constructors and such