X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b941f2d3143c1205fc7c5b01bd254781db728b3..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/common/layout.cpp?ds=inline diff --git a/src/common/layout.cpp b/src/common/layout.cpp index 85dcafbb11..f94d850617 100644 --- a/src/common/layout.cpp +++ b/src/common/layout.cpp @@ -48,6 +48,32 @@ IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject) + +inline void wxGetAsIs(wxWindowBase* win, int* w, int* h) +{ +#if 1 + // The old way. Works for me. + win->GetSize(w, h); +#endif + +#if 0 + // Vadim's change. Breaks wxPython's LayoutAnchors + win->GetBestSize(w, h); +#endif + +#if 0 + // Proposed compromise. Doesn't work. + int sw, sh, bw, bh; + win->GetSize(&sw, &sh); + win->GetBestSize(&bw, &bh); + if (w) + *w = wxMax(sw, bw); + if (h) + *h = wxMax(sh, bh); +#endif +} + + wxIndividualLayoutConstraint::wxIndividualLayoutConstraint() { myEdge = wxTop; @@ -300,7 +326,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr { int x, y; int w, h; - win->GetSize(&w, &h); + wxGetAsIs(win, &w, &h); win->GetPosition(&x, &y); value = x + w; done = true; @@ -453,7 +479,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr { int x, y; int w, h; - win->GetSize(&w, &h); + wxGetAsIs(win, &w, &h); win->GetPosition(&x, &y); value = h + y; done = true; @@ -621,7 +647,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr if (win) { int h; - win->GetSize(&value, &h); + wxGetAsIs(win, &value, &h); done = true; return true; } @@ -679,7 +705,7 @@ bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constr if (win) { int w; - win->GetSize(&w, &value); + wxGetAsIs(win, &w, &value); done = true; return true; }