summaryrefslogtreecommitdiff
path: root/Editor/GUI/EditorWindows.h
diff options
context:
space:
mode:
Diffstat (limited to 'Editor/GUI/EditorWindows.h')
-rw-r--r--Editor/GUI/EditorWindows.h38
1 files changed, 28 insertions, 10 deletions
diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h
index 33d99c1..8a146e2 100644
--- a/Editor/GUI/EditorWindows.h
+++ b/Editor/GUI/EditorWindows.h
@@ -8,6 +8,8 @@
#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"
class GUIWindow;
@@ -26,6 +28,10 @@ class WindowManager : Singleton<WindowManager>
public:
static Vector2f GetMousePosition();
static GUIWindow* GetMouseOverWindow();
+
+private:
+ static std::vector<GUIWindow*> s_GUIWindows;
+
};
// 一个containner window中有多个viewport
@@ -46,19 +52,27 @@ public:
ContainnerWindow();
~ContainnerWindow();
- void Init(Rectf size, int showMode, const Vector2f& minSize, const Vector2f& maxSize);
+ void Init(Rectf size, int showMode, const Vector2f& minSize, const Vector2f& maxSize, std::string name = "");
void SetTitle(const char* title);
void SetIcon(LPCSTR iconName);
void SetAsRenderContext();
void DoPaint();
+ void Close();
+
+ GET_SET(std::string, Name, m_Name);
- HWND GetWindowHandle();
- HDC GetDC() { return m_DC; }
- HGLRC GetRC() { return m_RC; }
+ GET(HWND, WindowHandle, m_Window);
+ GET(HDC, DC, m_DC);
+ GET(HGLRC, RC, m_RC);
+
+ void OnRectChanged();
+ void OnActivateApplication(bool active);
private:
bool SetRenderContext();
+ std::string m_Name;
+
HWND m_Window;
HDC m_DC;
HGLRC m_RC;
@@ -90,24 +104,24 @@ public:
SplitMode GetSplitMode() { return m_SplitMode; }
+ GET(SplitMode, SplitMode, m_SplitMode);
+
private:
SplitMode m_SplitMode;
GUIWindow* m_GUIWindow;
- std::vector<GUIWindow*> m_GUIWindows;
+ std::vector<GUIWindow*>* m_GUIWindows;
};
// GUI窗口,事件相应、绘制、布局的单元
-// 和unity不一样的地方在于一个GUIWindow只会有一个EditorWindow,即一个切页,因为在实际开发中我发现很少会频繁的切换切页,UE逻辑更像blender
-// 好处也在于比较好组织
class GUIWindow : public WindowBase
{
public:
static LRESULT CALLBACK GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static void RepaintAll();
- void Init();
+ void Init(std::string name = "");
void DoPaint();
void SetContainnerWindow(ContainnerWindow* wnd);
void Focus();
@@ -117,12 +131,16 @@ public:
void OnFocus();
void OnLostFocus();
- HDC GetDC() { return m_DC; }
- HGLRC GetRC() { return m_RC; }
+ GET_SET(std::string, Name, m_Name);
+ GET(HDC, DC, m_DC);
+ GET(HGLRC, RC, m_RC);
private:
+ void ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam);
bool SetRenderContext();
+ std::string m_Name;
+
ContainnerWindow* m_ContainnerWindow;
HWND m_Handle;
HDC m_DC;