processmanagerview.cpp

来自「这是软件工程的关于模拟进程调度的课程论文」· C++ 代码 · 共 120 行

CPP
120
字号
// ProcessManagerView.cpp : implementation of the CProcessManagerView class
//

#include "stdafx.h"
#include "ProcessManager.h"

#include "ProcessManagerDoc.h"
#include "ProcessManagerView.h"

#include "MainFrm.h"
#include "PCB.h"

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

/////////////////////////////////////////////////////////////////////////////
// CProcessManagerView

IMPLEMENT_DYNCREATE(CProcessManagerView, CView)

BEGIN_MESSAGE_MAP(CProcessManagerView, CView)
	//{{AFX_MSG_MAP(CProcessManagerView)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
	// Standard printing commands
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProcessManagerView construction/destruction

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

}

CProcessManagerView::~CProcessManagerView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CProcessManagerView drawing

void CProcessManagerView::OnDraw(CDC* pDC)
{
	CProcessManagerDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here

	//CRect rect;
	//this->GetClientRect(&rect);

	//rect.left += 5;
	//rect.top += 5;
	//rect.bottom -= 5;
	//rect.right -= 5;
	
	//pDC->DrawText(((CMainFrame*)::AfxGetMainWnd())->strTotalProc, &rect,DT_LEFT|DT_END_ELLIPSIS);
}


/////////////////////////////////////////////////////////////////////////////
// CProcessManagerView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CProcessManagerView message handlers


void CProcessManagerView::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	
	CView::OnTimer(nIDEvent);
}



void CProcessManagerView::PrintAllProc(CDC* pDC)
{
	CClientDC cdc(this);
	CRect rect;
	this->GetClientRect(&rect);

	rect.left += 5;
	rect.top += 5;
	rect.bottom -= 5;
	rect.right -= 5;
	
	cdc.DrawText(((CMainFrame*)::AfxGetMainWnd())->strTotalProc, &rect,DT_LEFT|DT_END_ELLIPSIS);
}

⌨️ 快捷键说明

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