diff options
Diffstat (limited to 'Editor/GUI/EditorWindows.h')
-rw-r--r-- | Editor/GUI/EditorWindows.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/Editor/GUI/EditorWindows.h b/Editor/GUI/EditorWindows.h index 90e71a4..a78e163 100644 --- a/Editor/GUI/EditorWindows.h +++ b/Editor/GUI/EditorWindows.h @@ -2,23 +2,51 @@ #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 +// 窗口内的单个子窗口,是事件相应、绘制、布局的单元 +class GUIView { public: + static LRESULT CALLBACK GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + + void DoPaint(); private: HWND m_View; |