📄 ch3view.cpp
字号:
// ch3View.cpp : implementation of the CCh3View class
//
#include "stdafx.h"
#include "ch3.h"
#include "MyDlg.h"
#include "MyDlg1.h"
#include "ch3Doc.h"
#include "ch3View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCh3View
IMPLEMENT_DYNCREATE(CCh3View, CView)
BEGIN_MESSAGE_MAP(CCh3View, CView)
//{{AFX_MSG_MAP(CCh3View)
ON_COMMAND(ID_MENUC, OnMenuc)
ON_COMMAND(ID_MENUD, OnMenud)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CCh3View construction/destruction
CCh3View::CCh3View()
{
// TODO: add construction code here
}
CCh3View::~CCh3View()
{
}
BOOL CCh3View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCh3View drawing
void CCh3View::OnDraw(CDC* pDC)
{
CCh3Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CFont font;
font.CreateFont(50,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_ROMAN,NULL);
pDC->SelectObject(&font);
pDC->SetTextColor(RGB(rand()%256,rand()%256,rand()%256));
pDC->SetBkColor(RGB(rand()%256,rand()%256,rand()%256));
pDC->TextOut(310,220,"计算机安全密码学");
}
/////////////////////////////////////////////////////////////////////////////
// CCh3View printing
BOOL CCh3View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCh3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCh3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCh3View diagnostics
#ifdef _DEBUG
void CCh3View::AssertValid() const
{
CView::AssertValid();
}
void CCh3View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCh3Doc* CCh3View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCh3Doc)));
return (CCh3Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCh3View message handlers
void CCh3View::OnMenuc()
{
// TODO: Add your command handler code here
CMyDlg dlg;
dlg.DoModal();
}
void CCh3View::OnMenud()
{
// TODO: Add your command handler code here
CMyDlg1 dlg;
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -