View.cpp
上传用户:nhyuejuan
上传日期:2013-12-02
资源大小:171k
文件大小:2k
源码类别:

状态条

开发平台:

Visual C++

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Project:PGRSBAR
  3. // Author:NorthTibet
  4. // Date:星期二, 十二月 31, 2002
  5. // Description:在状态栏例实现进程指示器控制。
  6. //
  7. /////////////////////////////////////////////////////////////////////////////
  8. // View.cpp : implementation of the CMyView class
  9. //
  10. #include "stdafx.h"
  11. #include "pgrsbar.h"
  12. #include "Doc.h"
  13. #include "View.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CMyView
  21. IMPLEMENT_DYNCREATE(CMyView, CEditView)
  22. BEGIN_MESSAGE_MAP(CMyView, CEditView)
  23. //{{AFX_MSG_MAP(CMyView)
  24. // NOTE - the ClassWizard will add and remove mapping macros here.
  25. //    DO NOT EDIT what you see in these blocks of generated code!
  26. //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CMyView construction/destruction
  30. CMyView::CMyView()
  31. {
  32. // TODO: add construction code here
  33. }
  34. CMyView::~CMyView()
  35. {
  36. }
  37. BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs)
  38. {
  39. // TODO: Modify the Window class or styles here by modifying
  40. //  the CREATESTRUCT cs
  41. BOOL bPreCreated = CEditView::PreCreateWindow(cs);
  42. cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
  43. return bPreCreated;
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CMyView drawing
  47. void CMyView::OnDraw(CDC* pDC)
  48. {
  49. CMyDoc* pDoc = GetDocument();
  50. ASSERT_VALID(pDoc);
  51. // TODO: add draw code for native data here
  52. }
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CMyView diagnostics
  55. #ifdef _DEBUG
  56. void CMyView::AssertValid() const
  57. {
  58. CEditView::AssertValid();
  59. }
  60. void CMyView::Dump(CDumpContext& dc) const
  61. {
  62. CEditView::Dump(dc);
  63. }
  64. CMyDoc* CMyView::GetDocument() // non-debug version is inline
  65. {
  66. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
  67. return (CMyDoc*)m_pDocument;
  68. }
  69. #endif //_DEBUG
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CMyView message handlers