#include "test_panel_2.hpp" #include "utils.hpp" namespace sandbox { void test_panel_2::on_attach() { VE::CONNECT(this); // ATTENTION: активировать сигнальную систему в детях-компонентах m_local_panel.on_attach(); // for (int i = 0; i < 200; ++i) // { // auto lp = std::make_shared(); // lp->on_attach(); // m_local_panel_hub.push_back(lp); // } auto lp = std::make_shared(); lp->on_attach(); m_local_panel_hub.push_back(lp); hack::log()("on_attach"); } void test_panel_2::render() { ImGui::SetNextWindowPos(m_pos); ImGui::SetNextWindowSize(m_size); if (!ImGui::Begin("#test_panel_2", &m_p_open, m_window_flags)) ImGui::End(); m_local_panel.render(); for(auto& lp : m_local_panel_hub) lp->render(); ImGui::End(); } void test_panel_2::on_event(VE::event e) { // для событий от перефирии // if (e.m_type.type() == typeid(VE::event_type)) // { // auto t = std::any_cast(e.m_type); // if (t != VE::event_type::MOUSE_CURSOR_POSITION) // hack::log()((int)t); // } if (e.m_type.type() == typeid(test_event)) { auto t = std::any_cast(e.m_type); if (t == test_event::TEST_EVEN) hack::log()(std::any_cast(e.m_data)); } } void test_panel_2::update() { } }