?? deleteinfodialog.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 + -