+ // returns the number of columns/rows needed for the current total number
+ // of children (and the fixed number of rows/columns)
+ int CalcCols() const
+ {
+ wxCHECK_MSG
+ (
+ m_rows, 0,
+ "Can't calculate number of cols if number of rows is not specified"
+ );
+
+ return (m_children.GetCount() + m_rows - 1) / m_rows;
+ }
+
+ int CalcRows() const
+ {
+ wxCHECK_MSG
+ (
+ m_cols, 0,
+ "Can't calculate number of cols if number of rows is not specified"
+ );
+
+ return (m_children.GetCount() + m_cols - 1) / m_cols;
+ }
+