notepadeview.cpp
来自「程序用MFC实现了在窗口条件下实现文本的输入」· C++ 代码 · 共 110 行
CPP
110 行
// notepadeView.cpp : implementation of the CNotepadeView class
//
#include "stdafx.h"
#include "notepade.h"
#include "notepadeDoc.h"
#include "notepadeView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView
IMPLEMENT_DYNCREATE(CNotepadeView, CEditView)
BEGIN_MESSAGE_MAP(CNotepadeView, CEditView)
//{{AFX_MSG_MAP(CNotepadeView)
// 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, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView construction/destruction
CNotepadeView::CNotepadeView()
{
// TODO: add construction code here
}
CNotepadeView::~CNotepadeView()
{
}
BOOL CNotepadeView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
BOOL bPreCreated = CEditView::PreCreateWindow(cs);
cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
return bPreCreated;
}
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView drawing
void CNotepadeView::OnDraw(CDC* pDC)
{
CNotepadeDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView printing
BOOL CNotepadeView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CNotepadeView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CNotepadeView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView diagnostics
#ifdef _DEBUG
void CNotepadeView::AssertValid() const
{
CEditView::AssertValid();
}
void CNotepadeView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CNotepadeDoc* CNotepadeView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CNotepadeDoc)));
return (CNotepadeDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNotepadeView message handlers
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?