- // this should be impossible because the too high number of items
- // should have been detected by Insert() above
- wxASSERT_MSG( nitems <= ncols*nrows, "logic error in wxGridSizer" );
- }
- else if ( m_cols )
- {
- ncols = m_cols;
- nrows = (nitems + m_cols - 1) / m_cols;
- }
- else if ( m_rows )
- {
- ncols = (nitems + m_rows - 1) / m_rows;
- nrows = m_rows;
- }
- else // 0 columns, 0 rows?
- {
- wxFAIL_MSG( wxT("grid sizer must have either rows or columns fixed") );