From 167bf51d4c15f3e0b9b2d76bf45c3114c1b3c217 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Tue, 17 Jul 2018 10:34:16 +0800 Subject: [PATCH] =?UTF-8?q?Window=E7=B1=BB=E5=BC=B9=E7=AA=97=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Base/Window.cpp | 8 ++++---- core/e2dbase.h | 13 +++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/Base/Window.cpp b/core/Base/Window.cpp index 8087725f..8ed9a203 100644 --- a/core/Base/Window.cpp +++ b/core/Base/Window.cpp @@ -351,18 +351,18 @@ void e2d::Window::setTypewritingEnabled(bool enabled) } } -bool e2d::Window::popup(const String & text, const String & title, PopupStyle style, bool hasCancel) +bool e2d::Window::popup(const String & text, const String & title, Popup style, bool hasCancel) { UINT type = 0; switch (style) { - case e2d::Window::PopupStyle::Information: + case e2d::Window::Popup::Information: type = MB_ICONINFORMATION; break; - case e2d::Window::PopupStyle::Warning: + case e2d::Window::Popup::Warning: type = MB_ICONWARNING; break; - case e2d::Window::PopupStyle::Error: + case e2d::Window::Popup::Error: type = MB_ICONERROR; break; default: diff --git a/core/e2dbase.h b/core/e2dbase.h index 3f1f51b0..9e5b8c02 100644 --- a/core/e2dbase.h +++ b/core/e2dbase.h @@ -79,7 +79,7 @@ public: }; // 弹窗样式 - enum class PopupStyle : int + enum class Popup : int { Information, /* 信息 */ Warning, /* 警告 */ @@ -144,12 +144,13 @@ public: bool enabled ); - // 弹窗 + // 弹出窗口 + // 返回值:当窗口包含取消按钮时,返回值表示用户是否点击确认按钮 bool popup( - const String& text, /* 窗口内容 */ - const String& title, /* 窗口标题 */ - PopupStyle style = PopupStyle::Information, /* 弹窗样式 */ - bool hasCancel = false /* 包含取消按钮 */ + const String& text, /* 窗口内容 */ + const String& title, /* 窗口标题 */ + Popup style = Popup::Information, /* 弹窗样式 */ + bool hasCancel = false /* 包含取消按钮 */ ); // 处理窗体消息