X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/917f228a1ff11c0580386828da786f2d04b29999..fd76c6a77d9b0965534ed08e4aab979235370a44:/src/aui/auibook.cpp diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index c58da91092..ac483df486 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -728,7 +728,7 @@ void wxAuiDefaultTabArt::DrawButton(wxDC& dc, int wxAuiDefaultTabArt::ShowDropDown(wxWindow* wnd, const wxAuiNotebookPageArray& pages, - int active_idx) + int /*active_idx*/) { wxMenu menuPopup; @@ -743,12 +743,10 @@ int wxAuiDefaultTabArt::ShowDropDown(wxWindow* wnd, if (caption.IsEmpty()) caption = wxT(" "); - menuPopup.AppendCheckItem(1000+i, caption); - } - - if (active_idx != -1) - { - menuPopup.Check(1000+active_idx, true); + wxMenuItem* item = new wxMenuItem(NULL, 1000+i, caption); + if (page.bitmap.IsOk()) + item->SetBitmap(page.bitmap); + menuPopup.Append(item); } // find out where to put the popup menu of window items @@ -2053,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; @@ -2091,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; @@ -2300,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) @@ -2395,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) { @@ -4160,6 +4158,8 @@ void wxAuiNotebook::RemoveEmptyTabFrames() void wxAuiNotebook::OnChildFocusNotebook(wxChildFocusEvent& evt) { + evt.Skip(); + // 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 // was hidden. In the bug, the focus would return to the notebook