home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / OTEXT / OTEXTVW.CPP < prev    next >
C/C++ Source or Header  |  1994-01-02  |  3KB  |  105 lines

  1. // otextvw.cpp : implementation of the COTextView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "otext.h"
  6.  
  7. #include "otextdoc.h"
  8. #include "otextvw.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // COTextView
  17.  
  18. IMPLEMENT_DYNCREATE(COTextView, CEditView)
  19.  
  20. BEGIN_MESSAGE_MAP(COTextView, CEditView)
  21.     //{{AFX_MSG_MAP(COTextView)
  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.     //}}AFX_MSG_MAP
  25.     // Standard printing commands
  26.     ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
  27.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // COTextView construction/destruction
  32.  
  33. COTextView::COTextView()
  34. {
  35.     // TODO: add construction code here
  36. }
  37.  
  38. COTextView::~COTextView()
  39. {
  40. }
  41.  
  42. BOOL COTextView::PreCreateWindow( CREATESTRUCT& cs )
  43.     {
  44.     BOOL retval = CEditView::PreCreateWindow(cs);
  45.     cs.style &= ~ES_AUTOHSCROLL;   
  46.     cs.style &= ~WS_HSCROLL; 
  47.     return retval;
  48.     }
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // COTextView drawing
  52.  
  53. void COTextView::OnDraw(CDC* pDC)
  54. {
  55.     COTextDoc* pDoc = GetDocument();
  56.     ASSERT_VALID(pDoc);
  57.  
  58.     // TODO: add draw code for native data here
  59. }
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62. // COTextView printing
  63.  
  64. BOOL COTextView::OnPreparePrinting(CPrintInfo* pInfo)
  65. {
  66.     // default CEditView preparation
  67.     return CEditView::OnPreparePrinting(pInfo);
  68. }
  69.  
  70. void COTextView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
  71. {
  72.     // Default CEditView begin printing.
  73.     CEditView::OnBeginPrinting(pDC, pInfo);
  74. }
  75.  
  76. void COTextView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
  77. {
  78.     // Default CEditView end printing
  79.     CEditView::OnEndPrinting(pDC, pInfo);
  80. }
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // COTextView diagnostics
  84.  
  85. #ifdef _DEBUG
  86. void COTextView::AssertValid() const
  87. {
  88.     CEditView::AssertValid();
  89. }
  90.  
  91. void COTextView::Dump(CDumpContext& dc) const
  92. {
  93.     CEditView::Dump(dc);
  94. }
  95.  
  96. COTextDoc* COTextView::GetDocument() // non-debug version is inline
  97. {
  98.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COTextDoc)));
  99.     return (COTextDoc*)m_pDocument;
  100. }
  101. #endif //_DEBUG
  102.  
  103. /////////////////////////////////////////////////////////////////////////////
  104. // COTextView message handlers
  105.