Fix wxBitmapButton best size calculation in wxOSX/Carbon.

wxAnyButton refactoring broke the best size computation for Carbon, fix it to
work as it did before.

Closes #13830.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-04-28 22:24:36 +00:00
parent 0531b19965
commit 93be446f3a

View File

@@ -53,7 +53,17 @@ wxSize wxAnyButton::DoGetBestSize() const
GetPeer()->GetBestRect( &bestsize ) ;
int wBtn;
if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
if ( GetBitmapLabel().IsOk() )
{
sz.x = bestsize.right - bestsize.left ;
sz.y = bestsize.bottom - bestsize.top ;
sz.x = sz.x + MacGetLeftBorderSize() +
MacGetRightBorderSize();
sz.y = sz.y + MacGetTopBorderSize() +
MacGetBottomBorderSize();
wBtn = sz.x;
}
else if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
{
Point bounds;