两校间最短路径查询器Dlg.doc

上传人:re****.1 文档编号:554944000 上传时间:2023-04-16 格式:DOC 页数:8 大小:28.17KB
返回 下载 相关 举报
两校间最短路径查询器Dlg.doc_第1页
第1页 / 共8页
两校间最短路径查询器Dlg.doc_第2页
第2页 / 共8页
两校间最短路径查询器Dlg.doc_第3页
第3页 / 共8页
两校间最短路径查询器Dlg.doc_第4页
第4页 / 共8页
两校间最短路径查询器Dlg.doc_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《两校间最短路径查询器Dlg.doc》由会员分享,可在线阅读,更多相关《两校间最短路径查询器Dlg.doc(8页珍藏版)》请在金锄头文库上搜索。

1、/ 两校间最短路径查询器Dlg.cpp : implementation file/#include stdafx.h#include 两校间最短路径查询器.h#include 两校间最短路径查询器Dlg.h#ifdef _DEBUG#define new DEBUG_NEW#define CHENGYUAN 0#define NONGDA 1#define JIAODA 2#define ZHENGFA 3#define SHIDA 4#define ZHIXING 5#define MAXSIZE 20 #define MAXVALUE 214748364.0#define SWAP(a,

2、 b) temp = a; a = b; b = temp; void floyd(float distMAXSIZE, int pathMAXSIZE, int n);/void display_path(float MAXSIZE, float MAXSIZE, int n);void reverse(int x, int n);/float distMAXSIZEMAXSIZE;int pathMAXSIZEMAXSIZE;int n;char resourMAXSIZE;char distanMAXSIZE;float dist2020=0.0,0.5,MAXVALUE,MAXVALU

3、E,MAXVALUE,MAXVALUE,0.5,0.0,3.3,3.5,3.3,MAXVALUE,MAXVALUE,3.3,0.0,0.4,MAXVALUE,MAXVALUE,MAXVALUE,3.5,0.4,0.0,0.4,0.7,MAXVALUE,3.3,MAXVALUE,0.4,0.0,0.9,MAXVALUE,MAXVALUE,MAXVALUE,0.7,0.9,0.0;#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CAboutDlg dialog used for App Aboutclass CAboutDlg : pu

4、blic CDialogpublic:CAboutDlg();/ Dialog Data/AFX_DATA(CAboutDlg)enum IDD = IDD_ABOUTBOX ;/AFX_DATA/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CAboutDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); / DDX/DDV support/AFX_VIRTUAL/ Implementationprotected:/AFX_MSG(CAbout

5、Dlg)/AFX_MSGDECLARE_MESSAGE_MAP();CAboutDlg:CAboutDlg() : CDialog(CAboutDlg:IDD)/AFX_DATA_INIT(CAboutDlg)/AFX_DATA_INITvoid CAboutDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(CAboutDlg)/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CAboutDlg, CDialog)/AFX_MSG_MAP(CAboutDlg)/ No me

6、ssage handlers/AFX_MSG_MAPEND_MESSAGE_MAP()/ CMyDlg dialogCMyDlg:CMyDlg(CWnd* pParent /*=NULL*/): CDialog(CMyDlg:IDD, pParent)/AFX_DATA_INIT(CMyDlg)m_School = _T();m_School1 = _T();m_School2 = _T();m_Path = _T();/AFX_DATA_INIT/ Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_h

7、Icon = AfxGetApp()-LoadIcon(IDR_MAINFRAME);void CMyDlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(CMyDlg)DDX_Control(pDX, IDC_BUTTON1, m_Button1);DDX_Control(pDX, IDC_BUTTON2, m_Button2);DDX_Text(pDX, IDC_EDIT_SCHOOL, m_School);DDX_Text(pDX, IDC_EDIT_SCHOOL1, m_Schoo

8、l1);DDX_Text(pDX, IDC_EDIT_SCHOOL2, m_School2);DDX_Text(pDX, IDC_EDIT_PATH, m_Path);/AFX_DATA_MAPBEGIN_MESSAGE_MAP(CMyDlg, CDialog)/AFX_MSG_MAP(CMyDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_BUTTON1, OnButton1)ON_BN_CLICKED(IDC_BUTTON2, OnButton2)/AFX_MSG_MAPEND_MESSAGE

9、_MAP()/ CMyDlg message handlersBOOL CMyDlg:OnInitDialog()CDialog:OnInitDialog();/ Add About. menu item to system menu./ IDM_ABOUTBOX must be in the system command range.ASSERT(IDM_ABOUTBOX & 0xFFF0) = IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX AppendMenu(MF_SEPARATOR);pSysMenu-AppendMenu(MF_STRING, IDM_ABOUT

10、BOX, strAboutMenu);/ Set the icon for this dialog. The framework does this automatically/ when the applications main window is not a dialogSetIcon(m_hIcon, TRUE);/ Set big iconSetIcon(m_hIcon, FALSE);/ Set small icon/ TODO: Add extra initialization herereturn TRUE; / return TRUE unless you set the f

11、ocus to a controlvoid CMyDlg:OnSysCommand(UINT nID, LPARAM lParam)if (nID & 0xFFF0) = IDM_ABOUTBOX)CAboutDlg dlgAbout;dlgAbout.DoModal();elseCDialog:OnSysCommand(nID, lParam);/ If you add a minimize button to your dialog, you will need the code below/ to draw the icon. For MFC applications using the

12、 document/view model,/ this is automatically done for you by the framework.void CMyDlg:OnPaint() if (IsIconic()CPaintDC dc(this); / device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);/ Center icon in client rectangleint cxIcon = GetSystemMetrics(SM_CXICON);int cyIcon = GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(&rect);int x = (rect.Width() - cxIcon + 1) / 2;int y = (rect.Height() - cyIcon + 1) / 2;/ Draw the icondc.DrawIcon(x, y, m_hIcon);elseCDialog:OnPaint();

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号