From 7bf672fd0c6211909d94078b448032b1bd0916ef Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 23 Oct 2021 18:19:18 +0800 Subject: *misc --- Editor/GUI/GUIWindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Editor/GUI/GUIWindow.cpp') diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 2127232..fb23a59 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -45,7 +45,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara { log_info("WndProc", "WM_PAINT"); self->SetAsRenderContext(); - + self->OnPaint(); BeginPaint(self->m_Handle, &ps); EndPaint(self->m_Handle, &ps); UpdateWindow(self->m_Handle); @@ -150,6 +150,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara } case WM_SETFOCUS: //获得焦点 + self->OnFocus(); return 0; case WM_KILLFOCUS: //失去焦点 return 0; @@ -176,7 +177,7 @@ void GUIWindow::RepaintAll() GUIWindow::GUIWindow(LuaBind::VM* vm) : LuaBind::NativeClass(vm) - , m_Instance() + , m_Script() { } @@ -313,12 +314,18 @@ void GUIWindow::DoPaint() void GUIWindow::OnFocus() { + InvokeLuaCallback(m_Script, "OnFocus"); } void GUIWindow::OnLostFocus() { } +void GUIWindow::OnPaint() +{ + InvokeLuaCallback(m_Script, "OnPaint"); +} + void GUIWindow::SetPosition(Rectf position) { log_info("GUIWindow::SetPosition()"); -- cgit v1.1-26-g67d0