best size handling fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -96,7 +96,20 @@ wxSize wxButton::DoGetBestSize() const
|
||||
charspace = 8 ;
|
||||
}
|
||||
|
||||
Rect bestsize = { 0 , 0 , 0 , 0 } ;
|
||||
short baselineoffset ;
|
||||
::GetBestControlRect( *m_peer , &bestsize , &baselineoffset ) ;
|
||||
|
||||
int wBtn = 0 ;
|
||||
if ( EmptyRect( &bestsize ) )
|
||||
{
|
||||
int wBtn = m_label.Length() * charspace + 12 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
sz.x = bestsize.right - bestsize.left ;
|
||||
sz.y = bestsize.bottom - bestsize.top ;
|
||||
}
|
||||
|
||||
if (wBtn > sz.x || ( GetWindowStyle() & wxBU_EXACTFIT) )
|
||||
sz.x = wBtn;
|
||||
|
Reference in New Issue
Block a user