Added CBaseContainer::Add() for use over AddChild()
This commit is contained in:
parent
3c7f999306
commit
06c82b2de7
@ -26,6 +26,13 @@ public:
|
|||||||
CBaseContainer(std::string name = "unnamed", IWidget* parent = nullptr);
|
CBaseContainer(std::string name = "unnamed", IWidget* parent = nullptr);
|
||||||
virtual ~CBaseContainer();
|
virtual ~CBaseContainer();
|
||||||
|
|
||||||
|
template <typename T, class... Args>
|
||||||
|
T* Add(Args... args) {
|
||||||
|
auto* ret = new T(this, args...);
|
||||||
|
this->m_children.push_back(ret);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
void AddChild(IWidget* child);
|
void AddChild(IWidget* child);
|
||||||
int ChildCount();
|
int ChildCount();
|
||||||
virtual IWidget* ChildByIndex(int idx);
|
virtual IWidget* ChildByIndex(int idx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user