📄 31view.cpp
字号:
// 31View.cpp : implementation of the CMy31View class
//
#include "stdafx.h"
#include "31.h"
#include "31Doc.h"
#include "31View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMy31View
IMPLEMENT_DYNCREATE(CMy31View, CScrollView)
BEGIN_MESSAGE_MAP(CMy31View, CScrollView)
//{{AFX_MSG_MAP(CMy31View)
// 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, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMy31View construction/destruction
CMy31View::CMy31View()
{
// TODO: add construction code here
}
CMy31View::~CMy31View()
{
}
BOOL CMy31View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMy31View drawing
void CMy31View::OnDraw(CDC* pDC)
{
CMy31Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CMy31View::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
// CSize sizeTotal;
// TODO: calculate the total size of this view
// sizeTotal.cx = sizeTotal.cy = 100;
// SetScrollSizes(MM_TEXT, sizeTotal);
CSize sizeTotal(20000,30000);
CSize sizePage(sizeTotal.cx/2,sizeTotal.cy/2);
CSize sizeLine(sizeTotal.cx/50,sizeTotal.cy/50);
SetScrollSizes(MM_HIMETRIC,sizeTotal,sizePage,sizeLine);
}
/////////////////////////////////////////////////////////////////////////////
// CMy31View printing
BOOL CMy31View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMy31View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMy31View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMy31View diagnostics
#ifdef _DEBUG
void CMy31View::AssertValid() const
{
CScrollView::AssertValid();
}
void CMy31View::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
CMy31Doc* CMy31View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMy31Doc)));
return (CMy31Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMy31View message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -