// Dlg_AddActionWithAlarm.cpp : 实现文件 // #include "stdafx.h" #include "Dlg_AddActionWithAlarm.h" #include ".\dlg_addactionwithalarm.h" #include "SelectVariantDlg.h" #include "DlgDatePlan.h" // CDlg_AddActionWithAlarm 对话框 IMPLEMENT_DYNAMIC(CDlg_AddActionWithAlarm, CDialog) CDlg_AddActionWithAlarm::CDlg_AddActionWithAlarm(CWnd* pParent /*=NULL*/) : CDialog(CDlg_AddActionWithAlarm::IDD, pParent) , m_sEdit_DoSet(_T("")) , m_sEdit_DoStatus(_T("")) ,m_nEdit_AlarmData( 1 ) ,m_nEdit_ResumeData( 0 ) { m_nMode = 0; } CDlg_AddActionWithAlarm::~CDlg_AddActionWithAlarm() { } void CDlg_AddActionWithAlarm::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Text(pDX, IDC_EDIT_DOSET, m_sEdit_DoSet); DDX_Text(pDX, IDC_EDIT_DOSTATUS, m_sEdit_DoStatus); DDX_Text(pDX, IDC_EDIT_ALARMDATA, m_nEdit_AlarmData); DDX_Text(pDX, IDC_EDIT_RESUMEDATA, m_nEdit_ResumeData); } BEGIN_MESSAGE_MAP(CDlg_AddActionWithAlarm, CDialog) ON_BN_CLICKED(IDC_BTN_CHOOSE1, OnBnClickedBtnChoose1) ON_BN_CLICKED(IDC_BTN_CHOOSE2, OnBnClickedBtnChoose2) ON_BN_CLICKED(IDC_BTN_PLANTIME, OnBnClickedBtnPlanTime) ON_BN_CLICKED(IDOK, OnBnClickedOk) END_MESSAGE_MAP() // CDlg_AddActionWithAlarm 消息处理程序 BOOL CDlg_AddActionWithAlarm::OnInitDialog() { CDialog::OnInitDialog(); // TODO: 在此添加额外的初始化 m_sOldDoSet = m_sEdit_DoSet; UpdateData( true ); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE } void CDlg_AddActionWithAlarm::OnBnClickedBtnChoose1() { CSelectVariantDlg dlg; dlg.m_nShowVarType = 2; if ( dlg.DoModal() == IDOK ) { m_sEdit_DoSet = dlg.m_strVar; UpdateData(false); } } void CDlg_AddActionWithAlarm::OnBnClickedBtnChoose2() { CSelectVariantDlg dlg; dlg.m_nShowVarType = 2; if ( dlg.DoModal() == IDOK ) { m_sEdit_DoStatus = dlg.m_strVar; UpdateData(false); } } void CDlg_AddActionWithAlarm::OnBnClickedBtnPlanTime() { CDlgDatePlan dlg; dlg.m_nPlanType = PLAN_TYPE_KG; dlg.m_sDoSetPlanTime = m_sDoSetPlanTime; if(dlg.DoModal() == IDOK) { m_sDoSetPlanTime = dlg.m_sDoSetPlanTime; } } void CDlg_AddActionWithAlarm::OnBnClickedOk() { if( m_sEdit_DoSet=="" || m_sEdit_DoStatus=="" ) return; if( m_sDoSetPlanTime=="" ) m_sDoSetPlanTime = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"; UpdateData( true ); OnOK(); }