ex11View.cpp
上传用户:cesper001
上传日期:2007-01-01
资源大小:50k
文件大小:3k
源码类别:

按钮控件

开发平台:

Visual C++

  1. // ex11View.cpp : implementation of the CEx11View class
  2. //
  3. #include "stdafx.h"
  4. #include "ex11.h"
  5. #include "ex11Doc.h"
  6. #include "ex11View.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CEx11View
  14. IMPLEMENT_DYNCREATE(CEx11View, CFormView)
  15. BEGIN_MESSAGE_MAP(CEx11View, CFormView)
  16. //{{AFX_MSG_MAP(CEx11View)
  17. // NOTE - the ClassWizard will add and remove mapping macros here.
  18. //    DO NOT EDIT what you see in these blocks of generated code!
  19. //}}AFX_MSG_MAP
  20. // Standard printing commands
  21. ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
  22. ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
  23. ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
  24. END_MESSAGE_MAP()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CEx11View construction/destruction
  27. CEx11View::CEx11View()
  28. : CFormView(CEx11View::IDD)
  29. {
  30. //{{AFX_DATA_INIT(CEx11View)
  31. // NOTE: the ClassWizard will add member initialization here
  32. //}}AFX_DATA_INIT
  33. // TODO: add construction code here
  34. }
  35. CEx11View::~CEx11View()
  36. {
  37. }
  38. void CEx11View::DoDataExchange(CDataExchange* pDX)
  39. {
  40. CFormView::DoDataExchange(pDX);
  41. //{{AFX_DATA_MAP(CEx11View)
  42. // NOTE: the ClassWizard will add DDX and DDV calls here
  43. //}}AFX_DATA_MAP
  44. }
  45. BOOL CEx11View::PreCreateWindow(CREATESTRUCT& cs)
  46. {
  47. // TODO: Modify the Window class or styles here by modifying
  48. //  the CREATESTRUCT cs
  49. return CFormView::PreCreateWindow(cs);
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CEx11View printing
  53. BOOL CEx11View::OnPreparePrinting(CPrintInfo* pInfo)
  54. {
  55. // default preparation
  56. return DoPreparePrinting(pInfo);
  57. }
  58. void CEx11View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  59. {
  60. // TODO: add extra initialization before printing
  61. }
  62. void CEx11View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  63. {
  64. // TODO: add cleanup after printing
  65. }
  66. void CEx11View::OnPrint(CDC* pDC, CPrintInfo*)
  67. {
  68. // TODO: add code to print the controls
  69. }
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CEx11View diagnostics
  72. #ifdef _DEBUG
  73. void CEx11View::AssertValid() const
  74. {
  75. CFormView::AssertValid();
  76. }
  77. void CEx11View::Dump(CDumpContext& dc) const
  78. {
  79. CFormView::Dump(dc);
  80. }
  81. CEx11Doc* CEx11View::GetDocument() // non-debug version is inline
  82. {
  83. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx11Doc)));
  84. return (CEx11Doc*)m_pDocument;
  85. }
  86. #endif //_DEBUG
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CEx11View message handlers
  89. void CEx11View::OnInitialUpdate() 
  90. {
  91. CFormView::OnInitialUpdate();
  92. // TODO: Add your specialized code here and/or call the base class
  93. m_MyBtn.SubclassDlgItem( IDC_OWN, this );
  94. }