📄 pathview.cpp
字号:
// pathView.cpp : implementation of the CPathView class
//
#include "stdafx.h"
#include "path.h"
#include "pathDoc.h"
#include "pathView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPathView
IMPLEMENT_DYNCREATE(CPathView, CFormView)
BEGIN_MESSAGE_MAP(CPathView, CFormView)
//{{AFX_MSG_MAP(CPathView)
ON_WM_PAINT()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPathView construction/destruction
CPathView::CPathView()
: CFormView(CPathView::IDD)
{
//{{AFX_DATA_INIT(CPathView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CPathView::~CPathView()
{
}
void CPathView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPathView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CPathView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow(cs);
}
void CPathView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CPathView printing
BOOL CPathView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPathView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPathView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void CPathView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
// TODO: add customized printing code here
}
/////////////////////////////////////////////////////////////////////////////
// CPathView diagnostics
#ifdef _DEBUG
void CPathView::AssertValid() const
{
CFormView::AssertValid();
}
void CPathView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CPathDoc* CPathView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPathDoc)));
return (CPathDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPathView message handlers
void CPathView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CFormView::OnPaint() for painting messages
//dc.TextOut(100,100,"ok");
ceshi.m_N=4;
ceshi.initPred();
double dis[4*4]={0,2,999999999,6,
99999999,0,-2,999999999,
9999999,5,0,5,
-4,-1,999999999,0};
ceshi.initDis(dis);
ceshi.floyd();
ceshi.out(&dc,1,3);
}
void CPathView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -