paintview.h

来自「Visual_C++.NET实用编程百例」· C头文件 代码 · 共 70 行

H
70
字号
// paintView.h : CpaintView 类的接口
//


#pragma once


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

// 属性
public:
	CpaintDoc* GetDocument() const;
	//鼠标按下是,获得起始点
	CPoint sPoint;
	//判断鼠标是否按下
	bool down;
	//图形类别
	int flag;
	//颜色类别
	int color;

// 操作
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 ~CpaintView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnDot();
	afx_msg void OnLine();
	afx_msg void OnRect();
	afx_msg void OnEllipse();
	afx_msg void OnRed();
	afx_msg void OnGreen();
	afx_msg void OnBlue();
};

#ifndef _DEBUG  // paintView.cpp 的调试版本
inline CpaintDoc* CpaintView::GetDocument() const
   { return reinterpret_cast<CpaintDoc*>(m_pDocument); }
#endif

⌨️ 快捷键说明

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