CGuiTabbedDemoView.cpp
上传用户:wlkj888
上传日期:2022-08-01
资源大小:806k
文件大小:3k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // CGuiTabbedDemoView.cpp : implementation of the CCGuiTabbedDemoView class
  2. //
  3. #include "stdafx.h"
  4. #include "CGuiTabbedDemo.h"
  5. #include "CGuiTabbedDemoDoc.h"
  6. #include "CGuiTabbedDemoView.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCGuiTabbedDemoView
  14. IMPLEMENT_DYNCREATE(CCGuiTabbedDemoView, CView)
  15. BEGIN_MESSAGE_MAP(CCGuiTabbedDemoView, CView)
  16. //{{AFX_MSG_MAP(CCGuiTabbedDemoView)
  17. ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview)
  18. //}}AFX_MSG_MAP
  19. // Standard printing commands
  20. ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  21. ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  22. ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  23. END_MESSAGE_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CCGuiTabbedDemoView construction/destruction
  26. CCGuiTabbedDemoView::CCGuiTabbedDemoView()
  27. {
  28. // TODO: add construction code here
  29. }
  30. CCGuiTabbedDemoView::~CCGuiTabbedDemoView()
  31. {
  32. }
  33. BOOL CCGuiTabbedDemoView::PreCreateWindow(CREATESTRUCT& cs)
  34. {
  35. // TODO: Modify the Window class or styles here by modifying
  36. //  the CREATESTRUCT cs
  37. return CView::PreCreateWindow(cs);
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CCGuiTabbedDemoView drawing
  41. void CCGuiTabbedDemoView::OnDraw(CDC* pDC)
  42. {
  43. CCGuiTabbedDemoDoc* pDoc = GetDocument();
  44. ASSERT_VALID(pDoc);
  45. // TODO: add draw code for native data here
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CCGuiTabbedDemoView printing
  49. BOOL CCGuiTabbedDemoView::OnPreparePrinting(CPrintInfo* pInfo)
  50. {
  51. // default preparation
  52. return DoPreparePrinting(pInfo);
  53. }
  54. void CCGuiTabbedDemoView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  55. {
  56. // TODO: add extra initialization before printing
  57. }
  58. void CCGuiTabbedDemoView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  59. {
  60. // TODO: add cleanup after printing
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CCGuiTabbedDemoView diagnostics
  64. #ifdef _DEBUG
  65. void CCGuiTabbedDemoView::AssertValid() const
  66. {
  67. CView::AssertValid();
  68. }
  69. void CCGuiTabbedDemoView::Dump(CDumpContext& dc) const
  70. {
  71. CView::Dump(dc);
  72. }
  73. CCGuiTabbedDemoDoc* CCGuiTabbedDemoView::GetDocument() // non-debug version is inline
  74. {
  75. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCGuiTabbedDemoDoc)));
  76. return (CCGuiTabbedDemoDoc*)m_pDocument;
  77. }
  78. #endif //_DEBUG
  79. /////////////////////////////////////////////////////////////////////////////
  80. // CCGuiTabbedDemoView message handlers
  81. void CCGuiTabbedDemoView::OnFilePrintPreview() 
  82. {
  83. // TODO: Add your command handler code here
  84. CMDIFrameWnd* pParent = STATIC_DOWNCAST(CMDIFrameWnd, AfxGetMainWnd());
  85. ASSERT_VALID(pParent);
  86. pParent->SendMessage(ID_FILE_PRINT_PREVIEW);
  87. CView::OnFilePrintPreview();
  88. }