diff --git a/uppsrc/CtrlCore/TopWindow.cpp b/uppsrc/CtrlCore/TopWindow.cpp index 508ac29ec..e126a6266 100644 --- a/uppsrc/CtrlCore/TopWindow.cpp +++ b/uppsrc/CtrlCore/TopWindow.cpp @@ -540,4 +540,16 @@ void ArrangeOKCancel(Ctrl& ok, Ctrl& cancel) } } +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) +{ + SetLayout_Size(ctrl, Size(cx, cy)); +} + } diff --git a/uppsrc/CtrlCore/TopWindow.h b/uppsrc/CtrlCore/TopWindow.h index 1701fcc90..f4c8536a1 100644 --- a/uppsrc/CtrlCore/TopWindow.h +++ b/uppsrc/CtrlCore/TopWindow.h @@ -193,6 +193,9 @@ void ArrangeOKCancel(Ctrl& ok, Ctrl& cancel); int SwapOKCancel(); void SwapOKCancel_Write(int b); +void SetLayout_Size(Ctrl& ctrl, Size sz); +void SetLayout_Size(Ctrl& ctrl, int cx, int cy); + template void InitLayout(Ctrl& ctrl, L& layout) { @@ -202,9 +205,7 @@ void InitLayout(Ctrl& ctrl, L& layout) template void CtrlLayout(T& ctrl) { InitLayout(ctrl, ctrl, ctrl, ctrl); - Size sz = ctrl.AddFrameSize(T::GetLayoutSize()); - ctrl.SetMinSize(sz); - ctrl.SetRect(sz); + SetLayout_Size(ctrl, T::GetLayoutSize()); } template diff --git a/uppsrc/CtrlCore/lay.h b/uppsrc/CtrlCore/lay.h index 5b4f18102..f6de9b7fd 100644 --- a/uppsrc/CtrlCore/lay.h +++ b/uppsrc/CtrlCore/lay.h @@ -26,7 +26,7 @@ #undef ITEM #undef END_LAYOUT -#define LAYOUT(nm, x, y) template inline void SetLayout_##nm(T& parent, bool add = false, bool show = false) { +#define LAYOUT(nm, x, y) template inline void SetLayout_##nm(T& parent, bool add = false, bool show = false) { SetLayout_Size(parent, x, y); #define UNTYPED(var, param) parent.var.param; if(add) parent.Add(parent.var); if(show) parent.var.Show(); #define ITEM(clss, var, param) UNTYPED(var, param); #define END_LAYOUT } @@ -38,7 +38,7 @@ #undef ITEM #undef END_LAYOUT -#define LAYOUT(nm, x, y) template inline void SetLayout_##nm(T& ctrl, D& parent, bool add = false, bool show = false) { +#define LAYOUT(nm, x, y) template inline void SetLayout_##nm(T& ctrl, D& parent, bool add = false, bool show = false) { SetLayout_Size(parent, x, 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 } diff --git a/uppsrc/IconDes/List.cpp b/uppsrc/IconDes/List.cpp index c38e6a3bb..45093ac9b 100644 --- a/uppsrc/IconDes/List.cpp +++ b/uppsrc/IconDes/List.cpp @@ -297,7 +297,6 @@ void IconDes::InsertFile() ml.Add(mm); } int ii = 0; - DDUMP(ml.GetCount()); for(Image m : ml) { String id = Filter(GetFileTitle(fn), CharFilterImageId); if(!IsAlpha(*id) && *id != '_')