+ // the same logic as above but for the columns
+ if ( sz.x > minsz.x && ( (m_flexDirection & wxHORIZONTAL) || (m_growMode == wxFLEX_GROWMODE_SPECIFIED) ) )
+ {
+ int sum_proportions = 0;
+ int growable_space = 0;
+ int num = 0;
+ size_t idx;
+ for (idx = 0; idx < m_growableCols.GetCount(); idx++)
+ {
+ // Since the number of rows/columns can change as items are
+ // inserted/deleted, we need to verify at runtime that the
+ // requested growable rows/columns are still valid.
+ if (m_growableCols[idx] >= ncols)
+ continue;
+
+ // If all items in a row/column are hidden, that row/column will
+ // have a dimension of -1. This causes the column to be hidden
+ // completely.
+ if (m_colWidths[ m_growableCols[idx] ] == -1)
+ continue;
+ sum_proportions += m_growableColsProportions[idx];
+ growable_space += m_colWidths[ m_growableCols[idx] ];
+ num++;
+ }
+
+ if (num > 0)
+ {
+ for (idx = 0; idx < m_growableCols.GetCount(); idx++)
+ {
+ if (m_growableCols[idx] >= ncols )
+ continue;
+ if (m_colWidths[ m_growableCols[idx] ] == -1)
+ m_colWidths[ m_growableCols[idx] ] = 0;
+ else
+ {
+ int delta = (sz.x - minsz.x);
+ if (sum_proportions == 0)
+ delta = (delta/num) + m_colWidths[ m_growableCols[idx] ];
+ else
+ delta = ((delta+growable_space)*m_growableColsProportions[idx])/sum_proportions;
+ m_colWidths[ m_growableCols[idx] ] = delta;
+ }
+ }
+ }
+ }
+ else if ( (m_growMode == wxFLEX_GROWMODE_ALL) && (sz.x > minsz.x) )
+ {
+ for ( int col=0; col < ncols; ++col )
+ m_colWidths[ col ] = sz.x / ncols;
+ }