diff options
author | chai <chaifix@163.com> | 2020-11-10 18:46:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-11-10 18:46:11 +0800 |
commit | 59e6235113a4d933811aa2cf6fdc8282ce394b9d (patch) | |
tree | 12410a230c5339ca88be6842c0dc811d5c6ec0ba /Editor/GUI/EditorWindows.h | |
parent | f0807fc44dde14531759306317611bab87c8fccf (diff) |
*window
Diffstat (limited to 'Editor/GUI/EditorWindows.h')
-rw-r--r-- | Editor/GUI/EditorWindows.h | 28 |
1 files changed, 27 insertions, 1 deletions
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 <windows.h> +#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; |