update window

This commit is contained in:
Nomango 2018-07-13 01:33:53 +08:00
parent 6d9f1686a7
commit be45d21d06
2 changed files with 20 additions and 20 deletions

View File

@ -293,12 +293,12 @@ void e2d::Window::setCursor(Cursor cursor)
::SetCursor(hCursor); ::SetCursor(hCursor);
} }
void e2d::Window::showConsole(bool show) void e2d::Window::setConsoleEnabled(bool enabled)
{ {
// 查找已存在的控制台句柄 // 查找已存在的控制台句柄
HWND hwnd = ::GetConsoleWindow(); HWND hwnd = ::GetConsoleWindow();
// 关闭控制台 // 关闭控制台
if (show) if (enabled)
{ {
if (hwnd) if (hwnd)
{ {

View File

@ -64,7 +64,7 @@ private:
}; };
// 窗口控制 // 窗
class Window class Window
{ {
public: public:
@ -79,29 +79,29 @@ public:
}; };
public: public:
// 获取窗实例 // 获取窗实例
static Window * getInstance(); static Window * getInstance();
// 销毁窗实例 // 销毁窗实例
static void destroyInstance(); static void destroyInstance();
// 创建窗互斥体 // 创建窗互斥体
bool createMutex( bool createMutex(
const String& mutex = L"" /* 进程互斥体名称 */ const String& mutex = L"" /* 进程互斥体名称 */
); );
// 修改窗大小 // 修改窗大小
void setSize( void setSize(
int width, /* 窗宽度 */ int width, /* 窗宽度 */
int height /* 窗高度 */ int height /* 窗高度 */
); );
// 设置窗标题 // 设置窗标题
void setTitle( void setTitle(
const String& title /* 窗标题 */ const String& title /* 窗标题 */
); );
// 设置窗图标 // 设置窗图标
void setIcon( void setIcon(
int iconID int iconID
); );
@ -111,24 +111,24 @@ public:
Cursor cursor Cursor cursor
); );
// 获取窗标题 // 获取窗标题
String getTitle(); String getTitle();
// 获取窗宽度 // 获取窗宽度
double getWidth(); double getWidth();
// 获取窗高度 // 获取窗高度
double getHeight(); double getHeight();
// 获取窗大小 // 获取窗大小
Size getSize(); Size getSize();
// 获取窗口句柄 // 获取窗口句柄
HWND getHWnd(); HWND getHWnd();
// 打开/隐藏控制台 // 打开隐藏控制台
void showConsole( void setConsoleEnabled(
bool show = true bool enabled
); );
// 是否允许响应输入法 // 是否允许响应输入法
@ -154,7 +154,7 @@ public:
const String& title = L"Error" /* 窗口标题 */ const String& title = L"Error" /* 窗口标题 */
); );
// 处理窗消息 // 处理窗消息
void poll(); void poll();
private: private: