-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCPolarFuncDlg.cpp
71 lines (56 loc) · 1.48 KB
/
CPolarFuncDlg.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
// CPolarFuncDlg.cpp: 实现文件
//
#include "pch.h"
#include "mfcplot.h"
#include "CPolarFuncDlg.h"
#include "afxdialogex.h"
#include "CFuncDlg.h"
// CPolarFuncDlg 对话框
IMPLEMENT_DYNAMIC(CPolarFuncDlg, CDialogEx)
CPolarFuncDlg::CPolarFuncDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG_POLARFUNC, pParent)
, m_sEquation(_T(""))
, m_Thetamin(-3.14)
, m_Thetamax(3.14)
, m_StepTheta(1000)
, m_penWidth(1)
, m_penType(0)
{
m_color = RGB(0, 0, 0);
}
CPolarFuncDlg::~CPolarFuncDlg()
{
}
void CPolarFuncDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_FUNC, m_sEquation);
DDX_Text(pDX, IDC_EDIT2, m_Thetamin);
DDX_Text(pDX, IDC_EDIT3, m_Thetamax);
DDX_Text(pDX, IDC_EDIT4, m_StepTheta);
DDX_Text(pDX, IDC_EDIT1, m_penWidth);
DDX_CBIndex(pDX, IDC_COMBO_LINETYPE, m_penType);
}
BEGIN_MESSAGE_MAP(CPolarFuncDlg, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON_COLOR, &CPolarFuncDlg::OnBnClickedButtonColor)
ON_BN_CLICKED(IDC_BUTTON_SETFUNC, &CPolarFuncDlg::OnBnClickedButtonSetfunc)
END_MESSAGE_MAP()
// CPolarFuncDlg 消息处理程序
void CPolarFuncDlg::OnBnClickedButtonColor()
{
// TODO: 在此添加控件通知处理程序代码
CColorDialog dlg;
if (dlg.DoModal() == IDOK) {
m_color = dlg.GetColor();
}
}
void CPolarFuncDlg::OnBnClickedButtonSetfunc()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData();
CFuncDlg dlg(1);
if (dlg.DoModal()) {
m_sEquation = dlg.m_strEquation;
}
UpdateData(false);
}