-
Notifications
You must be signed in to change notification settings - Fork 0
/
RandomDlg.cpp
84 lines (67 loc) · 1.63 KB
/
RandomDlg.cpp
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
81
82
83
84
// RandomDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AGM.h"
#include "RandomDlg.h"
// CRandomDlg dialog
IMPLEMENT_DYNAMIC(CRandomDlg, CDialog)
CRandomDlg::CRandomDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRandomDlg::IDD, pParent)
{
SetDefaults();
}
CRandomDlg::~CRandomDlg()
{
}
void CRandomDlg::DoDataExchange(CDataExchange* pDX)
{
DDX_Text(pDX,IDC_RA1,ra_p1);
DDX_Text(pDX,IDC_RA2,ra_p2);
DDX_Text(pDX,IDC_RA3,ra_p3);
DDX_Text(pDX,IDC_RA4,ra_p4);
DDX_Text(pDX,IDC_RA5,ra_p5);
DDX_Check(pDX,IDC_CKB19,ra_b19);
DDX_Check(pDX,IDC_CKB42,ra_b42);
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CRandomDlg, CDialog)
ON_BN_CLICKED(IDC_DEFS, OnBnClickedDefs)
ON_BN_CLICKED(IDC_CKB19, OnBnClickedCkb19)
ON_BN_CLICKED(IDC_CKB42, OnBnClickedCkb42)
END_MESSAGE_MAP()
// CRandomDlg message handlers
void CRandomDlg::OnBnClickedDefs()
{
SetDefaults();
UpdateData(FALSE);
}
void CRandomDlg::SetDefaults()
{
ra_p1 = 5625;
ra_p2 = 4250;
ra_p3 = 1875;
ra_p4 = 0.25;
ra_p5 = 0.1;
ra_b19 = false;
ra_b42 = false;
}
BOOL CRandomDlg::OnInitDialog()
{
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CRandomDlg::OnBnClickedCkb19()
{
CButton *cb19 = (CButton *)GetDlgItem(IDC_CKB19);
CButton *cb42 = (CButton *)GetDlgItem(IDC_CKB42);
if (cb19->GetCheck() == BST_CHECKED)
cb42->SetCheck(BST_UNCHECKED);
}
void CRandomDlg::OnBnClickedCkb42()
{
CButton *cb19 = (CButton *)GetDlgItem(IDC_CKB19);
CButton *cb42 = (CButton *)GetDlgItem(IDC_CKB42);
if (cb42->GetCheck() == BST_CHECKED)
cb19->SetCheck(BST_UNCHECKED);
}