From: Benjamin Williams Date: Tue, 7 Nov 2006 16:13:04 +0000 (+0000) Subject: fixed width measuring - minor fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/69685ee021196070ba39e677629a3ce8aba6318a?ds=sidebyside fixed width measuring - minor fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index b5b3a679a9..0bff20b468 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -264,7 +264,7 @@ void wxAuiDefaultTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, { m_fixed_tab_width = 100; - int tot_width = tab_ctrl_size.x; + int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; if (tab_count > 0) { m_fixed_tab_width = tot_width/(int)tab_count; @@ -710,7 +710,7 @@ void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, { m_fixed_tab_width = 100; - int tot_width = tab_ctrl_size.x; + int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; if (tab_count > 0) { m_fixed_tab_width = tot_width/(int)tab_count; @@ -2730,11 +2730,13 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) } + // if there are less than two panes, split can't happen, so leave + if (m_tabs.GetPageCount() < 2) + return; + // if tab moving is not allowed, leave if (!(m_flags & wxAUI_NB_TAB_SPLIT)) - { return; - } if (src_tabs) @@ -2866,7 +2868,7 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt) // only perform a tab split if it's allowed - if (m_flags & wxAUI_NB_TAB_SPLIT) + if ((m_flags & wxAUI_NB_TAB_SPLIT) && m_tabs.GetPageCount() >= 2) { // If the pointer is in an existing tab frame, do a tab insert wxWindow* hit_wnd = ::wxFindWindowAtPoint(mouse_screen_pt);