home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / stasplit / staspvw.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.2 KB  |  88 lines

  1. // staspvw.cpp : implementation of the CStaticSplitView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "stasplit.h"
  6.  
  7. #include "staspdoc.h"
  8. #include "staspvw.h"
  9.  
  10. #ifdef _DEBUG
  11. #undef THIS_FILE
  12. static char BASED_CODE THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CStaticSplitView
  17.  
  18. IMPLEMENT_DYNCREATE(CStaticSplitView, CEditView)
  19.  
  20. BEGIN_MESSAGE_MAP(CStaticSplitView, CEditView)
  21.     //{{AFX_MSG_MAP(CStaticSplitView)
  22.     //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CStaticSplitView construction/destruction
  27.  
  28. CStaticSplitView::CStaticSplitView()
  29. {
  30. }
  31.  
  32. CStaticSplitView::~CStaticSplitView()
  33. {
  34. }
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CStaticSplitView drawing
  38.  
  39. void CStaticSplitView::OnDraw(CDC* pDC)
  40. {
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CStaticSplitView diagnostics
  45.  
  46. #ifdef _DEBUG
  47. void CStaticSplitView::AssertValid() const
  48. {
  49.     CEditView::AssertValid();
  50. }
  51.  
  52. void CStaticSplitView::Dump(CDumpContext& dc) const
  53. {
  54.     CEditView::Dump(dc);
  55. }
  56.  
  57. CStaticSplitDoc* CStaticSplitView::GetDocument() // non-debug version is inline
  58. {
  59.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CStaticSplitDoc)));
  60.     return (CStaticSplitDoc*)m_pDocument;
  61. }
  62. #endif //_DEBUG
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CStaticSplitView message handlers
  66.  
  67. void CStaticSplitView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
  68. {
  69.     CStaticSplitDoc* pDoc = GetDocument();
  70.     ASSERT_VALID(pDoc);
  71.  
  72.     CString strPoem = "";
  73.     for (int i = 0; i < pDoc->m_arstrPoem.GetSize(); i++)
  74.     {
  75.         strPoem += pDoc->m_arstrPoem[i] + "\r\n";
  76.     }
  77.     GetEditCtrl().SetWindowText(strPoem);
  78. }
  79.  
  80. BOOL CStaticSplitView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
  81. {
  82.     if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE, rect, pParentWnd, nID, pContext))
  83.         return FALSE;
  84.  
  85.     GetEditCtrl().SetReadOnly(TRUE);
  86.     return TRUE;
  87. }
  88.