* Implemented BestSize cache
* Added calls to InvalidateBestSize where things affecting BestSize are modified. There are probably several other places where this still needs to be done... * Added wxWindowBase::GetBestFittingSize that will merge the BestSize into the MinSize, (if any) and return the result. * SetBestFittingSize will now only set the MinSize to the value that was passed to it, without merging in the BestSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -205,6 +205,8 @@ void wxBitmapButton::OnSetBitmap()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") );
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
wxBitmap the_one;
|
||||
if (!m_isEnabled)
|
||||
the_one = m_bmpDisabled;
|
||||
@@ -258,6 +260,7 @@ wxSize wxBitmapButton::DoGetBestSize() const
|
||||
best.x = m_bmpNormal.GetWidth()+border;
|
||||
best.y = m_bmpNormal.GetHeight()+border;
|
||||
}
|
||||
CacheBestSize(best);
|
||||
return best;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user