X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49dcc246bfddae204903a19181597ccd5bec3901..4f2511d706e5274a34e1521e11c1b95fed735b42:/include/wx/sizer.h diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 59b834d2f3..771fcf5f1a 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -58,27 +58,51 @@ public: return *this; } - wxSizerFlags& Align(int alignment) // combination of wxAlignment values + wxSizerFlags& Expand() { - m_flags &= ~wxALIGN_MASK; - m_flags |= alignment; - + m_flags |= wxEXPAND; return *this; } - wxSizerFlags& Expand() + // notice that Align() replaces the current alignment flags, use specific + // methods below such as Top(), Left() &c if you want to set just the + // vertical or horizontal alignment + wxSizerFlags& Align(int alignment) // combination of wxAlignment values { - m_flags |= wxEXPAND; + m_flags &= ~wxALIGN_MASK; + m_flags |= alignment; + return *this; } // some shortcuts for Align() wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); } wxSizerFlags& Center() { return Centre(); } - wxSizerFlags& Top() { return Align(wxALIGN_TOP); } - wxSizerFlags& Left() { return Align(wxALIGN_LEFT); } - wxSizerFlags& Right() { return Align(wxALIGN_RIGHT); } - wxSizerFlags& Bottom() { return Align(wxALIGN_BOTTOM); } + + wxSizerFlags& Top() + { + m_flags &= ~(wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL); + return *this; + } + + wxSizerFlags& Left() + { + m_flags &= ~(wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL); + return *this; + } + + wxSizerFlags& Right() + { + m_flags = (m_flags & ~wxALIGN_CENTRE_HORIZONTAL) | wxALIGN_RIGHT; + return *this; + } + + wxSizerFlags& Bottom() + { + m_flags = (m_flags & ~wxALIGN_CENTRE_VERTICAL) | wxALIGN_BOTTOM; + return *this; + } + // default border size used by Border() below static int GetDefaultBorder() @@ -761,6 +785,8 @@ public: void AddGrowableCol( size_t idx, int proportion = 0 ); void RemoveGrowableCol( size_t idx ); + bool IsRowGrowable( size_t idx ); + bool IsColGrowable( size_t idx ); // the sizer cells may grow in both directions, not grow at all or only // grow in one direction but not the other