QuakeGod
2021-12-29 0a20f73829d9d53e060927f23c2777f10347ac65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// DialogSetCoil.cpp: 实现文件
//
 
#include "pch.h"
#include "MTerm2.h"
#include "DialogSetCoil.h"
#include "afxdialogex.h"
 
 
// CDialogSetCoil 对话框
 
IMPLEMENT_DYNAMIC(CDialogSetCoil, CDialogEx)
 
CDialogSetCoil::CDialogSetCoil(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_SET_COIL, pParent)
{
 
}
 
CDialogSetCoil::~CDialogSetCoil()
{
}
 
void CDialogSetCoil::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
 
 
BEGIN_MESSAGE_MAP(CDialogSetCoil, CDialogEx)
END_MESSAGE_MAP()
 
 
// CDialogSetCoil 消息处理程序
 
 
BOOL CDialogSetCoil::OnInitDialog()
{
    CDialogEx::OnInitDialog();
 
    // TODO:  在此添加额外的初始化
    ShowParams();
    return TRUE;  // return TRUE unless you set the focus to a control
                  // 异常: OCX 属性页应返回 FALSE
}
 
 
int CDialogSetCoil::ShowParams()
{
    // TODO: 在此处添加实现代码.
    CString s1;
    s1 = _T("触点写入 ") + m_strAddr;
    SetDlgItemText(IDC_STATIC_INFO, s1);
    if (m_nStat)    {
        ((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->SetCheck(0);
        ((CButton *)GetDlgItem(IDC_RADIO_SET_OFF))->SetCheck(1);
    }
    else {
        ((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->SetCheck(1);
        ((CButton *)GetDlgItem(IDC_RADIO_SET_OFF))->SetCheck(0);
    }
 
    return 0;
}
 
 
int CDialogSetCoil::GetParams()
{
    // TODO: 在此处添加实现代码.
    int j= ((CButton *)GetDlgItem(IDC_RADIO_SET_ON))->GetCheck();
    m_nStat = j;
    return 0;
}
 
void CDialogSetCoil::OnOK()
{
    // TODO: 在此添加专用代码和/或调用基类
    GetParams();
    CDialogEx::OnOK();
}