call wxSizerFlags::Top/Bottom() or Left/Right() shouldn't change horizontal or vertical alignment (#9534)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-07 01:22:34 +00:00
parent 204fd7058e
commit 30a56ea8cb
2 changed files with 58 additions and 25 deletions

View File

@@ -58,6 +58,15 @@ public:
return *this;
}
wxSizerFlags& Expand()
{
m_flags |= wxEXPAND;
return *this;
}
// 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 &= ~wxALIGN_MASK;
@@ -66,19 +75,34 @@ public:
return *this;
}
wxSizerFlags& Expand()
{
m_flags |= wxEXPAND;
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()