| 1 |
// mfc1View.cpp : implementation of the Cmfc1View class |
| 2 |
// |
| 3 |
|
| 4 |
// clang-format off |
| 5 |
#include "stdafx.h" |
| 6 |
|
| 7 |
#include "mfc1.h" |
| 8 |
|
| 9 |
#include "mfc1Doc.h" |
| 10 |
#include "mfc1View.h" |
| 11 |
// clang-format on |
| 12 |
|
| 13 |
#ifdef _DEBUG |
| 14 |
# define new DEBUG_NEW |
| 15 |
#endif |
| 16 |
|
| 17 |
// Cmfc1View |
| 18 |
|
| 19 |
IMPLEMENT_DYNCREATE(Cmfc1View, CView) |
| 20 |
|
| 21 |
BEGIN_MESSAGE_MAP(Cmfc1View, CView) |
| 22 |
// Standard printing commands |
| 23 |
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) |
| 24 |
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) |
| 25 |
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) |
| 26 |
END_MESSAGE_MAP() |
| 27 |
|
| 28 |
// Cmfc1View construction/destruction |
| 29 |
|
| 30 |
Cmfc1View::Cmfc1View() |
| 31 |
{ |
| 32 |
// TODO: add construction code here |
| 33 |
} |
| 34 |
|
| 35 |
Cmfc1View::~Cmfc1View() |
| 36 |
{ |
| 37 |
} |
| 38 |
|
| 39 |
BOOL Cmfc1View::PreCreateWindow(CREATESTRUCT& cs) |
| 40 |
{ |
| 41 |
// TODO: Modify the Window class or styles here by modifying |
| 42 |
// the CREATESTRUCT cs |
| 43 |
|
| 44 |
return CView::PreCreateWindow(cs); |
| 45 |
} |
| 46 |
|
| 47 |
// Cmfc1View drawing |
| 48 |
|
| 49 |
void Cmfc1View::OnDraw(CDC* /*pDC*/) |
| 50 |
{ |
| 51 |
Cmfc1Doc* pDoc = GetDocument(); |
| 52 |
ASSERT_VALID(pDoc); |
| 53 |
if (!pDoc) |
| 54 |
return; |
| 55 |
|
| 56 |
// TODO: add draw code for native data here |
| 57 |
} |
| 58 |
|
| 59 |
// Cmfc1View printing |
| 60 |
|
| 61 |
BOOL Cmfc1View::OnPreparePrinting(CPrintInfo* pInfo) |
| 62 |
{ |
| 63 |
// default preparation |
| 64 |
return DoPreparePrinting(pInfo); |
| 65 |
} |
| 66 |
|
| 67 |
void Cmfc1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) |
| 68 |
{ |
| 69 |
// TODO: add extra initialization before printing |
| 70 |
} |
| 71 |
|
| 72 |
void Cmfc1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) |
| 73 |
{ |
| 74 |
// TODO: add cleanup after printing |
| 75 |
} |
| 76 |
|
| 77 |
// Cmfc1View diagnostics |
| 78 |
|
| 79 |
#ifdef _DEBUG |
| 80 |
void Cmfc1View::AssertValid() const |
| 81 |
{ |
| 82 |
CView::AssertValid(); |
| 83 |
} |
| 84 |
|
| 85 |
void Cmfc1View::Dump(CDumpContext& dc) const |
| 86 |
{ |
| 87 |
CView::Dump(dc); |
| 88 |
} |
| 89 |
|
| 90 |
Cmfc1Doc* Cmfc1View::GetDocument() const // non-debug version is inline |
| 91 |
{ |
| 92 |
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cmfc1Doc))); |
| 93 |
return (Cmfc1Doc*)m_pDocument; |
| 94 |
} |
| 95 |
#endif //_DEBUG |
| 96 |
|
| 97 |
// Cmfc1View message handlers |