diff options
author | chai <chaifix@163.com> | 2021-11-10 09:59:29 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-10 09:59:29 +0800 |
commit | fd646350b566dbe274b65b775029bd45b05e22bd (patch) | |
tree | a641b0ff7d60aad462a418ef210438f305eca381 | |
parent | d8417b03b9c2a820d3d3be0dfa80841b4d1f4c04 (diff) |
*misc
-rw-r--r-- | Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua | 21 | ||||
-rw-r--r-- | Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua | 18 | ||||
-rw-r--r-- | Editor/GUI/GUIWindow.cpp | 4 |
3 files changed, 33 insertions, 10 deletions
diff --git a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua index f136d56..6fc2628 100644 --- a/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua +++ b/Data/Libraries/GameLab/Editor/GUI/GUIWindow.lua @@ -1,5 +1,5 @@ -local NativeGUIWindow = GameLab.Editor.GUI.Internal.GUIWindow
local GUIWindow = GameLab.GlobalClass("GameLab.Editor.GUI.GUIWindow")
+local NativeGUIWindow = GameLab.Editor.GUI.Internal.GUIWindow
local inspect = require("inspect")
@@ -8,14 +8,24 @@ local GL = GameLab.Engine.GL local Math = GameLab.Engine.Math
local Rendering = GameLab.Engine.Rendering
-local Rect = Math.Rect
+local Rect = Math.Rect
+
+local i = 0
+local col = {
+ {1, 0, 0, 1},
+ {1, 1, 0, 1},
+ {1, 0, 1, 1},
+}
GUIWindow.Ctor = function(self)
- self.m_Native = NativeGUIWindow.New(self)
+ self.m_Native = NativeGUIWindow.New(self)
self.m_ContainerWindow = nil
self.m_SplitWindow = nil -- parent window
self.m_Position = Rect.New(0,0,0,0) -- 在父窗口中的位置和大小
self.m_EditorWindows = {} -- 编辑器脚本
+
+ i = i + 1
+ self.m_ClearColor = col[i]
end
GUIWindow.SetContainerWindow = function(self, containerWindow)
@@ -34,11 +44,10 @@ end GUIWindow.OnGUI = function(self)
self:ClearBackground()
-
end
GUIWindow.OnEvent = function(self, evt)
-
+ Debug.Log("mousePos=" .. evt.mousePosition.x .. "," .. evt.mousePosition.y)
end
GUIWindow.GetContainerWindow = function(self)
@@ -50,7 +59,7 @@ GUIWindow.OnFocus = function(self) end
GUIWindow.ClearBackground = function(self)
- GL.ClearColor({1,0,0,1})
+ GL.ClearColor(self.m_ClearColor)
GL.Clear(GL.EBufferType.ColorBuffer)
end
diff --git a/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua b/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua index d594bee..25bcc12 100644 --- a/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua +++ b/Data/Libraries/GameLab/Editor/GUI/SplitWindow.lua @@ -1,3 +1,10 @@ +local Splitter = GameLab.Class("GameLab.Editor.GUI.Internal.Splitter") + +Splitter.Ctor = function(self) + self.width = 10 +end + +-- 抽象的窗口,用来处理布局 local SplitWindow = GameLab.GlobalClass("GameLab.Editor.GUI.SplitWindow") local ESplitMode = GameLab.GlobalEnum("GameLab.Editor.GUI.ESplitMode", { @@ -8,9 +15,18 @@ local ESplitMode = GameLab.GlobalEnum("GameLab.Editor.GUI.ESplitMode", { SplitWindow.Ctor = function(self) self.m_Splitter = {} self.m_SplitMode = ESplitMode.Horizontal - self.m_GUIWindows = {} + self.m_GUIWindow = nil + self.m_Parent = nil -- 父节点也是一个split window + self.m_Children = {} -- 子节点也是split windows +end + +SplitWindow.DoSplit = function(self) + end +-- 返回guiWnd +SplitWindow.IndexOfGUIWindow = function(self, guiWnd) +end return SplitWindow
\ No newline at end of file diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index c79cb52..5aa598d 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -77,8 +77,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara return 0; } - //Assert(self->m_Handle != hWnd); - //self->ProcessEventMessages(message, wParam, lParam); + self->ProcessEventMessages(message, wParam, lParam); return 0; } @@ -141,7 +140,6 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara break; } - // 룬 self->ProcessEventMessages(message, wParam, lParam); } |