CADView.h
上传用户:shangwu01
上传日期:2013-04-22
资源大小:707k
文件大小:3k
- // CADView.h : interface of the CCADView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_)
- #define AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "LINE.h"
- #include "RECTANGE.h"
- #include "CIRCLE.h"
- #include "ELLIPS.h"
- #include "MULTILINE.h"
- #include "ARC.h"
- class CCADView : public CScrollView
- {
- protected: // create from serialization only
- CCADView();
- DECLARE_DYNCREATE(CCADView)
- // Attributes
- public:
- CCADDoc* GetDocument();
- // Operations
- public:
- CPoint m_pointorg;
- CPoint m_pointfal;
- CPoint m_pointend;
- public:
- CPoint m_click;
- private:
- CBitmap* m_pBitmap;
- CDC* m_pmdc;
- int m_click_times;
- public:
- bool catchend;
- bool catchcertre;
- bool catchmiddle;
- bool catchcross;
- bool catchcut;
- bool m_selected;
- private:
- int select;
- int m_Num;
- int m_nStyle;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CCADView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- protected:
- virtual void OnInitialUpdate(); // called first time after construct
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CCADView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- private:
- void editdraw(CPoint point,CDC*pDC);
- bool editselect(CPoint point);
- void catchpoint(CPoint point,CDC*pDC);
- CPoint search(CPoint point);
- // Generated message map functions
- protected:
- //{{AFX_MSG(CCADView)
- afx_msg void OnPaint();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnBack();
- afx_msg void OnFront();
- afx_msg void OnRemove();
- afx_msg void OnCATCHcertre();
- afx_msg void OnUpdateCATCHcertre(CCmdUI* pCmdUI);
- afx_msg void OnCATCHcross();
- afx_msg void OnUpdateCATCHcross(CCmdUI* pCmdUI);
- afx_msg void OnCATCHcut();
- afx_msg void OnUpdateCATCHcut(CCmdUI* pCmdUI);
- afx_msg void OnCATCHend();
- afx_msg void OnUpdateCATCHend(CCmdUI* pCmdUI);
- afx_msg void OnCATCHmiddle();
- afx_msg void OnUpdateCATCHmiddle(CCmdUI* pCmdUI);
- afx_msg void OnDel();
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in CADView.cpp
- inline CCADDoc* CCADView::GetDocument()
- { return (CCADDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_CADVIEW_H__1C0F9FEE_28DC_4561_8A4D_A3251CB96C5B__INCLUDED_)