]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1349607 ] [msw] Multiline notebook tab label change can add extra row
authorJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jan 2006 15:37:04 +0000 (15:37 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 17 Jan 2006 15:37:04 +0000 (15:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/notebook.cpp

index 3d4f37f452ff0a56fc15bfdff788d20330953205..53046b87daf55ea2481abf1e6c2b4533e0b4fa9f 100644 (file)
@@ -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