From 8ee3f7453bf7b0db5c7358e697e91714d825c87d Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 9 Jun 2019 21:12:25 +0800 Subject: *misc --- source/Asura.Editor/system/editor_window.cpp | 6 ++ source/Asura.Editor/system/editor_window.h | 62 +++++++++++++++++++++ source/Asura.Editor/system/window.cpp | 13 ----- source/Asura.Editor/system/window.h | 82 ---------------------------- 4 files changed, 68 insertions(+), 95 deletions(-) create mode 100644 source/Asura.Editor/system/editor_window.cpp create mode 100644 source/Asura.Editor/system/editor_window.h delete mode 100644 source/Asura.Editor/system/window.cpp delete mode 100644 source/Asura.Editor/system/window.h (limited to 'source/Asura.Editor') diff --git a/source/Asura.Editor/system/editor_window.cpp b/source/Asura.Editor/system/editor_window.cpp new file mode 100644 index 0000000..0e2d4f4 --- /dev/null +++ b/source/Asura.Editor/system/editor_window.cpp @@ -0,0 +1,6 @@ +#include "editor_window.h" + +namespace AsuraEditor +{ + +} // AsruaEditor \ No newline at end of file diff --git a/source/Asura.Editor/system/editor_window.h b/source/Asura.Editor/system/editor_window.h new file mode 100644 index 0000000..8a3b0e1 --- /dev/null +++ b/source/Asura.Editor/system/editor_window.h @@ -0,0 +1,62 @@ +#ifndef __ASURA_EDITOR_WINDOW_H__ +#define __ASURA_EDITOR_WINDOW_H__ + +#include +#include + +#include + +#include "../type.h" + +namespace AsuraEditor +{ + + /// + /// 包含编辑器窗口的native窗口 + /// + class ContainerWindow : public AEScripting::Portable + { + public: + + enum WindowStyle + { + WINDOW_STYLE_BASIC, ///< 基础风格 + WINDOW_STYLE_TOOL, ///< 工具栏风格 + WINDOW_STYLE_CONFIRM, ///< 确认窗口 + }; + + struct WindowConfig + { + std::string title; ///< 标题 + uint x, y; ///< 坐标 + uint width, height; ///< 大小 + WindowStyle style; ///< 风格 + }; + + ContainerWindow(); + ~ContainerWindow(); + + bool Init(WindowConfig& config); + + private: + + ContainerWindow* mParent; + WindowStyle mStyle; + HWND mHWND; + HDC mHDC; + + luaxport: + + LUAX_DECL_FACTORY(ContainerWindow); + + LUAX_DECL_ENUM(WindowStyle); + + LUAX_DECL_METHOD(_New); + LUAX_DECL_METHOD(_Init); + LUAX_DECL_METHOD(_SetPosition); + + }; + +} // AsuraEditor + +#endif \ No newline at end of file diff --git a/source/Asura.Editor/system/window.cpp b/source/Asura.Editor/system/window.cpp deleted file mode 100644 index 440c88c..0000000 --- a/source/Asura.Editor/system/window.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "window.h" - -namespace AsuraEditor -{ - - bool Window::Init(int posx, uint posy, uint w, uint h) - { - if (mHWND) - return false; - - } - -} \ No newline at end of file diff --git a/source/Asura.Editor/system/window.h b/source/Asura.Editor/system/window.h deleted file mode 100644 index c9837e3..0000000 --- a/source/Asura.Editor/system/window.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef __ASURA_EDITOR_WINDOW_H__ -#define __ASURA_EDITOR_WINDOW_H__ - -#include -#include - -#include - -#include "../type.h" - -namespace AsuraEditor -{ - - /// - /// 窗口风格,只指明了框架的风格,具体的控件由应用程序绘制。 - /// - enum WindowStyle - { - WINDOW_STYLE_BASIC, ///< 基础风格 - WINDOW_STYLE_TOOL, ///< 工具栏风格 - WINDOW_STYLE_CONFIRM, ///< 确认窗口 - }; - - /// - /// 创建窗口时需要的配置项。 - /// - struct WindowConfig - { - std::string title; ///< 标题 - uint x, y; ///< 坐标 - uint width, height; ///< 大小 - WindowStyle style; ///< 风格 - }; - - /// - /// 编辑器创建的win32窗口,每一个窗口包含一个HWND和一个HDC - /// - class Window - : public AEScripting::Portable - { - public: - - Window(); - ~Window(); - - bool Init(WindowConfig& config); - - private: - - //------------------------------------------------------------------------------// - - LUAX_DECL_FACTORY(Window); - - LUAX_DECL_ENUM(WindowStyle); - - LUAX_DECL_METHOD(_New); - LUAX_DECL_METHOD(_Init); - LUAX_DECL_METHOD(_SetPosition); - - //------------------------------------------------------------------------------// - - /// - /// 父窗口。 - /// - Window* mParent; - - /// - /// 窗口句柄和设备上下文。 - /// - HWND mHWND; - HDC mHDC; - - /// - /// 窗口风格。 - /// - WindowStyle mStyle; - - }; - -} - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0