⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mousedrawview.h

📁 vc++程序设计与技巧中第8章“图形图像编程”部分的VC++原代码
💻 H
字号:
// MouseDrawView.h : interface of the CMouseDrawView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MouseDrawVIEW_H__2044992F_B0A4_11D6_BA91_0000B48A08B1__INCLUDED_)
#define AFX_MouseDrawVIEW_H__2044992F_B0A4_11D6_BA91_0000B48A08B1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMouseDrawView : public CView
{
protected: // create from serialization only
	CMouseDrawView();
	DECLARE_DYNCREATE(CMouseDrawView)

// Attributes
public:
	CMouseDrawDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMouseDrawView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	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);
	//}}AFX_VIRTUAL

// Implementation
public:
	void DrawCross(CDC *pDC,CPoint point);
	int m_DrawType;
	void DrawLine(CDC *pDC,CPoint start,CPoint end);
	void DrawCircle(CDC* pDC, CPoint cenp, CPoint ardp) ;
	int	 ComputeRadius(CPoint cenp, CPoint ardp) ;
	void DrawRect(CDC* pDC, CPoint ltp,CPoint rbp) ;
	int m_Step;
	virtual ~CMouseDrawView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	CPoint m_CenterP;
	CPoint m_AroundP;
	BOOL m_bLine;
	BOOL m_bCircle;
	CPoint m_EndP;
	CPoint m_StartP;
	CPoint	m_ltP ;
	CPoint	m_rbP ;
	BOOL	m_bRect;
	//{{AFX_MSG(CMouseDrawView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnDrawCircle();
	afx_msg void OnDrawLine();
	afx_msg void OnDrawRect();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in MouseDrawView.cpp
inline CMouseDrawDoc* CMouseDrawView::GetDocument()
   { return (CMouseDrawDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MouseDrawVIEW_H__2044992F_B0A4_11D6_BA91_0000B48A08B1__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -