From 2d955835305a587f852bf80cba3fd0d92008cec3 Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Sun, 20 Feb 2011 10:48:53 +0000 Subject: [PATCH] Apply #12084: Double-clicking disabled left/right scroll buttons in wxAuiNotebook no longer counts as background doubleclick. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index d682723772..5ed39058fb 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2201,7 +2201,7 @@ bool wxAuiTabContainer::TabHitTest(int x, int y, wxWindow** hit) const return false; wxAuiTabContainerButton* btn = NULL; - if (ButtonHitTest(x, y, &btn)) + if (ButtonHitTest(x, y, &btn) && !(btn->cur_state & wxAUI_BUTTON_STATE_DISABLED)) { if (m_buttons.Index(*btn) != wxNOT_FOUND) return false; @@ -2239,8 +2239,7 @@ bool wxAuiTabContainer::ButtonHitTest(int x, int y, { wxAuiTabContainerButton& button = m_buttons.Item(i); if (button.rect.Contains(x,y) && - !(button.cur_state & (wxAUI_BUTTON_STATE_HIDDEN | - wxAUI_BUTTON_STATE_DISABLED))) + !(button.cur_state & wxAUI_BUTTON_STATE_HIDDEN )) { if (hit) *hit = &button; @@ -2447,7 +2446,8 @@ void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt) { // make sure we're still clicking the button wxAuiTabContainerButton* button = NULL; - if (!ButtonHitTest(evt.m_x, evt.m_y, &button)) + if (!ButtonHitTest(evt.m_x, evt.m_y, &button) || + button->cur_state & wxAUI_BUTTON_STATE_DISABLED) return; if (button != m_pressed_button) @@ -2542,7 +2542,7 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt) // check if the mouse is hovering above a button wxAuiTabContainerButton* button; - if (ButtonHitTest(pos.x, pos.y, &button)) + if (ButtonHitTest(pos.x, pos.y, &button) && !(button->cur_state & wxAUI_BUTTON_STATE_DISABLED)) { if (m_hover_button && button != m_hover_button) {