mfc1View.cpp 1.8 KB

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