* 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

@@ -439,6 +439,8 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
wxASSERT_MSG( m_clientList.GetCount() == (size_t)GetCount(),
wxT("bug in client data management") );
InvalidateBestSize();
GList *children = m_list->children;
int length = g_list_length(children);
@@ -495,6 +497,8 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
int wxListBox::DoAppend( const wxString& item )
{
InvalidateBestSize();
if (m_strings)
{
// need to determine the index
@@ -1076,7 +1080,9 @@ wxSize wxListBox::DoGetBestSize() const
// make it too small neither
lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
return wxSize(lbWidth, lbHeight);
wxSize best(lbWidth, lbHeight);
CacheBestSize(best);
return best;
}
void wxListBox::FixUpMouseEvent(GtkWidget *widget, wxCoord& x, wxCoord& y)