refactor layout.h into single file per Node* classes
This commit is contained in:
26
engine/node_settings.cpp
Normal file
26
engine/node_settings.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "pch.h"
|
||||
#include "log.h"
|
||||
#include "node_settings.h"
|
||||
#include "layout.h"
|
||||
|
||||
Node* NodeSettings::clone_instantiate() const
|
||||
{
|
||||
return new NodeSettings();
|
||||
}
|
||||
|
||||
void NodeSettings::init()
|
||||
{
|
||||
SetPosition(0, 0);
|
||||
SetWidthP(100);
|
||||
SetHeightP(100);
|
||||
SetPositioning(YGPositionTypeAbsolute);
|
||||
m_template = (*m_manager)[const_hash("settings")]->m_children[0]->clone();
|
||||
add_child(m_template);
|
||||
btnOk = m_template->find<NodeButton>("btn-ok");
|
||||
btnOk->on_click = [&](Node*) { destroy(); };
|
||||
}
|
||||
|
||||
kEventResult NodeSettings::handle_event(Event* e)
|
||||
{
|
||||
return kEventResult::Consumed;
|
||||
}
|
||||
Reference in New Issue
Block a user