mfc1View.cpp 1.7 KB

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