#include "MessageBoxWnd.h"

int MessageBoxWnd::Show(HWND m_hWnd,MessageContentType Content)
{
	int result = 0;
	switch (Content)
	{
	case MessageContentType::LongInstallingPath:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_ContentInstallFailed).c_str(),
			CLanguage::GetText(TextType::MSG_BtnBackHomePage).c_str(),
			CLanguage::GetText(TextType::MSG_BtnUseDefaultPath).c_str()
		);
		break;

	case MessageContentType::IsExitApp:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_IsExitApp).c_str(),
			CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
			CLanguage::GetText(TextType::MSG_BtnNo).c_str()
		);
		break;

	case MessageContentType::InstalledIsExitApp:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledIsExitApp).c_str(),
			CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
			CLanguage::GetText(TextType::MSG_BtnNo).c_str()
		);
		break;

	case MessageContentType::DiskNoSpace:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_DiskNoSpace).c_str(),
			CLanguage::GetText(TextType::MSG_BtnOK).c_str()
		);
		break;

	case MessageContentType::HighVertion:
		result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_OverHighVersion).c_str(), L"", MB_ICONWARNING);
		break;

	case MessageContentType::LowVersion:
		result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_UpgradeVersion).c_str(), L"", MB_OKCANCEL);
		break;

	case MessageContentType::SameVersion:
		result = MessageBox(m_hWnd, CLanguage::GetText(TextType::MSG_LatestVersion).c_str(), L"", MB_ICONWARNING);
		break;

	case MessageContentType::InstallingFailed:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_ContentOpenInstallationFolder).c_str(),
			CLanguage::GetText(TextType::MSG_BtnOpenInstallationFolder).c_str(),1/*临时的补丁，因为打开安装文件所在目录的按钮被定义为取消按钮对应的CMsgWnd.cpp有加判断Tag的条件*/
		);
		break;

	case MessageContentType::ProxyNetError:
		result = MessageBox(m_hWnd, L"代理服务器没有响应，请检查代理设置。", L"", MB_ICONWARNING);
		break;

	case MessageContentType::ReStartSystem:
		result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledNetReStartSystem).c_str(),
			CLanguage::GetText(TextType::MSG_BtnRestartSystem).c_str()
		);
		break;

	default:
		break;
	}
	return result;
}

int MessageBoxWnd::Show(HWND m_hWnd, MessageContentType Content, wstring parameter)
{
	int result = 0;
	switch (Content)
	{
	case MessageContentType::InstallingFailed:
		/*result = CMsgWnd::MessageBox(
			m_hWnd, _T(""), parameter.c_str(),
			L"打开安装路径"
		);*/
		break;
	default:
		break;
	}
	return result;
}