📄 resultdialog.cpp
字号:
// ResultDialog.cpp : implementation file
//
#include "stdafx.h"
#include "map.h"
#include "ResultDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResultDialog dialog
CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/)
: CDialog(CResultDialog::IDD, pParent)
{
m_result=_T("");
m_tip=_T("");
char tpl=13;
char tpr=10;
m_enter.Format("%c%c",tpl,tpr);
//{{AFX_DATA_INIT(CResultDialog)
m_result = _T("");
m_topic = _T("");
//}}AFX_DATA_INIT
}
void CResultDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CResultDialog)
DDX_Text(pDX, IDC_RESULT, m_result);
DDX_Text(pDX, IDC_TOPIC, m_topic);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CResultDialog, CDialog)
//{{AFX_MSG_MAP(CResultDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResultDialog message handlers
void CResultDialog::SetText(CString & temp)
{
int num;
num=temp.GetLength();
if(num==0)
{
m_result=_T("");
return;
}
else m_result=temp;
m_result.Delete(0,2);
m_result.Replace("##",m_enter);
}
void CResultDialog::SetTopic(int kind)
//2代表汽车费用
//3代表汽车耗时
//4代表汽车到达时刻
//5代表飞机费用
//6代表飞机耗时
//7代表飞机到达时刻
//8代表火车费用
//9代表火车耗时
//10代表火车到达时刻
{
switch(kind)
{
case 1:
{
m_topic="按距离算";
break;
}
case 2:
{
m_topic="按汽车费用算";
break;
}
case 3:
{
m_topic="按汽车耗时算";
break;
}
case 4:
{
m_topic="按汽车旅程时间算";
break;
}
case 5:
{
m_topic="按飞机费用算";
break;
}
case 6:
{
m_topic="按飞机耗时算";
break;
}
case 7:
{
m_topic="按飞机旅程时间算";
break;
}
case 8:
{
m_topic="按火车费用算";
break;
}
case 9:
{
m_topic="按火车耗时算";
break;
}
case 10:
{
m_topic="按火车旅程算";
break;
}
default:
break;
}
m_topic=m_topic+"走如下城市最优!";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -