Leaked source code of windows server 2003
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.

172 lines
4.0 KiB

  1. // simpvw.cpp : implementation of the simple view classes
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. #include "stdafx.h"
  13. #include "viewex.h"
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char BASED_CODE THIS_FILE[] = __FILE__;
  17. #endif
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CTextView
  20. IMPLEMENT_DYNCREATE(CTextView, CView)
  21. BEGIN_MESSAGE_MAP(CTextView, CView)
  22. //{{AFX_MSG_MAP(CTextView)
  23. ON_WM_MOUSEACTIVATE()
  24. //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CTextView construction/destruction
  28. CTextView::CTextView()
  29. {
  30. }
  31. CTextView::~CTextView()
  32. {
  33. }
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CTextView drawing
  36. void CTextView::OnDraw(CDC* pDC)
  37. {
  38. CMainDoc* pDoc = GetDocument();
  39. CRect rect;
  40. GetClientRect(rect);
  41. pDC->SetTextAlign(TA_BASELINE | TA_CENTER);
  42. pDC->SetBkMode(TRANSPARENT);
  43. // center in the window
  44. /*pDC->TextOut(rect.Width() / 2, rect.Height() / 2,
  45. pDoc->m_strData, pDoc->m_strData.GetLength());*/
  46. }
  47. int CTextView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
  48. {
  49. // side-step CView's implementation since we don't want to activate
  50. // this view
  51. return CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
  52. }
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CColorView
  55. IMPLEMENT_DYNCREATE(CColorView, CView)
  56. BEGIN_MESSAGE_MAP(CColorView, CView)
  57. //{{AFX_MSG_MAP(CColorView)
  58. ON_WM_MOUSEACTIVATE()
  59. //}}AFX_MSG_MAP
  60. END_MESSAGE_MAP()
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CColorView construction/destruction
  63. CColorView::CColorView()
  64. {
  65. }
  66. CColorView::~CColorView()
  67. {
  68. }
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CColorView drawing
  71. void CColorView::OnDraw(CDC* pDC)
  72. {
  73. CMainDoc* pDoc = GetDocument();
  74. CRect rect;
  75. GetClientRect(rect);
  76. // fill the view with the specified color
  77. }
  78. int CColorView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
  79. {
  80. // side-step CView's implementation since we don't want to activate
  81. // this view
  82. return CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
  83. }
  84. void CColorView::OnActivateView(BOOL, CView*, CView*)
  85. {
  86. ASSERT(FALSE); // output only view - should never be active
  87. }
  88. /////////////////////////////////////////////////////////////////////////////
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CNameView
  91. IMPLEMENT_DYNCREATE(CNameView, CEditView)
  92. CNameView::CNameView()
  93. {
  94. }
  95. CNameView::~CNameView()
  96. {
  97. }
  98. BEGIN_MESSAGE_MAP(CNameView, CEditView)
  99. //{{AFX_MSG_MAP(CNameView)
  100. // NOTE - the ClassWizard will add and remove mapping macros here.
  101. //}}AFX_MSG_MAP
  102. END_MESSAGE_MAP()
  103. /////////////////////////////////////////////////////////////////////////////
  104. // CNameView drawing
  105. /////////////////////////////////////////////////////////////////////////////
  106. // CNameView diagnostics
  107. #ifdef _DEBUG
  108. void CNameView::AssertValid() const
  109. {
  110. CEditView::AssertValid();
  111. }
  112. void CNameView::Dump(CDumpContext& dc) const
  113. {
  114. CEditView::Dump(dc);
  115. }
  116. #endif //_DEBUG
  117. /////////////////////////////////////////////////////////////////////////////
  118. // CNameView message handlers
  119. void CNameView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
  120. {
  121. // TODO: Add your specialized code here and/or call the base class
  122. //CString strText;
  123. //GetDocument( )->GetItemName( strText );
  124. //GetEditCtrl().SetWindowText( strText );
  125. CEditView::OnUpdate( pSender, lHint, pHint );
  126. }