mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlCore: Fixed issue with SetLayout_*
git-svn-id: svn://ultimatepp.org/upp/trunk@12716 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a1014a975f
commit
e3c5691f96
4 changed files with 18 additions and 6 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 <class L>
|
||||
void InitLayout(Ctrl& ctrl, L& layout)
|
||||
{
|
||||
|
|
@ -202,9 +205,7 @@ void InitLayout(Ctrl& ctrl, L& layout)
|
|||
template <class T>
|
||||
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 <class T>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#undef ITEM
|
||||
#undef END_LAYOUT
|
||||
|
||||
#define LAYOUT(nm, x, y) template<class T> inline void SetLayout_##nm(T& parent, bool add = false, bool show = false) {
|
||||
#define LAYOUT(nm, x, y) template<class T> 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<class T, class D> inline void SetLayout_##nm(T& ctrl, D& parent, bool add = false, bool show = false) {
|
||||
#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, 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 }
|
||||
|
|
|
|||
|
|
@ -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 != '_')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue