Don't generate AUINOTEBOOK_BG_DCLICK when clicking inactive arrow.

Clicking on a disabled arrow shouldn't do anything, in particular it shouldn't
generate a wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK event.

See #12084.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-30 20:05:34 +00:00
parent 9c76b9afa9
commit 65052c6fa7

View File

@@ -2051,7 +2051,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;
@@ -2089,8 +2089,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;
@@ -2298,7 +2297,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)
@@ -2393,7 +2393,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)
{