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);
}
void e2d::Window::showConsole(bool show)
void e2d::Window::setConsoleEnabled(bool enabled)
{
// 查找已存在的控制台句柄
HWND hwnd = ::GetConsoleWindow();
// 关闭控制台
if (show)
if (enabled)
{
if (hwnd)
{

View File

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