diff --git a/include/wx/sizer.h b/include/wx/sizer.h index f2c560d788..9f66369ce4 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -78,6 +78,12 @@ public: wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); } wxSizerFlags& Center() { return Centre(); } + wxSizerFlags& CentreVertical() { return Align(wxALIGN_CENTRE_VERTICAL); } + wxSizerFlags& CenterVertical() { return CentreVertical(); } + + wxSizerFlags& CentreHorizontal() { return Align(wxALIGN_CENTRE_HORIZONTAL); } + wxSizerFlags& CenterHorizontal() { return CentreHorizontal(); } + wxSizerFlags& Top() { m_flags &= ~(wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL); diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index d9ecb7acd0..a6e694d2a0 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -1393,6 +1393,44 @@ public: */ wxSizerFlags& Centre(); + /** + Same as CentreHorizontal(). + + @since 3.1.0 + */ + wxSizerFlags& CenterHorizontal(); + + /** + Same as CentreVertical(). + + @since 3.1.0 + */ + wxSizerFlags& CenterVertical(); + + /** + Center an item only in horizontal direction. + + This is mostly useful for 2D sizers as for the 1D ones it is shorter to + just use Centre() as the alignment is only used in one direction with + them anyhow. For 2D sizers, centering an item in one direction is quite + different from centering it in both directions however. + + @see CentreVertical() + + @since 3.1.0 + */ + wxSizerFlags& CentreHorizontal(); + + /** + Center an item only in vertical direction. + + The remarks in CentreHorizontal() documentation also apply to this + function. + + @since 3.1.0 + */ + wxSizerFlags& CentreVertical(); + /** Sets the border in the given @a direction having twice the default border size.