From: Julian Smart Date: Sat, 18 Aug 2007 11:34:45 +0000 (+0000) Subject: Avoid clash with control container event handlers X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5bf3f27fc91ff3288000c0134ac4bdfdf2e7db4f Avoid clash with control container event handlers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index a3de9e25ca..26398867a3 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -598,7 +598,7 @@ protected: protected: - void OnChildFocus(wxChildFocusEvent& evt); + void OnChildFocusNotebook(wxChildFocusEvent& evt); void OnRender(wxAuiManagerEvent& evt); void OnSize(wxSizeEvent& evt); void OnTabClicked(wxCommandEvent& evt); @@ -610,7 +610,7 @@ protected: void OnTabMiddleUp(wxCommandEvent& evt); void OnTabRightDown(wxCommandEvent& evt); void OnTabRightUp(wxCommandEvent& evt); - void OnNavigationKey(wxNavigationKeyEvent& event); + void OnNavigationKeyNotebook(wxNavigationKeyEvent& event); // set selection to the given window (which must be non-NULL and be one of // our pages, otherwise an assert is raised) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 6288695abe..dcc83d68f9 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2684,7 +2684,7 @@ const int wxAuiBaseTabCtrlId = 5380; BEGIN_EVENT_TABLE(wxAuiNotebook, wxControl) EVT_SIZE(wxAuiNotebook::OnSize) - EVT_CHILD_FOCUS(wxAuiNotebook::OnChildFocus) + EVT_CHILD_FOCUS(wxAuiNotebook::OnChildFocusNotebook) EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebook::OnTabClicked) @@ -2712,9 +2712,14 @@ BEGIN_EVENT_TABLE(wxAuiNotebook, wxControl) EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebook::OnTabRightUp) - EVT_NAVIGATION_KEY(wxAuiNotebook::OnNavigationKey) + EVT_NAVIGATION_KEY(wxAuiNotebook::OnNavigationKeyNotebook) +#ifdef wxHAS_NATIVE_TAB_TRAVERSAL WX_EVENT_TABLE_CONTROL_CONTAINER(wxAuiNotebook) +#else + // Avoid clash with container event handler functions + EVT_SET_FOCUS(wxAuiNotebook::OnFocus) +#endif END_EVENT_TABLE() WX_DELEGATE_TO_CONTROL_CONTAINER(wxAuiNotebook, wxControl) @@ -4000,7 +4005,7 @@ void wxAuiNotebook::RemoveEmptyTabFrames() m_mgr.Update(); } -void wxAuiNotebook::OnChildFocus(wxChildFocusEvent& evt) +void wxAuiNotebook::OnChildFocusNotebook(wxChildFocusEvent& evt) { // if we're dragging a tab, don't change the current selection. // This code prevents a bug that used to happen when the hint window @@ -4030,7 +4035,7 @@ void wxAuiNotebook::OnChildFocus(wxChildFocusEvent& evt) } } -void wxAuiNotebook::OnNavigationKey(wxNavigationKeyEvent& event) +void wxAuiNotebook::OnNavigationKeyNotebook(wxNavigationKeyEvent& event) { if ( event.IsWindowChange() ) { // change pages