if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) )
{
gs_wndprocNotebook =
- wx_reinterpret_cast(WXFARPROC, wc.lpfnWndProc);
+ reinterpret_cast<WXFARPROC>(wc.lpfnWndProc);
wc.lpszClassName = wxT("_wx_SysTabCtl32");
wc.style &= ~(CS_HREDRAW | CS_VREDRAW);
wc.hInstance = wxGetInstance();
tabSize.y = rect.bottom - rect.top;
}
+ const int rows = GetRowCount();
+
// add an extra margin in both directions
const int MARGIN = 8;
if ( IsVertical() )
{
sizeTotal.x += MARGIN;
- sizeTotal.y += tabSize.y + MARGIN;
+ sizeTotal.y += tabSize.y * rows + MARGIN;
}
else // horizontal layout
{
- sizeTotal.x += tabSize.x + MARGIN;
+ sizeTotal.x += tabSize.x * rows + MARGIN;
sizeTotal.y += MARGIN;
}
MAKELPARAM(rc.right, rc.bottom));
s_isInOnSize = false;
}
+
+ // The best size depends on the number of rows of tabs, which can
+ // change when the notepad is resized.
+ InvalidateBestSize();
}
#if wxUSE_UXTHEME