From 4dafefe46a72ba47468b13d011f8299055081b0f Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 22 Oct 2021 23:59:54 +0800 Subject: *LuaBind --- Editor/GUI/ContainerWindow.cpp | 3 ++- Editor/GUI/EditorWindows.h | 4 +++- Editor/GUI/GUIWindow.cpp | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Editor/GUI') diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp index ee42635..2aca239 100644 --- a/Editor/GUI/ContainerWindow.cpp +++ b/Editor/GUI/ContainerWindow.cpp @@ -177,7 +177,8 @@ LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPAR return flag; } -ContainerWindow::ContainerWindow() +ContainerWindow::ContainerWindow(LuaBind::VM* vm) + : LuaBind::NativeClass(vm) { } diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index 58a37fb..d9805a0 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -53,7 +53,7 @@ public: kShowAuxWindow = 5, // Popup windows like the color picker, gradient editor, etc. Drawn with black background on Mac }; - ContainerWindow(); + ContainerWindow(LuaBind::VM* vm); ~ContainerWindow(); void Init(Rectf size, int showMode, const Vector2f& minSize, const Vector2f& maxSize, std::string name = ""); @@ -134,6 +134,8 @@ public: static LRESULT CALLBACK GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static void RepaintAll(); + GUIWindow(LuaBind::VM* vm); + void Init(std::string name = ""); void DoPaint(); void SetContainerWindow(ContainerWindow* wnd); diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 0502b21..8918ad3 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -174,6 +174,12 @@ void GUIWindow::RepaintAll() //////////////////////////////////////////////////////////// +GUIWindow::GUIWindow(LuaBind::VM* vm) + : LuaBind::NativeClass(vm) + , m_Instance(vm, Ref::STRONG_REF) +{ +} + void GUIWindow::ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam) { @@ -226,7 +232,6 @@ void GUIWindow::Init(std::string name) log_error("Failed to setup rendering context"); log_info("Created GUIWindow " /*+ (long)this*/); - } bool GUIWindow::SetRenderContext() -- cgit v1.1-26-g67d0