summaryrefslogtreecommitdiff
path: root/Editor/GUI/GUIWindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'Editor/GUI/GUIWindow.h')
-rw-r--r--Editor/GUI/GUIWindow.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/Editor/GUI/GUIWindow.h b/Editor/GUI/GUIWindow.h
new file mode 100644
index 0000000..aa81b38
--- /dev/null
+++ b/Editor/GUI/GUIWindow.h
@@ -0,0 +1,69 @@
+#pragma once
+
+#include <windows.h>
+#include <vector>
+#include "Runtime/Math/Rect.h"
+#include "Runtime/Lua/LuaBind/LuaBind.h"
+#include "Runtime/Lua/LuaHelper.h"
+#include "Runtime/Utilities/Singleton.h"
+#include "Runtime/Debug/Log.h"
+#include "Runtime/Graphics/OpenGL.h"
+#include "Runtime/Utilities/UtilMacros.h"
+#include "Editor/Utils/HelperFuncs.h"
+#include "Runtime/Math/Math.h"
+#include "Runtime/Utilities/Exception.h"
+
+#include "WindowBase.h"
+
+// GUI窗口,事件相应、绘制、布局的单元
+class GUIWindow
+ : public WindowBase
+ , public LuaBind::NativeClass<GUIWindow>
+{
+public:
+ static LRESULT CALLBACK GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+ static void RepaintAll();
+
+ GUIWindow(LuaBind::VM* vm, std::string name = ""); //throw WindowException
+
+ void DoPaint();
+ void SetContainerWindow(ContainerWindow* wnd);
+ void Focus();
+ void SetPosition(Rect position);
+ void SetAsRenderContext();
+
+ void OnFocus();
+ void OnLostFocus();
+ void OnPaint();
+
+ GET_SET(std::string, Name, m_Name);
+ GET(HDC, DC, m_DC);
+
+private:
+ void ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam);
+ bool SetRenderContext();
+
+ //-----------------------------------------------------------------
+
+ std::string m_Name;
+
+ LuaBind::MemberRef m_Script;
+
+ BOOL m_MouseTracking;
+ DWORD m_MouseHoverTime;
+
+ HWND m_Handle;
+ HDC m_DC;
+
+ //-----------------------------------------------------------------
+
+ LUA_BIND_DECL_CLASS(GUIWindow);
+
+ LUA_BIND_DECL_METHOD(_New);
+ LUA_BIND_DECL_METHOD(_DoPaint);
+ LUA_BIND_DECL_METHOD(_Focus);
+ LUA_BIND_DECL_METHOD(_SetContainerWindow);
+ LUA_BIND_DECL_METHOD(_SetPosition);
+
+};
+