summaryrefslogtreecommitdiff
path: root/Editor/GUI
diff options
context:
space:
mode:
Diffstat (limited to 'Editor/GUI')
-rw-r--r--Editor/GUI/ContainerWindow.cpp21
-rw-r--r--Editor/GUI/ContainerWindow.h6
-rw-r--r--Editor/GUI/GUIWindow.cpp4
3 files changed, 17 insertions, 14 deletions
diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp
index 59cd008..f76ac73 100644
--- a/Editor/GUI/ContainerWindow.cpp
+++ b/Editor/GUI/ContainerWindow.cpp
@@ -96,19 +96,12 @@ LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPAR
case WM_WINDOWPOSCHANGED: // 窗口大小、位置、z层级改变,即窗口区域改变
{
+ //log_info_tag("WndProc", "WM_WINDOWPOSCHANGED" );
+
if (!self->m_IsClosing && !IsIconic(hWnd)) //IsIconic 窗口是否是最小化(图标化)
{
- // OnRectChanged()回调
- self->OnRectChanged();
+ self->OnSizeChanged();
}
- // WM_WINDOWPOSCHANGED 消息触发后且调用了DefWindowProc会接着发送WM_SIZE和WM_MOVE消息。在WM_WINDOWPOSCHANGED
- // 中一起处理大小和位置改变更高效
- /*
- By default, the DefWindowProc function sends the WM_SIZE and WM_MOVE messages to the window.
- The WM_SIZE and WM_MOVE messages are not sent if an application handles the WM_WINDOWPOSCHANGED
- message without calling DefWindowProc. It is more efficient to perform any move or size change
- processing during the WM_WINDOWPOSCHANGED message without calling DefWindowProc.
- */
break;
}
@@ -441,9 +434,15 @@ Vector2f ContainerWindow::GetSize()
return size;
}
-void ContainerWindow::OnRectChanged()
+void ContainerWindow::OnSizeChanged()
{
+ LuaBind::State state = GetVM()->GetCurThread();
+ LuaBind::MemberInvoker invoker = MemberInvoker(state, this);
+ invoker.member = m_Script;
+ invoker.method = "OnSizeChanged";
+ invoker.AddMember(m_Script);
+ invoker.Invoke(0);
}
void ContainerWindow::OnActivateApplication(bool active)
diff --git a/Editor/GUI/ContainerWindow.h b/Editor/GUI/ContainerWindow.h
index 08f08fe..09a1f0f 100644
--- a/Editor/GUI/ContainerWindow.h
+++ b/Editor/GUI/ContainerWindow.h
@@ -47,7 +47,7 @@ public:
GET(HWND, WindowHandle, m_Window);
GET(HDC, DC, m_DC);
- void OnRectChanged();
+ void OnSizeChanged();
void OnActivateApplication(bool active);
private:
@@ -66,10 +66,10 @@ private:
POINT m_MinSize;
POINT m_MaxSize;
-#ifdef GAMELAB_WIN
HWND m_Window;
HDC m_DC;
-#endif
+
+ LuaBind::MemberRef m_Script;
//--------------------------------------------------------
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp
index aaab6a8..19ceb85 100644
--- a/Editor/GUI/GUIWindow.cpp
+++ b/Editor/GUI/GUIWindow.cpp
@@ -168,6 +168,8 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
// self->RequestRepaint();
// }
+ self->DoPaint();
+
// // Update the scene so that scripts marked with [ExecuteInEditMode] are able to react to screen size changes
// GetApplication().SetSceneRepaintDirty();
//}
@@ -269,6 +271,8 @@ void GUIWindow::ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam)
SCRIPT_GLOBAL.guiBeginOnGUI.Invoke(state, 0);
+ SetAsRenderContext();
+
LuaBind::MemberInvoker invoker = LuaBind::MemberInvoker(state, this);
invoker.member = m_Script;
invoker.method = "OnGUI";