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

对话框与窗口

开发平台:

Visual C++

  1. // PagerView.cpp : implementation of the CPagerView 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 "Pager.h"
  22. #include "PagerDoc.h"
  23. #include "PagerView.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CPagerView
  31. IMPLEMENT_DYNCREATE(CPagerView, CListView)
  32. BEGIN_MESSAGE_MAP(CPagerView, CListView)
  33. //{{AFX_MSG_MAP(CPagerView)
  34. // NOTE - the ClassWizard will add and remove mapping macros here.
  35. //    DO NOT EDIT what you see in these blocks of generated code!
  36. //}}AFX_MSG_MAP
  37. // Standard printing commands
  38. ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint)
  39. ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint)
  40. ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview)
  41. END_MESSAGE_MAP()
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CPagerView construction/destruction
  44. CPagerView::CPagerView()
  45. {
  46. // TODO: add construction code here
  47. }
  48. CPagerView::~CPagerView()
  49. {
  50. }
  51. BOOL CPagerView::PreCreateWindow(CREATESTRUCT& cs)
  52. {
  53. if (!CListView::PreCreateWindow(cs))
  54. return FALSE;
  55. // TODO: Modify the Window class or styles here by modifying
  56. //  the CREATESTRUCT cs
  57. return TRUE;
  58. }
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CPagerView drawing
  61. void CPagerView::OnDraw(CDC* /*pDC*/)
  62. {
  63. CListCtrl& refCtrl = GetListCtrl();
  64. refCtrl.InsertItem(0, _T("Item!"));
  65. // TODO: add draw code for native data here
  66. }
  67. void CPagerView::OnInitialUpdate()
  68. {
  69. CListView::OnInitialUpdate();
  70. // TODO: You may populate your ListView with items by directly accessing
  71. //  its list control through a call to GetListCtrl().
  72. }
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CPagerView printing
  75. BOOL CPagerView::OnPreparePrinting(CPrintInfo* pInfo)
  76. {
  77. // default preparation
  78. return DoPreparePrinting(pInfo);
  79. }
  80. void CPagerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  81. {
  82. // TODO: add extra initialization before printing
  83. }
  84. void CPagerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  85. {
  86. // TODO: add cleanup after printing
  87. }
  88. /////////////////////////////////////////////////////////////////////////////
  89. // CPagerView diagnostics
  90. #ifdef _DEBUG
  91. void CPagerView::AssertValid() const
  92. {
  93. CListView::AssertValid();
  94. }
  95. void CPagerView::Dump(CDumpContext& dc) const
  96. {
  97. CListView::Dump(dc);
  98. }
  99. CPagerDoc* CPagerView::GetDocument() // non-debug version is inline
  100. {
  101. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPagerDoc)));
  102. return (CPagerDoc*)m_pDocument;
  103. }
  104. #endif //_DEBUG
  105. /////////////////////////////////////////////////////////////////////////////
  106. // CPagerView message handlers
  107. void CPagerView::OnStyleChanged(int /*nStyleType*/, LPSTYLESTRUCT /*lpStyleStruct*/)
  108. {
  109. //TODO: add code to react to the user changing the view style of your window
  110. }