rename engine to src

This commit is contained in:
2018-09-16 14:21:58 +02:00
parent eccb34724e
commit 71de44a7c1
120 changed files with 282 additions and 282 deletions

52
src/node_popup_menu.cpp Normal file
View File

@@ -0,0 +1,52 @@
#include "pch.h"
#include "log.h"
#include "node_popup_menu.h"
Node* NodePopupMenu::clone_instantiate() const
{
return new NodePopupMenu();
}
void NodePopupMenu::init()
{
m_flood_events = true;
SetPosition(0, 0);
SetWidth(100);
SetHeight(500);
SetPositioning(YGPositionTypeAbsolute);
m_mouse_ignore = false;
m_capture_children = false;
}
kEventResult NodePopupMenu::handle_event(Event* e)
{
switch (e->m_type)
{
case kEventType::MouseDownL:
break;
case kEventType::MouseUpL:
if (!m_mouse_inside)
{
mouse_release();
}
else
{
for (int i = 0; i < m_children.size(); i++)
{
if (m_children[i]->m_mouse_inside)
{
if (on_select)
on_select(this, i);
break;
}
}
mouse_release();
}
destroy();
break;
default:
return kEventResult::Available;
break;
}
return kEventResult::Consumed;
}