home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / WTEK0593.ZIP;1 / EDIT-CPP.ZIP / EDITOVW.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-07  |  3.1 KB  |  128 lines

  1. // editovw.cpp : implementation of the CEditorView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "editor.h"
  6.  
  7. #include "editodoc.h"
  8. #include "editovw.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CEditorView
  17.  
  18. IMPLEMENT_DYNCREATE(CEditorView, CView)
  19.  
  20. BEGIN_MESSAGE_MAP(CEditorView, CView)
  21.     //{{AFX_MSG_MAP(CEditorView)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code !
  24.     ON_COMMAND(ID_OLE_INSERT_NEW, OnInsertObject)
  25.     //}}AFX_MSG_MAP
  26.     // Standard printing commands
  27.     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  28.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CEditorView construction/destruction
  33.  
  34. CEditorView::CEditorView()
  35. {
  36.     // TODO: add construction code here
  37. }
  38.  
  39. CEditorView::~CEditorView()
  40. {
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CEditorView drawing
  45.  
  46. void CEditorView::OnDraw(CDC* pDC)
  47. {
  48.     CEditorDoc* pDoc = GetDocument();
  49.  
  50.     // TODO: add draw code here
  51. }
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CEditorView printing
  55.  
  56. BOOL CEditorView::OnPreparePrinting(CPrintInfo* pInfo)
  57. {
  58.     // default preparation
  59.     return DoPreparePrinting(pInfo);
  60. }
  61.  
  62. void CEditorView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  63. {
  64.     // TODO: add extra initialization before printing
  65. }
  66.  
  67. void CEditorView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  68. {
  69.     // TODO: add cleanup after printing
  70. }
  71.  
  72.  
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // OLE Client support and commands
  76.  
  77. BOOL CEditorView::IsSelected(const CObject* pDocItem) const
  78. {
  79.     // TODO: implement this function that tests for a selected OLE client item
  80.     return FALSE;
  81. }
  82.  
  83.  
  84. void CEditorView::OnInsertObject()
  85. {
  86.     CString strTypeName;
  87.  
  88.     if (!AfxOleInsertDialog(strTypeName))
  89.         return;        // no OLE class selected
  90.  
  91.     TRACE("Trying to Insert OLE item with type '%s'\n",
  92.             (const char*)strTypeName);
  93.  
  94.     // TODO: create an embedded OLE object with that class name
  95.     char szT[300];
  96.     wsprintf(szT, "TODO: this function is not completely implemented.\n"
  97.         "You must add code to create a COleClientItem\n"
  98.         " with a type name of '%s'.\n"
  99.         "See CEditorView::OnInsertObject in"
  100.             " EDITOVW.CPP for more info.", (LPCSTR)strTypeName);
  101.     AfxMessageBox(szT);
  102. }
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CEditorView diagnostics
  106.  
  107. #ifdef _DEBUG
  108. void CEditorView::AssertValid() const
  109. {
  110.     CView::AssertValid();
  111. }
  112.  
  113. void CEditorView::Dump(CDumpContext& dc) const
  114. {
  115.     CView::Dump(dc);
  116. }
  117.  
  118. CEditorDoc* CEditorView::GetDocument() // non-debug version is inline
  119. {
  120.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEditorDoc)));
  121.     return (CEditorDoc*) m_pDocument;
  122. }
  123.  
  124. #endif //_DEBUG
  125.  
  126. /////////////////////////////////////////////////////////////////////////////
  127. // CEditorView message handlers
  128.