cmake/Tests/MFC/mfc1/mfc1View.cpp

98 lines
1.8 KiB
C++
Raw Normal View History

2012-02-18 12:40:36 +02:00
// mfc1View.cpp : implementation of the Cmfc1View class
//
2020-02-01 23:06:01 +01:00
// clang-format off
2012-02-18 12:40:36 +02:00
#include "stdafx.h"
2016-07-09 11:21:54 +02:00
2012-02-18 12:40:36 +02:00
#include "mfc1.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
2020-02-01 23:06:01 +01:00
// clang-format on
2012-02-18 12:40:36 +02:00
#ifdef _DEBUG
2018-08-09 18:06:22 +02:00
# define new DEBUG_NEW
2012-02-18 12:40:36 +02:00
#endif
// Cmfc1View
IMPLEMENT_DYNCREATE(Cmfc1View, CView)
BEGIN_MESSAGE_MAP(Cmfc1View, CView)
2016-07-09 11:21:54 +02:00
// 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)
2012-02-18 12:40:36 +02:00
END_MESSAGE_MAP()
// Cmfc1View construction/destruction
Cmfc1View::Cmfc1View()
{
2016-07-09 11:21:54 +02:00
// TODO: add construction code here
2012-02-18 12:40:36 +02:00
}
Cmfc1View::~Cmfc1View()
{
}
BOOL Cmfc1View::PreCreateWindow(CREATESTRUCT& cs)
{
2016-07-09 11:21:54 +02:00
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
2012-02-18 12:40:36 +02:00
2016-07-09 11:21:54 +02:00
return CView::PreCreateWindow(cs);
2012-02-18 12:40:36 +02:00
}
// Cmfc1View drawing
void Cmfc1View::OnDraw(CDC* /*pDC*/)
{
2016-07-09 11:21:54 +02:00
Cmfc1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
2012-02-18 12:40:36 +02:00
2016-07-09 11:21:54 +02:00
// TODO: add draw code for native data here
2012-02-18 12:40:36 +02:00
}
// Cmfc1View printing
BOOL Cmfc1View::OnPreparePrinting(CPrintInfo* pInfo)
{
2016-07-09 11:21:54 +02:00
// default preparation
return DoPreparePrinting(pInfo);
2012-02-18 12:40:36 +02:00
}
void Cmfc1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
2016-07-09 11:21:54 +02:00
// TODO: add extra initialization before printing
2012-02-18 12:40:36 +02:00
}
void Cmfc1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
2016-07-09 11:21:54 +02:00
// TODO: add cleanup after printing
2012-02-18 12:40:36 +02:00
}
// Cmfc1View diagnostics
#ifdef _DEBUG
void Cmfc1View::AssertValid() const
{
2016-07-09 11:21:54 +02:00
CView::AssertValid();
2012-02-18 12:40:36 +02:00
}
void Cmfc1View::Dump(CDumpContext& dc) const
{
2016-07-09 11:21:54 +02:00
CView::Dump(dc);
2012-02-18 12:40:36 +02:00
}
Cmfc1Doc* Cmfc1View::GetDocument() const // non-debug version is inline
{
2016-07-09 11:21:54 +02:00
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cmfc1Doc)));
return (Cmfc1Doc*)m_pDocument;
2012-02-18 12:40:36 +02:00
}
#endif //_DEBUG
// Cmfc1View message handlers