square.h

来自「Visual C++编程宝典随书光盘里的代码」· C头文件 代码 · 共 55 行

H
55
字号
// square.h : interface of the CPaintSquare and CPaintRect class
//
/////////////////////////////////////////////////////////////////////////////

class CPaintSquare : public CPainted
{
public:
	CPaintSquare() { };
	CPaintSquare(BOOL bFilled);

  	void Draw(CDC* pCDC);
	void DragDraw(CDC* pDC, CPoint& pointDragged);
	void DrawSelected(CDC* pDC);

	void OnDown(CPoint& pointDown);
	void OnUp(CPoint& pointUp, CWnd* pWnd);

	BOOL IsHit(CPoint& pointBang);
	void GetBoundingRect(CRect* pRect);

	void Serialize(CArchive& ar);

protected:
	DECLARE_SERIAL(CPaintSquare)

	CPoint m_pointLower;
	COLORREF m_rgbInside;
	BOOL m_bFilled;
};


class CPaintRect : public CPainted
{
public:
	CPaintRect() { };
	CPaintRect(BOOL bFilled);

  	void Draw(CDC* pCDC);
	void DragDraw(CDC* pDC, CPoint& pointDragged);
	void DrawSelected(CDC* pDC);

	void OnDown(CPoint& pointDown);
	void OnUp(CPoint& pointUp, CWnd* pWnd);
	BOOL IsHit(CPoint& pointBang);
  	void Serialize(CArchive& ar);
	void GetBoundingRect(CRect* pRect);

protected:
	DECLARE_SERIAL(CPaintRect)

	CPoint m_pointLower;
	COLORREF m_rgbInside;
	BOOL m_bFilled;
};

⌨️ 快捷键说明

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