From 7c8c68d79343d04be382334c15a73d079450857c Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 17 Oct 2021 23:05:01 +0800 Subject: *misc --- Editor/GUI/EditorWindows.h | 11 +++++++++-- Editor/GUI/GUIWindow.cpp | 14 ++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'Editor/GUI') diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index 8a146e2..42d2623 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -4,13 +4,15 @@ #include #include #include "Runtime/Math/Rect.h" -#include "Runtime/Scripting/LuaBind.h" +#include "Runtime/LuaBind/LuaBind.h" #include "Runtime/Utilities/Singleton.h" #include "Editor/Utils/Log.h" #include "Runtime/Graphics/OpenGL.h" #include "Runtime/Utilities/UtilMacros.h" #include "Editor/Utils/HelperFuncs.h" +using namespace LuaBind; + class GUIWindow; class WindowUtil @@ -35,7 +37,8 @@ private: }; // 一个containner window中有多个viewport -class ContainnerWindow +class ContainnerWindow + : public LuaBind::NativeClass { public: static LRESULT CALLBACK ContainerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -85,6 +88,10 @@ private: POINT m_MinSize; POINT m_MaxSize; + LUA_BIND_DECL_FACTORY(ContainnerWindow); + LUA_BIND_DECL_METHOD(_SetTitle); + LUA_BIND_DECL_METHOD(_DoPaint); + }; // 窗口基类 diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 1fe88ca..e58b620 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -4,18 +4,18 @@ static bool RedirectMouseWheel(HWND window, WPARAM wParam, LPARAM lParam) { - //// prevent reentrancy + /// prevent reentrancy //static bool s_ReentrancyCheck = false; //if (s_ReentrancyCheck) // return false; - //// 找到对应的子窗口 + /// 找到对应的子窗口 //GUIWindow* view = GetMouseOverWindow(); //if (!view) // return false; - //// 将鼠标滚轮事件派发到子窗口上去 - //// send mouse wheel to view under mouse + /// 将鼠标滚轮事件派发到子窗口上去 + /// send mouse wheel to view under mouse //s_ReentrancyCheck = true; //::SendMessage(view->GetWindowHandle(), WM_MOUSEWHEEL, wParam, lParam); //s_ReentrancyCheck = false; @@ -56,6 +56,8 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara case WM_MOUSEWHEEL: // 在这个子窗口滚动 { + log_info("WM_MOUSEWHEEL"); + // quick check if mouse is in our window RECT rc; POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; @@ -68,7 +70,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara return 0; } - Assert(self->m_Handle != hWnd); + //Assert(self->m_Handle != hWnd); //self->ProcessEventMessages(message, wParam, lParam); return 0; } @@ -172,7 +174,7 @@ void GUIWindow::RepaintAll() { } -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// void GUIWindow::ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam) { -- cgit v1.1-26-g67d0