Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.4 KiB

  1. // testView.cpp : implementation of the CTestView class
  2. //
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1997-1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. #include "stdafx.h"
  12. #include "MQApitst.h"
  13. #include "mainfrm.h"
  14. #include "testDoc.h"
  15. #include "testView.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CTestView
  23. IMPLEMENT_DYNCREATE(CTestView, CEditView)
  24. BEGIN_MESSAGE_MAP(CTestView, CEditView)
  25. //{{AFX_MSG_MAP(CTestView)
  26. ON_WM_CREATE()
  27. //}}AFX_MSG_MAP
  28. END_MESSAGE_MAP()
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CTestView construction/destruction
  31. CTestView::CTestView()
  32. {
  33. // TODO: add construction code here
  34. }
  35. CTestView::~CTestView()
  36. {
  37. }
  38. BOOL CTestView::PreCreateWindow(CREATESTRUCT& cs)
  39. {
  40. // TODO: Modify the Window class or styles here by modifying
  41. // the CREATESTRUCT cs
  42. BOOL bPreCreated = CEditView::PreCreateWindow(cs);
  43. cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
  44. return bPreCreated;
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CTestView drawing
  48. void CTestView::OnDraw(CDC* pDC)
  49. {
  50. CTestDoc* pDoc = GetDocument();
  51. ASSERT_VALID(pDoc);
  52. // TODO: add draw code for native data here
  53. }
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CTestView diagnostics
  56. #ifdef _DEBUG
  57. void CTestView::AssertValid() const
  58. {
  59. CEditView::AssertValid();
  60. }
  61. void CTestView::Dump(CDumpContext& dc) const
  62. {
  63. CEditView::Dump(dc);
  64. }
  65. CTestDoc* CTestView::GetDocument() // non-debug version is inline
  66. {
  67. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTestDoc)));
  68. return (CTestDoc*)m_pDocument;
  69. }
  70. #endif //_DEBUG
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CTestView message handlers
  73. int CTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
  74. {
  75. if (CEditView::OnCreate(lpCreateStruct) == -1)
  76. return -1;
  77. // TODO: Add your specialized creation code here
  78. pMainView = this;
  79. return 0;
  80. }