refactor layout.h into single file per Node* classes

This commit is contained in:
2017-05-13 21:58:04 +01:00
parent 51e355d039
commit 1f6c688258
55 changed files with 3600 additions and 2675 deletions

View File

@@ -0,0 +1,21 @@
#include "pch.h"
#include "log.h"
#include "node_message_box.h"
#include "layout.h"
Node* NodeMessageBox::clone_instantiate() const
{
return new NodeMessageBox();
}
void NodeMessageBox::init()
{
SetPosition(0, 0);
SetWidthP(100);
SetHeightP(100);
SetPositioning(YGPositionTypeAbsolute);
m_template = (*m_manager)[const_hash("message-box")]->m_children[0]->clone();
add_child(m_template);
btnOk = m_template->find<NodeButton>("btn-ok");
btnOk->on_click = [&](Node*) { destroy(); };
}