Added wxBU_EXACTFIT support to wxBitmapButton on wxMSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -466,7 +466,21 @@ wxSize wxBitmapButton::DoGetBestSize() const
|
|||||||
best.x = m_bmpNormal.GetWidth() + 2*m_marginX;
|
best.x = m_bmpNormal.GetWidth() + 2*m_marginX;
|
||||||
best.y = m_bmpNormal.GetHeight() + 2*m_marginY;
|
best.y = m_bmpNormal.GetHeight() + 2*m_marginY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// all buttons have at least the standard size unless the user explicitly
|
||||||
|
// wants them to be of smaller size and used wxBU_EXACTFIT style when
|
||||||
|
// creating the button
|
||||||
|
if ( !HasFlag(wxBU_EXACTFIT) )
|
||||||
|
{
|
||||||
|
wxSize sz = GetDefaultSize();
|
||||||
|
if (best.x > sz.x)
|
||||||
|
sz.x = best.x;
|
||||||
|
if (best.y > sz.y)
|
||||||
|
sz.y = best.y;
|
||||||
|
}
|
||||||
|
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_BMPBUTTON
|
#endif // wxUSE_BMPBUTTON
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user