X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2283800b2e1c11368062e32e9acc155e7080699d..6cab4fcac7fe26d9ae5a1d29066e0893d689bb38:/src/common/sizer.cpp?ds=inline diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 939150a121..6d02d5b4b9 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -480,10 +480,21 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) break; case Item_Window: + { + // Use wxSIZE_FORCE_EVENT here since a sizer item might + // have changed alignment or some other property which would + // not change the size of the window. In such a case, no + // wxSizeEvent would normally be generated and thus the + // control wouldn't get layed out correctly here. +#if 0 + m_window->SetSize(pos.x, pos.y, size.x, size.y, + wxSIZE_ALLOW_MINUS_ONE|wxSIZE_FORCE_EVENT ); +#else m_window->SetSize(pos.x, pos.y, size.x, size.y, - wxSIZE_ALLOW_MINUS_ONE); + wxSIZE_ALLOW_MINUS_ONE ); +#endif break; - + } case Item_Sizer: m_sizer->SetDimension(pos, size); break; @@ -1333,7 +1344,7 @@ int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const ncols = m_cols; nrows = m_rows; - wxASSERT_MSG( ncols*nrows <= nitems, "too many items in grid sizer" ); + wxASSERT_MSG( ncols*nrows >= nitems, "too many items in grid sizer" ); } else if ( m_cols ) { @@ -1987,7 +1998,7 @@ void wxBoxSizer::RecalcSizes() } // NB: wxCENTRE is used here only for backwards compatibility, // wxALIGN_CENTRE should be used in new code - else if ( flag & (wxCENTER | wxALIGN_CENTRE) ) + else if ( flag & (wxCENTER | (IsVertical() ? wxALIGN_CENTRE_HORIZONTAL : wxALIGN_CENTRE_VERTICAL))) { PosInMinorDir(posChild) += (totalMinorSize - minorSize) / 2; }