summaryrefslogtreecommitdiff
path: root/Editor/GUI
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-17 23:05:01 +0800
committerchai <chaifix@163.com>2021-10-17 23:05:01 +0800
commit7c8c68d79343d04be382334c15a73d079450857c (patch)
tree9aaacc042f0b7eeb4123c07dcc5f49c14fd8026c /Editor/GUI
parent6e73ca6ada8a41692809dae5db89c8db0675ce1e (diff)
*misc
Diffstat (limited to 'Editor/GUI')
-rw-r--r--Editor/GUI/EditorWindows.h11
-rw-r--r--Editor/GUI/GUIWindow.cpp14
2 files changed, 17 insertions, 8 deletions
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 <windows.h>
#include <vector>
#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<ContainnerWindow>
{
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)
{