correinfo.cpp

来自「数据结构链表的演示程序」· C++ 代码 · 共 68 行

CPP
68
字号
// CorreInfo.cpp : implementation file
//

#include "stdafx.h"
#include "LandSoft.h"
#include "CorreInfo.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCorreInfo dialog


CCorreInfo::CCorreInfo(CWnd* pParent ,CString strTypeName,UINT maxdist,UINT dist,
					   UINT range,UINT boxlong)
	: CDialog(CCorreInfo::IDD, pParent)
{
	m_nMaxDistant=maxdist;
	m_nBoxlong=boxlong;
	//{{AFX_DATA_INIT(CCorreInfo)
	m_nDistant = dist;
	m_nRange = range;
	m_strType = strTypeName;
	//}}AFX_DATA_INIT
}


void CCorreInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCorreInfo)
	DDX_Text(pDX, IDC_EDIT_DISTANT, m_nDistant);
	DDV_MinMaxUInt(pDX, m_nDistant, 1, 9999);
	DDX_Text(pDX, IDC_EDIT_RANGE, m_nRange);
	DDV_MinMaxUInt(pDX, m_nRange, 1, 9999);
	DDX_Text(pDX, IDC_STATIC_TYPE, m_strType);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCorreInfo, CDialog)
	//{{AFX_MSG_MAP(CCorreInfo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCorreInfo message handlers

void CCorreInfo::OnOK() 
{
	UpdateData(TRUE);
	if(m_nDistant<m_nRange||(m_nDistant-m_nRange)>m_nMaxDistant)
	{
		AfxMessageBox("范围越界,请重新输入!",MB_OK,NULL);
		return;
	}
	else if((m_nDistant+m_nRange)<m_nBoxlong)
	{
		AfxMessageBox("所给的距离范围找不到点对,请重新输入!",MB_OK,NULL);
		return;
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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