make sure we add the correct wx-border pixels to native controls when calculating best size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-05-27 14:14:11 +00:00
parent 10a99f20aa
commit b91dd98ff1

View File

@@ -2055,8 +2055,11 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
wxSize wxWindowMac::DoGetBestSize() const
{
if ( m_peer == NULL || m_macIsUserPane || IsTopLevel() )
{
return wxWindowBase::DoGetBestSize() ;
}
else
{
Rect bestsize = { 0 , 0 , 0 , 0 } ;
int bestWidth, bestHeight ;
@@ -2083,14 +2086,16 @@ wxSize wxWindowMac::DoGetBestSize() const
// return wxWindowBase::DoGetBestSize() ;
}
}
bestWidth = bestsize.right - bestsize.left ;
bestHeight = bestsize.bottom - bestsize.top ;
// wx-borders are being drawn outside the native control
bestWidth = bestsize.right - bestsize.left + MacGetLeftBorderSize() +
MacGetRightBorderSize();
bestHeight = bestsize.bottom - bestsize.top + MacGetTopBorderSize() +
MacGetBottomBorderSize();
if ( bestHeight < 10 )
bestHeight = 13 ;
return wxSize(bestWidth, bestHeight);
}
}
// set the size of the window: if the dimensions are positive, just use them,
// but if any of them is equal to -1, it means that we must find the value for