X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36307fdf51fbd35a20e0c16ecf08209bdba8ff08..41fec01fa9e009d84fe353aa494725328d850af1:/src/aui/auibook.cpp diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index ad24a03e3c..f299944023 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -1935,7 +1935,7 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd) } // Is the tab visible? -bool wxAuiTabContainer::IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* /*wnd*/) +bool wxAuiTabContainer::IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* wnd) { if (!dc || !dc->IsOk()) return false; @@ -2021,6 +2021,9 @@ bool wxAuiTabContainer::IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWin // See if the given page is visible at the given tab offset (effectively scroll position) for (i = tabOffset; i < page_count; ++i) { + wxAuiNotebookPage& page = m_pages.Item(i); + wxAuiTabContainerButton& tab_button = m_tabCloseButtons.Item(i); + rect.x = offset; rect.width = m_rect.width - right_buttons_width - offset - 2; @@ -2028,6 +2031,14 @@ bool wxAuiTabContainer::IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWin return false; // haven't found the tab, and we've run out of space, so return false int x_extent = 0; + m_art->GetTabSize(*dc, + wnd, + page.caption, + page.bitmap, + page.active, + tab_button.curState, + &x_extent); + offset += x_extent; if (i == (size_t) tabPage) @@ -2441,6 +2452,7 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt) button->curState = wxAUI_BUTTON_STATE_HOVER; Refresh(); Update(); + m_hoverButton = button; return; } @@ -4488,7 +4500,9 @@ bool wxAuiNotebook::SetPageImage(size_t n, int imageId) wxWindow* wxAuiNotebook::GetCurrentPage () const { - return GetPage(GetSelection()); + const int sel = GetSelection(); + + return sel == wxNOT_FOUND ? NULL : GetPage(sel); } int wxAuiNotebook::ChangeSelection(size_t n)