CADView.h
上传用户:shangwu01
上传日期:2013-04-22
资源大小:707k
文件大小:3k
源码类别:

CAD

开发平台:

Visual C++

  1. // CADView.h : interface of the CCADView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_)
  5. #define AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "LINE.h"
  10. #include "RECTANGE.h"
  11. #include "CIRCLE.h"
  12. #include "ELLIPS.h"
  13. #include "MULTILINE.h"
  14. #include "ARC.h"
  15. class CCADView : public CScrollView
  16. {
  17. protected: // create from serialization only
  18. CCADView();
  19. DECLARE_DYNCREATE(CCADView)
  20. // Attributes
  21. public:
  22. CCADDoc* GetDocument();
  23. // Operations
  24. public:
  25. CPoint m_pointorg;
  26. CPoint m_pointfal;
  27. CPoint m_pointend;
  28. public:
  29. CPoint m_click;
  30. private:
  31. CBitmap* m_pBitmap;
  32. CDC* m_pmdc;
  33. int m_click_times;
  34. public:
  35. bool catchend;
  36. bool catchcertre;
  37. bool catchmiddle;
  38. bool catchcross;
  39. bool catchcut;
  40. bool m_selected;
  41. private:
  42. int select;
  43. int m_Num;
  44. int m_nStyle;
  45. // Overrides
  46. // ClassWizard generated virtual function overrides
  47. //{{AFX_VIRTUAL(CCADView)
  48. public:
  49. virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  50. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  51. protected:
  52. virtual void OnInitialUpdate(); // called first time after construct
  53. virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  54. virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  55. virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. public:
  59. virtual ~CCADView();
  60. #ifdef _DEBUG
  61. virtual void AssertValid() const;
  62. virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64. private:
  65. void editdraw(CPoint point,CDC*pDC);
  66. bool editselect(CPoint point);
  67. void catchpoint(CPoint point,CDC*pDC);
  68. CPoint search(CPoint point);
  69. // Generated message map functions
  70. protected:
  71. //{{AFX_MSG(CCADView)
  72. afx_msg void OnPaint();
  73. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  74. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  75. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  76. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  77. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  78. afx_msg void OnBack();
  79. afx_msg void OnFront();
  80. afx_msg void OnRemove();
  81. afx_msg void OnCATCHcertre();
  82. afx_msg void OnUpdateCATCHcertre(CCmdUI* pCmdUI);
  83. afx_msg void OnCATCHcross();
  84. afx_msg void OnUpdateCATCHcross(CCmdUI* pCmdUI);
  85. afx_msg void OnCATCHcut();
  86. afx_msg void OnUpdateCATCHcut(CCmdUI* pCmdUI);
  87. afx_msg void OnCATCHend();
  88. afx_msg void OnUpdateCATCHend(CCmdUI* pCmdUI);
  89. afx_msg void OnCATCHmiddle();
  90. afx_msg void OnUpdateCATCHmiddle(CCmdUI* pCmdUI);
  91. afx_msg void OnDel();
  92. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  93. //}}AFX_MSG
  94. DECLARE_MESSAGE_MAP()
  95. };
  96. #ifndef _DEBUG  // debug version in CADView.cpp
  97. inline CCADDoc* CCADView::GetDocument()
  98.    { return (CCADDoc*)m_pDocument; }
  99. #endif
  100. /////////////////////////////////////////////////////////////////////////////
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  103. #endif // !defined(AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_)