+ // Third degenerated case pass: allocate min size to all the remaining,
+ // i.e. non-fixed size, items.
+ for ( i = m_children.begin(), n = 0; i != m_children.end(); ++i, ++n )
+ {
+ wxSizerItem * const item = *i;
+
+ if ( !item->IsShown() )
+ continue;
+
+ // we've already dealt with fixed size items above
+ if ( !item->GetProportion() )
+ continue;
+
+ majorSizes[n] = GetMinOrRemainingSize(m_orient, item, &remaining);
+ }
+ }
+ else // we do have enough space to give at least min sizes to all items
+ {
+ // Second and maybe more passes in the non-degenerated case: deal with
+ // fixed size items and items whose min size is greater than what we
+ // would allocate to them taking their proportion into account. For
+ // both of them, we will just use their min size, but for the latter we
+ // also need to reexamine all the items as the items which fitted
+ // before we adjusted their size upwards might not fit any more. This
+ // does make for a quadratic algorithm but it's not obvious how to
+ // avoid it and hopefully it's not a huge problem in practice as the
+ // sizers don't have many items usually (and, of course, the algorithm
+ // still reduces into a linear one if there is enough space for all the
+ // min sizes).
+ bool nonFixedSpaceChanged = false;
+ for ( i = m_children.begin(), n = 0; ; ++i, ++n )