home *** CD-ROM | disk | FTP | other *** search
/ Mastering Microsoft Visual C++ 4 (2nd Edition) / VisualC4.ISO / miniedt1 / miniedvw.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-30  |  2.1 KB  |  86 lines

  1. // MiniEdVw.cpp : implementation of the CMiniEditView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MiniEdit.h"
  6.  
  7. #include "MiniEDoc.h"
  8. #include "MiniEdVw.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. // CMiniEditView
  18.  
  19. IMPLEMENT_DYNCREATE(CMiniEditView, CEditView)
  20.  
  21. BEGIN_MESSAGE_MAP(CMiniEditView, CEditView)
  22.    //{{AFX_MSG_MAP(CMiniEditView)
  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.    //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CMiniEditView construction/destruction
  30.  
  31. CMiniEditView::CMiniEditView()
  32. {
  33.    // TODO: add construction code here
  34.  
  35. }
  36.  
  37. CMiniEditView::~CMiniEditView()
  38. {
  39. }
  40.  
  41. BOOL CMiniEditView::PreCreateWindow(CREATESTRUCT& cs)
  42. {
  43.    // TODO: Modify the Window class or styles here by modifying
  44.    //  the CREATESTRUCT cs
  45.  
  46.    BOOL bPreCreated = CEditView::PreCreateWindow(cs);
  47.    cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
  48.  
  49.    return bPreCreated;
  50. }
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CMiniEditView drawing
  54.  
  55. void CMiniEditView::OnDraw(CDC* pDC)
  56. {
  57.    CMiniEditDoc* pDoc = GetDocument();
  58.    ASSERT_VALID(pDoc);
  59.  
  60.    // TODO: add draw code for native data here
  61. }
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CMiniEditView diagnostics
  65.  
  66. #ifdef _DEBUG
  67. void CMiniEditView::AssertValid() const
  68. {
  69.    CEditView::AssertValid();
  70. }
  71.  
  72. void CMiniEditView::Dump(CDumpContext& dc) const
  73. {
  74.    CEditView::Dump(dc);
  75. }
  76.  
  77. CMiniEditDoc* CMiniEditView::GetDocument() // non-debug version is inline
  78. {
  79.    ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMiniEditDoc)));
  80.    return (CMiniEditDoc*)m_pDocument;
  81. }
  82. #endif //_DEBUG
  83.  
  84. /////////////////////////////////////////////////////////////////////////////
  85. // CMiniEditView message handlers
  86.