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

📄 deleteinfodialog.cpp

📁 全国交通咨询系统源代码
💻 CPP
字号:
// DeleteinfoDialog.cpp : implementation file
//

#include "stdafx.h"
#include "map.h"
#include "DeleteinfoDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDeleteinfoDialog dialog


CDeleteinfoDialog::CDeleteinfoDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CDeleteinfoDialog::IDD, pParent)
{
	m_graph=NULL;
	//{{AFX_DATA_INIT(CDeleteinfoDialog)
	m_cityfirst = _T("");
	m_citysecond = _T("");
	//}}AFX_DATA_INIT
}


void CDeleteinfoDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDeleteinfoDialog)
	DDX_Text(pDX, IDC_CITYFIRST, m_cityfirst);
	DDV_MaxChars(pDX, m_cityfirst, 15);
	DDX_Text(pDX, IDC_CITYSECOND, m_citysecond);
	DDV_MaxChars(pDX, m_citysecond, 15);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDeleteinfoDialog, CDialog)
	//{{AFX_MSG_MAP(CDeleteinfoDialog)
	ON_BN_CLICKED(IDC_YES, OnYes)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDeleteinfoDialog message handlers

void CDeleteinfoDialog::OnOK() 
{
	// TODO: Add extra validation here
	NextDlgCtrl();
}

void CDeleteinfoDialog::OnYes() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	if(!m_graph->CityLocal(m_cityfirst)||!m_graph->CityLocal(m_citysecond)) 
	{
		AfxMessageBox("输入的城市名有误!");
		m_cityfirst=_T("");
		UpdateData(false);
		return;
	}
	if(!m_graph->DeleteCity(m_cityfirst,m_citysecond))
	{
		AfxMessageBox("没有这两个城市间的关系");
		m_cityfirst=m_citysecond=_T("");
		UpdateData(false);
		return;
	}
	AfxMessageBox(m_cityfirst+"和"+m_citysecond+"的关系已经删除");
	EndDialog(IDC_YES);
}

void CDeleteinfoDialog::SetGraph(ALGraph * temp)
{
	m_graph=temp;
}

⌨️ 快捷键说明

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