apparently the check for too small rect is needed not only with wxNB_MULTILINE (see http://www.solidsteel.nl/users/wxwidgets/viewtopic.php?p=9842#9842)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-05-25 23:27:34 +00:00
parent 2f73fd3816
commit 628eae0bcd

View File

@@ -497,12 +497,12 @@ wxRect wxNotebook::GetPageSize() const
::GetClientRect(GetHwnd(), &rc);
// This check is to work around a bug in TabCtrl_AdjustRect which will
// cause a crash on win2k, or on XP with themes disabled, if the
// wxNB_MULTILINE style is used and the rectangle is very small, (such as
// when the notebook is first created.) The value of 20 is just
// arbitrarily chosen, if there is a better way to determine this value
// then please do so. --RD
if ( !HasFlag(wxNB_MULTILINE) || (rc.right > 20 && rc.bottom > 20) )
// cause a crash on win2k or on XP with themes disabled if either
// wxNB_MULTILINE is used or tabs are placed on a side, if the rectangle
// is too small.
//
// The value of 20 is chosen arbitrarily but seems to work
if ( rc.right > 20 && rc.bottom > 20 )
{
TabCtrl_AdjustRect(GetHwnd(), false, &rc);