SmsManager/DLG_DoubleConfirm.cpp

89 lines
1.8 KiB
C++

// DLG_DoubleConfirm.cpp: 实现文件
//
#include "stdaFx.h"
#include "SmsManager.h"
#include "afxdialogex.h"
#include "DLG_DoubleConfirm.h"
// DLG_DoubleConfirm 对话框
IMPLEMENT_DYNAMIC(DLG_DoubleConfirm, CDialogEx)
DLG_DoubleConfirm::DLG_DoubleConfirm(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DOUBLECONFIRM, pParent)
, m_strText(_T(""))
, m_strTip(_T(""))
, m_strConfirm(_T(""))
, m_strInput(_T(""))
{
}
DLG_DoubleConfirm::~DLG_DoubleConfirm()
{
}
void DLG_DoubleConfirm::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDD_DOUBLECONFIRM_TIPTEXT, m_strText);
DDV_MaxChars(pDX, m_strText, 30);
DDX_Text(pDX, IDD_DOUBLECONFIRM_CONFIRMTEXT, m_strConfirm);
DDX_Text(pDX, IDD_DOUBLECONFIRM_INPUT, m_strInput);
DDV_MaxChars(pDX, m_strInput, 30);
}
BEGIN_MESSAGE_MAP(DLG_DoubleConfirm, CDialogEx)
ON_BN_CLICKED(IDOK, &DLG_DoubleConfirm::OnBnClickedOk)
END_MESSAGE_MAP()
// DLG_DoubleConfirm 消息处理程序
BOOL DLG_DoubleConfirm::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
if (m_strTitle.GetLength() > 0)
{
SetWindowText(m_strTitle);
}
if (m_strTipText.GetLength() > 0)
{
m_strText = m_strTipText;
}
if (m_strConfirmText.GetLength() > 0)
{
m_strConfirm = m_strConfirmText;
}
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void DLG_DoubleConfirm::SetParam(CString strConfirmText,CString strTipText,CString strTitle)
{
m_strConfirmText = strConfirmText;
m_strTipText = strTipText;
m_strTitle = strTitle;
}
void DLG_DoubleConfirm::OnBnClickedOk()
{
if (!UpdateData(true))
return;
if (m_strInput != m_strConfirm)
{
MessageBox(_T("录入的确认内容有误,请复核!"), _T("错误"),MB_ICONERROR);
return;
}
CDialogEx::OnOK();
}