Fixed bug in FlexGridSizer mods that prevented them from ever shrinking.

Reverted the earlier SetScrollbars patch and fixed a bug in GetVirtualSize
that was hopefully the real cause of all the preceding woe.

Added a comment and a kludge for a most unusual bug manifesting in the
scrollsub sample.  If it is resized quickly size events appear to get lost
and the scrollbar is set incorrectly.  Adding an extra call to
AdjustScrollbars masks the problem, though its clearly superfluous since
the FitInside above already calls it.  This seems to be a brand new problem
(on both Gtk and msw) as of some time prior to this patch and it should be
looked into further.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ron Lee
2003-01-27 09:02:58 +00:00
parent dd91da4ed1
commit 150c8d89c7
5 changed files with 45 additions and 24 deletions

View File

@@ -1114,16 +1114,29 @@ void wxFlexGridSizer::RecalcSizes()
wxSize wxFlexGridSizer::CalcMin()
{
int nrows, ncols;
int nrows,
ncols;
size_t i, s;
if ( !CalcRowsCols(nrows, ncols) )
return wxSize(10, 10);
// We have to clear the old sizes out if any item has wxADJUST_MINSIZE
// set on it. Its probably quicker to just always do it than test for
// that though. At least do it before resizing the arrays, SetCount will
// initialise new elements to zero.
for( s = m_rowHeights.GetCount(), i = 0; i < s; ++i )
m_rowHeights[ i ] = 0;
for( s = m_colWidths.GetCount(), i = 0; i < s; ++i )
m_colWidths[ i ] = 0;
m_rowHeights.SetCount(nrows);
m_colWidths.SetCount(ncols);
int i = 0;
wxSizerItemList::Node *node = m_children.GetFirst();
i = 0;
while (node)
{
wxSizerItem *item = node->GetData();