From 59e6235113a4d933811aa2cf6fdc8282ce394b9d Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 10 Nov 2020 18:46:11 +0800 Subject: *window --- Editor/GUI/EditorWindows.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'Editor/GUI/EditorWindows.h') diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index 90e71a4..ca1c059 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -2,23 +2,49 @@ #define EDITOR_WINDOW_H #include +#include "../../Runtime/Math/Rect.h" + +void RegisterWindowClasses(); // 一个containner window中有多个viewport class ContainnerWindow { public: + enum ShowMode { + kShowNormalWindow = 0, // normal window with max/min/close buttons + kShowPopupMenu = 1, // popup menu - no title bar + kShowUtility = 2, // tool window - floats in the app, and hides when the app deactivates + kShowNoShadow = 3, // no shadow/decorations + kShowMainWindow = 4, // main Unity window. On Mac does not have close button; on Windows has menu bar etc. + kShowAuxWindow = 5, // Popup windows like the color picker, gradient editor, etc. Drawn with black background on Mac + }; + + ContainnerWindow(); + ~ContainnerWindow(); + + static LRESULT CALLBACK ContainerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + + void Init(Rectf size, int showMode, const Vector2f& minSize, const Vector2f& maxSize); private: HWND m_Window; POINT m_Size; + ShowMode m_ShowMode; + bool m_IsClosing; + bool m_InMenuLoop; + bool m_CloseFromScriptDontShutdown; + Rectf m_InternalRect; + POINT m_MinSize; + POINT m_MaxSize; }; -// 窗口内的单个viewport +// 窗口内的单个子窗口,是事件相应、绘制、布局的单元 class Viewport { public: + static LRESULT CALLBACK ViewportWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); private: HWND m_View; -- cgit v1.1-26-g67d0