From 97ac2d5e0e7e6067702f3b9aa7baeb5d7b5f4964 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Fri, 10 Nov 2006 16:30:10 +0000 Subject: [PATCH] small fixed-wixth tab sizing bug fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index bbcaa969c2..7a0386ece7 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -277,6 +277,12 @@ void wxAuiDefaultTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, m_fixed_tab_width = 100; int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; + + if (m_flags & wxAUI_NB_CLOSE_BUTTON) + tot_width -= m_active_close_bmp.GetWidth(); + if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON) + tot_width -= m_active_windowlist_bmp.GetWidth(); + if (tab_count > 0) { m_fixed_tab_width = tot_width/(int)tab_count; @@ -831,6 +837,12 @@ void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, m_fixed_tab_width = 100; int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; + + if (m_flags & wxAUI_NB_CLOSE_BUTTON) + tot_width -= m_active_close_bmp.GetWidth(); + if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON) + tot_width -= m_active_windowlist_bmp.GetWidth(); + if (tab_count > 0) { m_fixed_tab_width = tot_width/(int)tab_count; @@ -2469,8 +2481,10 @@ void wxAuiNotebook::SetWindowStyleFlag(long style) wxAuiPaneInfo& pane = all_panes.Item(i); if (pane.name == wxT("dummy")) continue; - wxAuiTabCtrl* tabctrl = ((wxTabFrame*)pane.window)->m_tabs; + wxTabFrame* tabframe = (wxTabFrame*)pane.window; + wxAuiTabCtrl* tabctrl = tabframe->m_tabs; tabctrl->SetFlags(m_flags); + tabframe->DoSizing(); tabctrl->Refresh(); tabctrl->Update(); }