From 7ebc40e8b996f7b4182c8038938c8b4a188f467a Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Fri, 24 Nov 2006 21:27:55 +0000 Subject: [PATCH] another notebook event fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index da29d085e8..c2a6a92aa2 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2316,7 +2316,7 @@ public: }; - +const int wxAuiBaseTabCtrlId = 5380; // -- wxAuiNotebook class implementation -- @@ -2324,19 +2324,19 @@ public: BEGIN_EVENT_TABLE(wxAuiNotebook, wxControl) EVT_SIZE(wxAuiNotebook::OnSize) EVT_CHILD_FOCUS(wxAuiNotebook::OnChildFocus) - EVT_COMMAND_RANGE(10000, 10100, + EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebook::OnTabClicked) - EVT_COMMAND_RANGE(10000, 10100, + EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, wxAuiNotebook::OnTabBeginDrag) - EVT_COMMAND_RANGE(10000, 10100, + EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebook::OnTabEndDrag) - EVT_COMMAND_RANGE(10000, 10100, + EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, wxAuiNotebook::OnTabDragMotion) - EVT_COMMAND_RANGE(10000, 10100, + EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, wxAuiNotebook::OnTabButton) END_EVENT_TABLE() @@ -2344,7 +2344,7 @@ END_EVENT_TABLE() wxAuiNotebook::wxAuiNotebook() { m_curpage = -1; - m_tab_id_counter = 10000; + m_tab_id_counter = wxAuiBaseTabCtrlId; m_dummy_wnd = NULL; m_tab_ctrl_height = 20; m_requested_bmp_size = wxDefaultSize; @@ -2382,7 +2382,7 @@ bool wxAuiNotebook::Create(wxWindow* parent, void wxAuiNotebook::InitNotebook(long style) { m_curpage = -1; - m_tab_id_counter = 10000; + m_tab_id_counter = wxAuiBaseTabCtrlId; m_dummy_wnd = NULL; m_flags = (unsigned int)style; m_tab_ctrl_height = 20; @@ -2806,14 +2806,14 @@ size_t wxAuiNotebook::SetSelection(size_t new_page) evt.SetSelection(new_page); evt.SetOldSelection(m_curpage); evt.SetEventObject(this); - if (!GetParent()->GetEventHandler()->ProcessEvent(evt) || evt.IsAllowed()) + if (!GetEventHandler()->ProcessEvent(evt) || evt.IsAllowed()) { int old_curpage = m_curpage; m_curpage = new_page; // program allows the page change evt.SetEventType(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED); - (void)GetParent()->GetEventHandler()->ProcessEvent(evt); + (void)GetEventHandler()->ProcessEvent(evt); wxAuiTabCtrl* ctrl; @@ -3437,7 +3437,7 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) e.SetSelection(m_tabs.GetIdxFromWindow(close_wnd)); e.SetOldSelection(evt.GetSelection()); e.SetEventObject(this); - GetParent()->GetEventHandler()->ProcessEvent(e); + GetEventHandler()->ProcessEvent(e); if (!e.IsAllowed()) return; -- 2.47.2