diff options
Diffstat (limited to 'Editor')
-rw-r--r-- | Editor/GUI/ContainerWindow.cpp | 10 | ||||
-rw-r--r-- | Editor/GUI/ContainerWindow.h | 3 | ||||
-rw-r--r-- | Editor/Scripting/Window/ContainerWindow.bind.cpp | 12 |
3 files changed, 24 insertions, 1 deletions
diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp index 99fa6cb..59cd008 100644 --- a/Editor/GUI/ContainerWindow.cpp +++ b/Editor/GUI/ContainerWindow.cpp @@ -431,6 +431,16 @@ void ContainerWindow::Close() SendMessage(m_Window, WM_CLOSE, 0, 0); } +Vector2f ContainerWindow::GetSize() +{ + RECT rect; + GetClientRect(m_Window, &rect); + Vector2f size; + size.x = rect.right - rect.left; + size.y = rect.bottom - rect.top; + return size; +} + void ContainerWindow::OnRectChanged() { diff --git a/Editor/GUI/ContainerWindow.h b/Editor/GUI/ContainerWindow.h index 140748d..08f08fe 100644 --- a/Editor/GUI/ContainerWindow.h +++ b/Editor/GUI/ContainerWindow.h @@ -40,6 +40,8 @@ public: void DoPaint(); void Close(); + Vector2f GetSize(); + GET_SET(std::string, Name, m_Name); GET(HWND, WindowHandle, m_Window); @@ -77,6 +79,7 @@ private: LUA_BIND_DECL_METHOD(_SetTitle); LUA_BIND_DECL_METHOD(_SetIcon); LUA_BIND_DECL_METHOD(_DoPaint); + LUA_BIND_DECL_METHOD(_GetSize); }; diff --git a/Editor/Scripting/Window/ContainerWindow.bind.cpp b/Editor/Scripting/Window/ContainerWindow.bind.cpp index 6c73116..5e7319b 100644 --- a/Editor/Scripting/Window/ContainerWindow.bind.cpp +++ b/Editor/Scripting/Window/ContainerWindow.bind.cpp @@ -9,7 +9,8 @@ LUA_BIND_REGISTRY(ContainerWindow) { "New", _New }, { "SetTitle", _SetTitle }, { "SetIcon", _SetIcon }, - { "DoPaint", _DoPaint } + { "DoPaint", _DoPaint }, + { "GetSize", _GetSize } ); } @@ -37,6 +38,15 @@ LUA_BIND_IMPL_METHOD(ContainerWindow, _SetIcon) return 0; } +LUA_BIND_IMPL_METHOD(ContainerWindow, _GetSize) +{ + LUA_BIND_PREPARE(L, ContainerWindow); + + state.PushLuaObject(self->GetSize()); + + return 1; +} + LUA_BIND_IMPL_METHOD(ContainerWindow, _DoPaint) { LUA_BIND_PREPARE(L, ContainerWindow); |