home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / DYNASPLI.ZIP / DSplitView.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-03  |  2.6 KB  |  114 lines

  1. // DSplitView.cpp : implementation of the CDSplitView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "DSplit.h"
  6.  
  7. #include "DSplitDoc.h"
  8. #include "DSplitView.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. // CDSplitView
  18.  
  19. IMPLEMENT_DYNCREATE(CDSplitView, CView)
  20.  
  21. BEGIN_MESSAGE_MAP(CDSplitView, CView)
  22.     //{{AFX_MSG_MAP(CDSplitView)
  23.     ON_WM_ERASEBKGND()
  24.     //}}AFX_MSG_MAP
  25.     // Standard printing commands
  26.     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  27.     ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  28.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CDSplitView construction/destruction
  33.  
  34. CDSplitView::CDSplitView()
  35. {
  36.     // TODO: add construction code here
  37.  
  38. }
  39.  
  40. CDSplitView::~CDSplitView()
  41. {
  42. }
  43.  
  44. BOOL CDSplitView::PreCreateWindow(CREATESTRUCT& cs)
  45. {
  46.     // TODO: Modify the Window class or styles here by modifying
  47.     //  the CREATESTRUCT cs
  48.  
  49.     return CView::PreCreateWindow(cs);
  50. }
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CDSplitView drawing
  54.  
  55. void CDSplitView::OnDraw(CDC* pDC)
  56. {
  57.     CRect rect;
  58.     GetClientRect(&rect);
  59.     pDC->DrawText("View 1",&rect,DT_CENTER | DT_VCENTER |DT_SINGLELINE);
  60. }
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CDSplitView printing
  64.  
  65. BOOL CDSplitView::OnPreparePrinting(CPrintInfo* pInfo)
  66. {
  67.     // default preparation
  68.     return DoPreparePrinting(pInfo);
  69. }
  70.  
  71. void CDSplitView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  72. {
  73.     // TODO: add extra initialization before printing
  74. }
  75.  
  76. void CDSplitView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  77. {
  78.     // TODO: add cleanup after printing
  79. }
  80.  
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CDSplitView diagnostics
  83.  
  84. #ifdef _DEBUG
  85. void CDSplitView::AssertValid() const
  86. {
  87.     CView::AssertValid();
  88. }
  89.  
  90. void CDSplitView::Dump(CDumpContext& dc) const
  91. {
  92.     CView::Dump(dc);
  93. }
  94.  
  95. CDSplitDoc* CDSplitView::GetDocument() // non-debug version is inline
  96. {
  97.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDSplitDoc)));
  98.     return (CDSplitDoc*)m_pDocument;
  99. }
  100. #endif //_DEBUG
  101.  
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CDSplitView message handlers
  104.  
  105. BOOL CDSplitView::OnEraseBkgnd(CDC* pDC) 
  106. {
  107.     CRect rect;
  108.     GetClientRect(&rect);
  109.  
  110.     pDC->FillSolidRect(&rect,::GetSysColor(COLOR_WINDOW));
  111.     
  112.     return TRUE;
  113. }
  114.