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
This commit is contained in:
Julian Smart 2006-01-17 15:37:04 +00:00
parent a376adb6ee
commit 88a01064f0

View 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