⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displayview.cpp

📁 BFS、DFS、有向图、无向图中的各种算法的实现
💻 CPP
字号:
// displayView.cpp : implementation of the CDisplayView class
//

#include "stdafx.h"
#include "graph.h"

#include "graphDoc.h"
#include "displayView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDisplayView

IMPLEMENT_DYNCREATE(CDisplayView, CView)

BEGIN_MESSAGE_MAP(CDisplayView, CView)
	//{{AFX_MSG_MAP(CDisplayView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDisplayView construction/destruction

CDisplayView::CDisplayView()
{
	// TODO: add construction code here

}

CDisplayView::~CDisplayView()
{
}

BOOL CDisplayView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CDisplayView drawing

void CDisplayView::OnDraw(CDC* pDC)
{
	CGraphDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	pDC->TextOut(250,0,"DISPLAY SCREEN");
	pDoc->m_graph.DisplayGraph(pDC);
	CString str;
	str.Format("                                 the vertex number:%d                            the arc number:%d"
		,pDoc->m_queue.m_nnum,pDoc->m_graph.m_narc/2);
	pDC->TextOut(0,30,str);
}

/////////////////////////////////////////////////////////////////////////////
// CDisplayView printing

BOOL CDisplayView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CDisplayView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CDisplayView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CDisplayView diagnostics

#ifdef _DEBUG
void CDisplayView::AssertValid() const
{
	CView::AssertValid();
}

void CDisplayView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CGraphDoc* CDisplayView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGraphDoc)));
	return (CGraphDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDisplayView message handlers

void CDisplayView::OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint)
{
	Invalidate();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -