⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setdlg.cpp

📁 这是书上的代码
💻 CPP
字号:
// SetDlg.cpp : implementation file
//

#include "stdafx.h"
#include "DOL.h"
#include "SetDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSetDlg dialog


CSetDlg::CSetDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSetDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetDlg)
	m_klevel = 0;
	m_Rule =  _T("");
	m_That = 0.0f;
	m_W =  _T("");
	m_X = 0;
	m_Y = 0;
	m_Stan = 0.0f;
	//}}AFX_DATA_INIT
   
 
}


void CSetDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetDlg)
	DDX_Text(pDX, IDC_klevel_EDIT, m_klevel);
	DDX_Text(pDX, IDC_RULE_EDIT, m_Rule);
	DDV_MaxChars(pDX, m_Rule, 20);
	DDX_Text(pDX, IDC_that_EDIT, m_That);
	DDX_Text(pDX, IDC_W_EDIT, m_W);
	DDV_MaxChars(pDX, m_W, 20);
	DDX_Text(pDX, IDC_X_EDIT, m_X);
	DDX_Text(pDX, IDC_Y_EDIT, m_Y);
	DDX_Text(pDX, IDC_stan_EDIT, m_Stan);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSetDlg, CDialog)
	//{{AFX_MSG_MAP(CSetDlg)
	ON_EN_CHANGE(IDC_RULE_EDIT, OnChangeRuleEdit)
	ON_EN_CHANGE(IDC_W_EDIT, OnChangeWEdit)
	ON_EN_CHANGE(IDC_klevel_EDIT, OnChangeklevelEDIT)
	ON_EN_CHANGE(IDC_stan_EDIT, OnChangestanEDIT)
	ON_EN_CHANGE(IDC_that_EDIT, OnChangethatEDIT)
	ON_EN_CHANGE(IDC_X_EDIT, OnChangeXEdit)
	ON_EN_CHANGE(IDC_Y_EDIT, OnChangeYEdit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSetDlg message handlers

void CSetDlg::OnChangeRuleEdit() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	rule=m_Rule;
	
}

void CSetDlg::OnChangeWEdit() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	w=m_W;
	
}

BOOL CSetDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_Rule=rule;
	m_W=w;
	m_X=turx;
	m_Y=tury;
	m_Stan=stan;
	m_klevel=klevel;
	m_That=that;
	UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSetDlg::OnChangeklevelEDIT() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	klevel=m_klevel;
	
}

void CSetDlg::OnChangestanEDIT() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	stan=m_Stan;
	
}

void CSetDlg::OnChangethatEDIT() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	that=m_That;
	
}

void CSetDlg::OnChangeXEdit() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	turx=float(m_X);
	
}

void CSetDlg::OnChangeYEdit() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	tury=float(m_Y);
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -