From 88a01064f05bea04682cfde8d82b110d4c80299b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 17 Jan 2006 15:37:04 +0000 Subject: [PATCH] Applied patch [ 1349607 ] [msw] Multiline notebook tab label change can add extra row git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/notebook.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 3d4f37f452..53046b87da 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -450,7 +450,22 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) tcItem.mask = TCIF_TEXT; tcItem.pszText = (wxChar *)strText.c_str(); - return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0; + if ( !HasFlag(wxNB_MULTILINE) ) + return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0; + + // multiline - we need to set new page size if a line is added or removed + int rows = GetRowCount(); + bool ret = TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0; + + if ( ret && rows != GetRowCount() ) + { + const wxRect r = GetPageSize(); + const size_t count = m_pages.Count(); + for ( size_t page = 0; page < count; page++ ) + m_pages[page]->SetSize(r); + } + + return ret; } wxString wxNotebook::GetPageText(size_t nPage) const