CtrlCore: Fixed issues with Layout

git-svn-id: svn://ultimatepp.org/upp/trunk@12744 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-02-05 09:03:19 +00:00
parent ae76caac74
commit d19c2ef021
3 changed files with 4 additions and 3 deletions

View file

@ -544,7 +544,6 @@ void SetLayout_Size(Ctrl& ctrl, Size sz)
{
sz = ctrl.AddFrameSize(sz);
ctrl.SetMinSize(sz);
ctrl.SetRect(sz);
}
void SetLayout_Size(Ctrl& ctrl, int cx, int cy)

View file

@ -204,7 +204,9 @@ void InitLayout(Ctrl& ctrl, L& layout)
template <class T>
void CtrlLayout(T& ctrl) {
InitLayout(ctrl, ctrl, ctrl, ctrl);
SetLayout_Size(ctrl, T::GetLayoutSize());
Size sz = T::GetLayoutSize();
SetLayout_Size(ctrl, sz);
ctrl.SetRect(sz);
}
template <class T>

View file

@ -40,7 +40,7 @@
#undef END_LAYOUT
#define LAYOUT(nm, x, y) template<class T, class D> inline void SetLayout_##nm(T& ctrl, D& parent, bool add = false, bool show = false) { \
SetLayout_Size(parent, Zx(x), Zy(y));
SetLayout_Size(ctrl, Zx(x), Zy(y));
#define UNTYPED(var, param) parent.var.param; if(add) ctrl.Add(parent.var); if(show) parent.var.Show();
#define ITEM(clss, var, param) UNTYPED(var, param);
#define END_LAYOUT }