ActivePaneViewView.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:4k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // ActivePaneViewView.cpp : implementation of the CActivePaneViewView class
  2. //
  3. // This file is a part of the XTREME TOOLKIT PRO MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #include "stdafx.h"
  21. #include "ActivePaneView.h"
  22. #include "ActivePaneViewDoc.h"
  23. #include "ActivePaneViewView.h"
  24. #include "MainFrm.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CActivePaneViewView
  32. IMPLEMENT_DYNCREATE(CActivePaneViewView, CViewDraw)
  33. BEGIN_MESSAGE_MAP(CActivePaneViewView, CViewDraw)
  34. //{{AFX_MSG_MAP(CActivePaneViewView)
  35. ON_WM_NCCALCSIZE()
  36. ON_WM_NCPAINT()
  37. ON_COMMAND(ID_VIEW_THREE, OnViewThree)
  38. ON_UPDATE_COMMAND_UI(ID_VIEW_THREE, OnUpdateViewThree)
  39. ON_WM_SETFOCUS()
  40. ON_WM_KILLFOCUS()
  41. //}}AFX_MSG_MAP
  42. // Standard printing commands
  43. ON_COMMAND(ID_FILE_PRINT, CViewDraw::OnFilePrint)
  44. ON_COMMAND(ID_FILE_PRINT_DIRECT, CViewDraw::OnFilePrint)
  45. ON_COMMAND(ID_FILE_PRINT_PREVIEW, CViewDraw::OnFilePrintPreview)
  46. END_MESSAGE_MAP()
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CActivePaneViewView construction/destruction
  49. CActivePaneViewView::CActivePaneViewView()
  50. : m_bEnable(FALSE)
  51. {
  52. // TODO: add construction code here
  53. m_strTitle = _T("Three...");
  54. }
  55. CActivePaneViewView::~CActivePaneViewView()
  56. {
  57. }
  58. BOOL CActivePaneViewView::PreCreateWindow(CREATESTRUCT& cs)
  59. {
  60. // TODO: Modify the Window class or styles here by modifying
  61. //  the CREATESTRUCT cs
  62. return CViewDraw::PreCreateWindow(cs);
  63. }
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CActivePaneViewView drawing
  66. void CActivePaneViewView::OnDraw(CDC* pDC)
  67. {
  68. CViewDraw::OnDraw(pDC);
  69. }
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CActivePaneViewView printing
  72. BOOL CActivePaneViewView::OnPreparePrinting(CPrintInfo* pInfo)
  73. {
  74. // default preparation
  75. return DoPreparePrinting(pInfo);
  76. }
  77. void CActivePaneViewView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  78. {
  79. // TODO: add extra initialization before printing
  80. }
  81. void CActivePaneViewView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  82. {
  83. // TODO: add cleanup after printing
  84. }
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CActivePaneViewView diagnostics
  87. #ifdef _DEBUG
  88. void CActivePaneViewView::AssertValid() const
  89. {
  90. CViewDraw::AssertValid();
  91. }
  92. void CActivePaneViewView::Dump(CDumpContext& dc) const
  93. {
  94. CViewDraw::Dump(dc);
  95. }
  96. CActivePaneViewDoc* CActivePaneViewView::GetDocument() // non-debug version is inline
  97. {
  98. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CActivePaneViewDoc)));
  99. return (CActivePaneViewDoc*)m_pDocument;
  100. }
  101. #endif //_DEBUG
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CActivePaneViewView message handlers
  104. void CActivePaneViewView::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
  105. {
  106. // bypass base class.
  107. CView::OnNcCalcSize(bCalcValidRects, lpncsp);
  108. }
  109. void CActivePaneViewView::OnNcPaint()
  110. {
  111. // bypass base class.
  112. CView::OnNcPaint();
  113. }
  114. void CActivePaneViewView::OnViewThree()
  115. {
  116. // TODO: Add your command handler code here
  117. AfxMessageBox(_T("SDI View - No. 3"));
  118. }
  119. void CActivePaneViewView::OnUpdateViewThree(CCmdUI* pCmdUI)
  120. {
  121. // TODO: Add your command update UI handler code here
  122. pCmdUI->Enable(m_bEnable);
  123. }
  124. void CActivePaneViewView::OnSetFocus(CWnd* pOldWnd)
  125. {
  126. CViewDraw::OnSetFocus(pOldWnd);
  127. // TODO: Add your message handler code here
  128. m_bEnable = TRUE;
  129. }
  130. void CActivePaneViewView::OnKillFocus(CWnd* pNewWnd)
  131. {
  132. CViewDraw::OnKillFocus(pNewWnd);
  133. // TODO: Add your message handler code here
  134. m_bEnable = FALSE;
  135. }