📄 mutview.cpp
字号:
// MutView.cpp : implementation of the CMutView class
//
#include "stdafx.h"
#include "Mut.h"
#include "MainFrm.h "
#include "ChildFrm.h "
#include "MutDoc.h"
#include "MutView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMutView
IMPLEMENT_DYNCREATE(CMutView, CView)
BEGIN_MESSAGE_MAP(CMutView, CView)
//{{AFX_MSG_MAP(CMutView)
// 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, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMutView construction/destruction
CMutView::CMutView()
{
// TODO: add construction code here
}
CMutView::~CMutView()
{
}
BOOL CMutView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMutView drawing
void CMutView::OnDraw(CDC* pDC)
{
CMutDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
//输出视图类名,方便观察
pDC->TextOut(20, 20, "CMutView视图类");
}
/////////////////////////////////////////////////////////////////////////////
// CMutView printing
BOOL CMutView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMutView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMutView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMutView diagnostics
#ifdef _DEBUG
void CMutView::AssertValid() const
{
CView::AssertValid();
}
void CMutView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CMutDoc* CMutView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMutDoc)));
return (CMutDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMutView message handlers
void tt()
{
CMainFrame * pMainFrame;
pMainFrame = (CMainFrame *) AfxGetApp()->m_pMainWnd;//先获取主框架窗口指针
CChildFrame * pChildFrame;
pChildFrame = (CChildFrame *) pMainFrame->GetActiveFrame();//再获取子框架窗口指针
CMutView * pView;
pView = (CMutView * ) pMainFrame ->GetActiveView();//最后获取视图窗口指针
CMutDoc * pDoc;
pDoc = (CMutDoc * ) pMainFrame -> GetActiveDocument ();//最后获取文档指针
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -