CrdFileDriverView.cpp
上传用户:lsj_816
上传日期:2007-01-01
资源大小:37k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  1. // CrdFileDriverView.cpp : implementation of the CCrdFileDriverView class
  2. //
  3. #include "stdafx.h"
  4. #include "CrdFileDriver.h"
  5. #include "CrdFileDriverDoc.h"
  6. #include "CrdFileDriverView.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCrdFileDriverView
  14. IMPLEMENT_DYNCREATE(CCrdFileDriverView, CEditView)
  15. BEGIN_MESSAGE_MAP(CCrdFileDriverView, CEditView)
  16. //{{AFX_MSG_MAP(CCrdFileDriverView)
  17. // NOTE - the ClassWizard will add and remove mapping macros here.
  18. //    DO NOT EDIT what you see in these blocks of generated code!
  19. //}}AFX_MSG_MAP
  20. END_MESSAGE_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CCrdFileDriverView construction/destruction
  23. CCrdFileDriverView::CCrdFileDriverView()
  24. {
  25. // TODO: add construction code here
  26. }
  27. CCrdFileDriverView::~CCrdFileDriverView()
  28. {
  29. }
  30. BOOL CCrdFileDriverView::PreCreateWindow(CREATESTRUCT& cs)
  31. {
  32. // TODO: Modify the Window class or styles here by modifying
  33. //  the CREATESTRUCT cs
  34. BOOL bPreCreated = CEditView::PreCreateWindow(cs);
  35. cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
  36. return bPreCreated;
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CCrdFileDriverView drawing
  40. void CCrdFileDriverView::OnDraw(CDC* pDC)
  41. {
  42. CCrdFileDriverDoc* pDoc = GetDocument();
  43. ASSERT_VALID(pDoc);
  44. // TODO: add draw code for native data here
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CCrdFileDriverView diagnostics
  48. #ifdef _DEBUG
  49. void CCrdFileDriverView::AssertValid() const
  50. {
  51. CEditView::AssertValid();
  52. }
  53. void CCrdFileDriverView::Dump(CDumpContext& dc) const
  54. {
  55. CEditView::Dump(dc);
  56. }
  57. CCrdFileDriverDoc* CCrdFileDriverView::GetDocument() // non-debug version is inline
  58. {
  59. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCrdFileDriverDoc)));
  60. return (CCrdFileDriverDoc*)m_pDocument;
  61. }
  62. #endif //_DEBUG
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CCrdFileDriverView message handlers
  65. void CCrdFileDriverView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
  66. {
  67. SetWindowText(GetDocument()->m_strText);
  68. }