Fix for when Set is called with wxSameAs to behave just like calling SameAs()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-01-22 18:30:54 +00:00
parent 90b5abc1eb
commit 844a4451f6

View File

@@ -66,6 +66,14 @@ wxIndividualLayoutConstraint::~wxIndividualLayoutConstraint()
void wxIndividualLayoutConstraint::Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val, int marg) void wxIndividualLayoutConstraint::Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val, int marg)
{ {
if (rel == wxSameAs)
{
// If Set is called by the user with wxSameAs then call SameAs to do
// it since it will actually use wxPercent instead.
SameAs(otherW, otherE, marg);
return;
}
relationship = rel; relationship = rel;
otherWin = otherW; otherWin = otherW;
otherEdge = otherE; otherEdge = otherE;
@@ -106,13 +114,13 @@ void wxIndividualLayoutConstraint::Below(wxWindowBase *sibling, int marg)
// 'Same edge' alignment // 'Same edge' alignment
// //
void wxIndividualLayoutConstraint::SameAs(wxWindowBase *otherW, wxEdge edge, int marg) void wxIndividualLayoutConstraint::SameAs(wxWindowBase *otherW, wxEdge edge, int marg)
{ {
Set(wxPercentOf, otherW, edge, 100, marg); Set(wxPercentOf, otherW, edge, 100, marg);
} }
// The edge is a percentage of the other window's edge // The edge is a percentage of the other window's edge
void wxIndividualLayoutConstraint::PercentOf(wxWindowBase *otherW, wxEdge wh, int per) void wxIndividualLayoutConstraint::PercentOf(wxWindowBase *otherW, wxEdge wh, int per)
{ {
Set(wxPercentOf, otherW, wh, per); Set(wxPercentOf, otherW, wh, per);
} }
@@ -1038,7 +1046,7 @@ bool wxLayoutConstraints::SatisfyConstraints(wxWindowBase *win, int *nChanges)
Set each calculated position and size Set each calculated position and size
*/ */
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
bool wxOldDoLayout(wxWindowBase *win) bool wxOldDoLayout(wxWindowBase *win)
{ {