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