]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed Set(wxPercentOf) (bug #12227)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Nov 2000 23:12:57 +0000 (23:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Nov 2000 23:12:57 +0000 (23:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/layout.cpp

index 678e8bd1c135c63c54879d6da6d8e7ad902c357b..3b9ec73f6f6546d6f2f20622e33314c3af5346af 100644 (file)
@@ -66,11 +66,20 @@ wxIndividualLayoutConstraint::~wxIndividualLayoutConstraint()
 
 void wxIndividualLayoutConstraint::Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val, int marg)
 {
-  relationship = rel;
-  otherWin = otherW;
-  otherEdge = otherE;
-  value = val;
-  margin = marg;
+    relationship = rel;
+    otherWin = otherW;
+    otherEdge = otherE;
+
+    if ( rel == wxPercentOf )
+    {
+        percentage = val;
+    }
+    else
+    {
+        value = val;
+    }
+
+    margin = marg;
 }
 
 void wxIndividualLayoutConstraint::LeftOf(wxWindowBase *sibling, int marg)
@@ -98,18 +107,13 @@ void wxIndividualLayoutConstraint::Below(wxWindowBase *sibling, int marg)
 //
 void wxIndividualLayoutConstraint::SameAs(wxWindowBase *otherW, wxEdge edge, int marg)
 { 
-    Set(wxPercentOf, otherW, edge, 0, marg);
-    percent = 100;
+    Set(wxPercentOf, otherW, edge, 100, marg);
 }
 
 // The edge is a percentage of the other window's edge
 void wxIndividualLayoutConstraint::PercentOf(wxWindowBase *otherW, wxEdge wh, int per)
 { 
-    otherWin = otherW;
-    relationship = wxPercentOf;
-    percent = per;
-
-    otherEdge = wh;
+    Set(wxPercentOf, otherW, wh, per);
 }
 
 //