// DrawView.h : CDrawView 类的接口
//


#pragma once


class CDrawView : public CView
{
protected: // 仅从序列化创建
	CDrawView();
	DECLARE_DYNCREATE(CDrawView)

	enum enumMouseStatus
	{
		MOUSENULL = 0,
		LBUTTONDOWM,
		LBUTTONUP,
		RBUTTONDOWN,
		RBUTTONUP,
		MOUSEMOVE
	};

// 属性
public:
	CDrawDoc* GetDocument() const;
	BOOL            m_bStatus;         // 标识是否正在画图中
	CPoint          m_ptMove;          // MouseMove中的point
	CPoint          m_ptEnd;           // 画图操作中的最后一步点坐标
	enumMouseStatus m_MouseStatus;     // Mouse状态
	

// 操作
public:

// 重写
public:
	virtual void OnDraw(CDC* pDC);  // 重写以绘制该视图
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// 实现
public:
	virtual ~CDrawView();
	afx_msg void OnCmdMenuDraw(UINT nMenuID);
	afx_msg void OnUpdateCmdMenuDraw(CCmdUI* pCmdUI);
	afx_msg void OnCmdMenuDB(UINT nMenuID);
	afx_msg void OnUpdateCmdMenuDB(CCmdUI* pCmdUI);
	afx_msg void OnCmdMenuCurvePopup(UINT nMenuID);
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
public:
	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 OnRButtonUp(UINT nFlags, CPoint point);
protected:
	void PopupMenu(UINT nMenuID);
	afx_msg void OnCmdMenuPolyLinePopup(UINT nMenuID);
	void DrawCurve(CDC* pDC);
public:
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
};

#ifndef _DEBUG  // DrawView.cpp 中的调试版本
inline CDrawDoc* CDrawView::GetDocument() const
   { return reinterpret_cast<CDrawDoc*>(m_pDocument); }
#endif

