fix win name

This commit is contained in:
Andrey Zimin 2024-04-01 11:36:38 +03:00
parent 1864f8cd74
commit d5338c8069
2 changed files with 18 additions and 16 deletions

View File

@ -8,6 +8,7 @@ namespace tr::layers
m_win.m_pos = { 212.f, 35.f }; m_win.m_pos = { 212.f, 35.f };
m_win.m_size = { 720.f, 480.f }; m_win.m_size = { 720.f, 480.f };
m_win.m_name = "test_win";
} }
void test_panel::on_detach() void test_panel::on_detach()
@ -20,8 +21,8 @@ namespace tr::layers
ImGui::SetNextWindowPos(m_win.m_pos); ImGui::SetNextWindowPos(m_win.m_pos);
ImGui::SetNextWindowSize(m_win.m_size); ImGui::SetNextWindowSize(m_win.m_size);
BEGIN_IMGUI_WIN("test_win"); BEGIN_IMGUI_WIN();
{
if (ImGui::Button("RUN", ImVec2(28, 30))) { if (ImGui::Button("RUN", ImVec2(28, 30))) {
m_event_manager->execute(std::string("test signal key"), "value params run"); m_event_manager->execute(std::string("test signal key"), "value params run");
} }
@ -36,6 +37,7 @@ namespace tr::layers
ImGui::Text("\xef\x87\xbc"); ImGui::Text("\xef\x87\xbc");
TR_POP_FONT(); TR_POP_FONT();
}
END_IMGUI_WIN(); END_IMGUI_WIN();
} }

View File

@ -13,7 +13,7 @@
using time = try_engine::time::timestep<float>;\ using time = try_engine::time::timestep<float>;\
using event_manager = try_engine::app_event::event;\ using event_manager = try_engine::app_event::event;\
using system_event = try_engine::system_event::event;\ using system_event = try_engine::system_event::event;\
struct win { ImVec2 m_pos { 0.f, 0.f }; ImVec2 m_size { 0.f, 0.f }; } m_win struct win { ImVec2 m_pos { 0.f, 0.f }; ImVec2 m_size { 0.f, 0.f }; std::string m_name; } m_win
#define BASE_WINDOW_FLAGS()\ #define BASE_WINDOW_FLAGS()\
if (m_flags.m_no_titlebar) m_window_flags |= ImGuiWindowFlags_NoTitleBar;\ if (m_flags.m_no_titlebar) m_window_flags |= ImGuiWindowFlags_NoTitleBar;\
@ -76,7 +76,7 @@
event_manager* m_event_manager event_manager* m_event_manager
#define BEGIN_IMGUI_WIN(name) if (!ImGui::Begin(name, &m_flags.m_p_open, m_window_flags)) ImGui::End() #define BEGIN_IMGUI_WIN() if (!ImGui::Begin(m_win.m_name.c_str(), &m_flags.m_p_open, m_window_flags)) ImGui::End()
#define END_IMGUI_WIN() ImGui::End() #define END_IMGUI_WIN() ImGui::End()
#define TR_PUSH_FONT(def_font, def_size)\ #define TR_PUSH_FONT(def_font, def_size)\