129 lines
2.7 KiB
C++
129 lines
2.7 KiB
C++
|
|
// ProcessManagerView.cpp: CProcessManagerView 类的实现
|
|
//
|
|
|
|
#include "pch.h"
|
|
#include "framework.h"
|
|
// SHARED_HANDLERS 可以在实现预览、缩略图和搜索筛选器句柄的
|
|
// ATL 项目中进行定义,并允许与该项目共享文档代码。
|
|
#ifndef SHARED_HANDLERS
|
|
#include "ProcessManager.h"
|
|
#endif
|
|
|
|
#include "ProcessManagerDoc.h"
|
|
#include "ProcessManagerView.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
|
|
|
|
// CProcessManagerView
|
|
|
|
IMPLEMENT_DYNCREATE(CProcessManagerView, CView)
|
|
|
|
BEGIN_MESSAGE_MAP(CProcessManagerView, CView)
|
|
// 标准打印命令
|
|
ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
|
|
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
|
|
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CProcessManagerView::OnFilePrintPreview)
|
|
ON_WM_CONTEXTMENU()
|
|
ON_WM_RBUTTONUP()
|
|
END_MESSAGE_MAP()
|
|
|
|
// CProcessManagerView 构造/析构
|
|
|
|
CProcessManagerView::CProcessManagerView() noexcept
|
|
{
|
|
// TODO: 在此处添加构造代码
|
|
|
|
}
|
|
|
|
CProcessManagerView::~CProcessManagerView()
|
|
{
|
|
}
|
|
|
|
BOOL CProcessManagerView::PreCreateWindow(CREATESTRUCT& cs)
|
|
{
|
|
// TODO: 在此处通过修改
|
|
// CREATESTRUCT cs 来修改窗口类或样式
|
|
|
|
return CView::PreCreateWindow(cs);
|
|
}
|
|
|
|
// CProcessManagerView 绘图
|
|
|
|
void CProcessManagerView::OnDraw(CDC* /*pDC*/)
|
|
{
|
|
CProcessManagerDoc* pDoc = GetDocument();
|
|
ASSERT_VALID(pDoc);
|
|
if (!pDoc)
|
|
return;
|
|
|
|
// TODO: 在此处为本机数据添加绘制代码
|
|
}
|
|
|
|
|
|
// CProcessManagerView 打印
|
|
|
|
|
|
void CProcessManagerView::OnFilePrintPreview()
|
|
{
|
|
#ifndef SHARED_HANDLERS
|
|
AFXPrintPreview(this);
|
|
#endif
|
|
}
|
|
|
|
BOOL CProcessManagerView::OnPreparePrinting(CPrintInfo* pInfo)
|
|
{
|
|
// 默认准备
|
|
return DoPreparePrinting(pInfo);
|
|
}
|
|
|
|
void CProcessManagerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
|
{
|
|
// TODO: 添加额外的打印前进行的初始化过程
|
|
}
|
|
|
|
void CProcessManagerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
|
{
|
|
// TODO: 添加打印后进行的清理过程
|
|
}
|
|
|
|
void CProcessManagerView::OnRButtonUp(UINT /* nFlags */, CPoint point)
|
|
{
|
|
ClientToScreen(&point);
|
|
OnContextMenu(this, point);
|
|
}
|
|
|
|
void CProcessManagerView::OnContextMenu(CWnd* /* pWnd */, CPoint point)
|
|
{
|
|
#ifndef SHARED_HANDLERS
|
|
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);
|
|
#endif
|
|
}
|
|
|
|
|
|
// CProcessManagerView 诊断
|
|
|
|
#ifdef _DEBUG
|
|
void CProcessManagerView::AssertValid() const
|
|
{
|
|
CView::AssertValid();
|
|
}
|
|
|
|
void CProcessManagerView::Dump(CDumpContext& dc) const
|
|
{
|
|
CView::Dump(dc);
|
|
}
|
|
|
|
CProcessManagerDoc* CProcessManagerView::GetDocument() const // 非调试版本是内联的
|
|
{
|
|
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CProcessManagerDoc)));
|
|
return (CProcessManagerDoc*)m_pDocument;
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
|
|
// CProcessManagerView 消息处理程序
|