home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / source / chap04 / lst42 / lst42view.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-21  |  2.9 KB  |  118 lines

  1. // lst42View.cpp : implementation of the CLst42View class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "lst42.h"
  6.  
  7. #include "lst42Doc.h"
  8. #include "lst42View.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CLst42View
  18.  
  19. IMPLEMENT_DYNCREATE(CLst42View, CView)
  20.  
  21. BEGIN_MESSAGE_MAP(CLst42View, CView)
  22.     //{{AFX_MSG_MAP(CLst42View)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     ON_COMMAND(ID_CANCEL_EDIT_SRVR, OnCancelEditSrvr)
  26.     //}}AFX_MSG_MAP
  27.     // Standard printing commands
  28.     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  29.     ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  30.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CLst42View construction/destruction
  35.  
  36. CLst42View::CLst42View()
  37. {
  38.     // TODO: add construction code here
  39.  
  40. }
  41.  
  42. CLst42View::~CLst42View()
  43. {
  44. }
  45.  
  46. BOOL CLst42View::PreCreateWindow(CREATESTRUCT& cs)
  47. {
  48.     // TODO: Modify the Window class or styles here by modifying
  49.     //  the CREATESTRUCT cs
  50.  
  51.     return CView::PreCreateWindow(cs);
  52. }
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CLst42View drawing
  56.  
  57. void CLst42View::OnDraw(CDC* pDC)
  58. {
  59.     CLst42Doc* pDoc = GetDocument();
  60.     ASSERT_VALID(pDoc);
  61.  
  62.     // TODO: add draw code for native data here
  63. }
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CLst42View printing
  67.  
  68. BOOL CLst42View::OnPreparePrinting(CPrintInfo* pInfo)
  69. {
  70.     // default preparation
  71.     return DoPreparePrinting(pInfo);
  72. }
  73.  
  74. void CLst42View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  75. {
  76.     // TODO: add extra initialization before printing
  77. }
  78.  
  79. void CLst42View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  80. {
  81.     // TODO: add cleanup after printing
  82. }
  83.  
  84. /////////////////////////////////////////////////////////////////////////////
  85. // OLE Server support
  86.  
  87. // The following command handler provides the standard keyboard
  88. //  user interface to cancel an in-place editing session.  Here,
  89. //  the server (not the container) causes the deactivation.
  90. void CLst42View::OnCancelEditSrvr()
  91. {
  92.     GetDocument()->OnDeactivateUI(FALSE);
  93. }
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CLst42View diagnostics
  97.  
  98. #ifdef _DEBUG
  99. void CLst42View::AssertValid() const
  100. {
  101.     CView::AssertValid();
  102. }
  103.  
  104. void CLst42View::Dump(CDumpContext& dc) const
  105. {
  106.     CView::Dump(dc);
  107. }
  108.  
  109. CLst42Doc* CLst42View::GetDocument() // non-debug version is inline
  110. {
  111.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CLst42Doc)));
  112.     return (CLst42Doc*)m_pDocument;
  113. }
  114. #endif //_DEBUG
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // CLst42View message handlers
  118.