summaryrefslogtreecommitdiffstats
path: root/Tests/MFC/mfc1/mfc1View.cpp
blob: 6169ce52477452cffa305e7d8f9faccd396c43a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// mfc1View.cpp : implementation of the Cmfc1View class
//

#include "stdafx.h"

#include "mfc1.h"

#include "mfc1Doc.h"
#include "mfc1View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// Cmfc1View

IMPLEMENT_DYNCREATE(Cmfc1View, CView)

BEGIN_MESSAGE_MAP(Cmfc1View, CView)
// 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()

// Cmfc1View construction/destruction

Cmfc1View::Cmfc1View()
{
  // TODO: add construction code here
}

Cmfc1View::~Cmfc1View()
{
}

BOOL Cmfc1View::PreCreateWindow(CREATESTRUCT& cs)
{
  // TODO: Modify the Window class or styles here by modifying
  //  the CREATESTRUCT cs

  return CView::PreCreateWindow(cs);
}

// Cmfc1View drawing

void Cmfc1View::OnDraw(CDC* /*pDC*/)
{
  Cmfc1Doc* pDoc = GetDocument();
  ASSERT_VALID(pDoc);
  if (!pDoc)
    return;

  // TODO: add draw code for native data here
}

// Cmfc1View printing

BOOL Cmfc1View::OnPreparePrinting(CPrintInfo* pInfo)
{
  // default preparation
  return DoPreparePrinting(pInfo);
}

void Cmfc1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
  // TODO: add extra initialization before printing
}

void Cmfc1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
  // TODO: add cleanup after printing
}

// Cmfc1View diagnostics

#ifdef _DEBUG
void Cmfc1View::AssertValid() const
{
  CView::AssertValid();
}

void Cmfc1View::Dump(CDumpContext& dc) const
{
  CView::Dump(dc);
}

Cmfc1Doc* Cmfc1View::GetDocument() const // non-debug version is inline
{
  ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(Cmfc1Doc)));
  return (Cmfc1Doc*)m_pDocument;
}
#endif //_DEBUG

// Cmfc1View message handlers