98 lines
4.6 KiB
C++
98 lines
4.6 KiB
C++
|
<EFBFBD><EFBFBD>// DLG_WarningSetup.cpp: <EFBFBD>[<EFBFBD>s<EFBFBD>e<EFBFBD>N
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "SmsManager.h"
|
|||
|
#include "DLG_WarningSetup.h"
|
|||
|
#include "afxdialogex.h"
|
|||
|
|
|||
|
|
|||
|
// DLG_WarningSetup <EFBFBD>[Fh
|
|||
|
|
|||
|
IMPLEMENT_DYNAMIC(DLG_WarningSetup, CDialogEx)
|
|||
|
|
|||
|
DLG_WarningSetup::DLG_WarningSetup(CWnd* pParent /*=nullptr*/)
|
|||
|
: CDialogEx(IDD_WARNINGSETUP, pParent)
|
|||
|
{
|
|||
|
memset(&m_Setup, 0, sizeof(m_Setup));
|
|||
|
}
|
|||
|
|
|||
|
DLG_WarningSetup::~DLG_WarningSetup()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
void DLG_WarningSetup::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialogEx::DoDataExchange(pDX);
|
|||
|
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_ENABLE, m_bEnable);
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_SOUND, m_bSound);
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_FLASH, m_bFlash);
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_WINDOW, m_bWindow);
|
|||
|
DDX_Text(pDX, IDC_WARNINGSETUP_TIMER, m_lTimer);
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_ONLYCONTENT, m_bOnlyContent);
|
|||
|
DDX_Check(pDX, IDC_WARNINGSETUP_TIMEOUT, m_bTimeout);
|
|||
|
DDV_MinMaxUInt(pDX, m_lTimer, 1, 100);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_WarningSetup, CDialogEx)
|
|||
|
ON_BN_CLICKED(IDOK, &DLG_WarningSetup::OnBnClickedOk)
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
|
|||
|
// DLG_WarningSetup <EFBFBD>mo`Ytz<EFBFBD>^
|
|||
|
|
|||
|
|
|||
|
void DLG_WarningSetup::OnBnClickedOk()
|
|||
|
{
|
|||
|
if (!UpdateData(true))
|
|||
|
return;
|
|||
|
|
|||
|
if (m_lTimer <= 0 || m_lTimer > 100)
|
|||
|
{
|
|||
|
MessageBox(_T("<00>[8h<38>c<EFBFBD><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD><65> g<><67><0C><><EFBFBD><EFBFBD>h<EFBFBD>g"), _T("<00>c<EFBFBD><63>"), MB_ICONINFORMATION);
|
|||
|
GetDlgItem(IDC_WARNINGSETUP_TIMER)->SetFocus();
|
|||
|
}
|
|||
|
|
|||
|
m_Setup.Warning_Enable = m_bEnable;
|
|||
|
m_Setup.Warning_Timer = m_lTimer;
|
|||
|
m_Setup.Warning_Sound = m_bSound;
|
|||
|
m_Setup.Warning_Flash = m_bFlash;
|
|||
|
m_Setup.Warning_Window = m_bWindow;
|
|||
|
|
|||
|
m_Setup.Warning_OnlyContent = m_bOnlyContent;
|
|||
|
m_Setup.Warning_Timeout = m_bTimeout;
|
|||
|
CDialogEx::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
void DLG_WarningSetup::SetSetup(SM_Setup setup)
|
|||
|
{
|
|||
|
m_Setup = setup;
|
|||
|
}
|
|||
|
SM_Setup DLG_WarningSetup::GetSetup()
|
|||
|
{
|
|||
|
return m_Setup;
|
|||
|
}
|
|||
|
|
|||
|
BOOL DLG_WarningSetup::OnInitDialog()
|
|||
|
{
|
|||
|
CDialogEx::OnInitDialog();
|
|||
|
|
|||
|
m_bEnable = m_Setup.Warning_Enable;
|
|||
|
m_lTimer = m_Setup.Warning_Timer;
|
|||
|
m_bSound = m_Setup.Warning_Sound;
|
|||
|
m_bFlash = m_Setup.Warning_Flash;
|
|||
|
m_bWindow = m_Setup.Warning_Window;
|
|||
|
|
|||
|
m_bOnlyContent = m_Setup.Warning_OnlyContent;
|
|||
|
m_bTimeout = m_Setup.Warning_Timeout;
|
|||
|
|
|||
|
if (m_lTimer <= 0 || m_lTimer > 100)
|
|||
|
m_lTimer = 8;
|
|||
|
UpdateData(false);
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// _8^: OCX ^\'`u<EFBFBD><EFBFBD>^ԏ<EFBFBD>V FALSE
|
|||
|
}
|
|||
|
|