fix to correctly adjust growable bits of FlexGridSizer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ron Lee
2000-05-01 13:08:11 +00:00
parent efe67f809f
commit 4401790cca

View File

@@ -675,22 +675,21 @@ void wxFlexGridSizer::RecalcSizes()
wxSize sz( GetSize() ); wxSize sz( GetSize() );
wxSize minsz( CalcMin() ); wxSize minsz( CalcMin() );
wxPoint pt( GetPosition() ); wxPoint pt( GetPosition() );
int delta; int delta;
int row; size_t idx;
int col;
if ((m_growableRows.GetCount() > 0) && (sz.y > minsz.y)) if ((m_growableRows.GetCount() > 0) && (sz.y > minsz.y))
{ {
delta = (sz.y - minsz.y) / m_growableRows.GetCount(); delta = (sz.y - minsz.y) / m_growableRows.GetCount();
for (row = 0; row < nrows; row++) for (idx = 0; idx < m_growableRows.GetCount(); idx++)
m_rowHeights[ row ] = m_rowHeights[ row ] + delta; m_rowHeights[ m_growableRows[idx] ] += delta;
} }
if ((m_growableCols.GetCount() > 0) && (sz.x > minsz.x)) if ((m_growableCols.GetCount() > 0) && (sz.x > minsz.x))
{ {
delta = (sz.x - minsz.x) / m_growableCols.GetCount(); delta = (sz.x - minsz.x) / m_growableCols.GetCount();
for (col = 0; col < ncols; col++) for (idx = 0; idx < m_growableCols.GetCount(); idx++)
m_colWidths[ col ] = m_colWidths[ col ] + delta; m_colWidths[ m_growableCols[idx] ] += delta;
} }
sz = wxSize( pt.x + sz.x, pt.y + sz.y ); sz = wxSize( pt.x + sz.x, pt.y + sz.y );