* 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:
Robin Dunn
2004-06-24 20:09:45 +00:00
parent cf82b73a0a
commit 9f88452895
55 changed files with 260 additions and 105 deletions

View File

@@ -150,8 +150,8 @@ void wxStaticText::SetLabel( const wxString &label )
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
InvalidateBestSize();
SetSize( GetBestSize() );
SetSizeHints(GetSize());
}
}
@@ -162,8 +162,8 @@ bool wxStaticText::SetFont( const wxFont &font )
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
InvalidateBestSize();
SetSize( GetBestSize() );
SetSizeHints(GetSize());
}
return ret;
}
@@ -183,7 +183,9 @@ wxSize wxStaticText::DoGetBestSize() const
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
(m_widget, &req );
return wxSize(req.width, req.height);
wxSize best(req.width, req.height);
CacheBestSize(best);
return best;
}
bool wxStaticText::SetForegroundColour(const wxColour& colour)