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

📄 lq01doc.h

📁 用多态实现的画图小程序
💻 H
字号:
// lq01Doc.h : interface of the CLq01Doc class
//
/////////////////////////////////////////////////////////////////////////////
#include "line.h"
#include "shape.h"
#include "myrect.h"
#if !defined(AFX_LQ01DOC_H__9DC40EA8_FC58_44C1_85B5_39EBE828B739__INCLUDED_)
#define AFX_LQ01DOC_H__9DC40EA8_FC58_44C1_85B5_39EBE828B739__INCLUDED_

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




class CLq01Doc : public CDocument
{
protected: // create from serialization only
	CLq01Doc();
	DECLARE_DYNCREATE(CLq01Doc)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLq01Doc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	CShape * CreatShape(CPoint ptStart, CPoint ptEnd, COLORREF iColor);
	int GetShape();
	CShape * GetShape(int nIndex);
	int GetShapeCount();
	CShape* AddShape(CPoint ptStart,CPoint ptEnd,COLORREF iColor);
	CObArray m_iShapes;
	UINT GetColor();
	static const COLORREF m_crColors[8];
	virtual ~CLq01Doc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CLq01Doc)
	afx_msg void OnColorBlack();
	afx_msg void OnUpdateColorBlack(CCmdUI* pCmdUI);
	afx_msg void OnColorBlue();
	afx_msg void OnUpdateColorBlue(CCmdUI* pCmdUI);
	afx_msg void OnColorCyan();
	afx_msg void OnUpdateColorCyan(CCmdUI* pCmdUI);
	afx_msg void OnColorGreen();
	afx_msg void OnUpdateColorGreen(CCmdUI* pCmdUI);
	afx_msg void OnColorRed();
	afx_msg void OnUpdateColorRed(CCmdUI* pCmdUI);
	afx_msg void OnColorMagenta();
	afx_msg void OnUpdateColorMagenta(CCmdUI* pCmdUI);
	afx_msg void OnColorWhite();
	afx_msg void OnUpdateColorWhite(CCmdUI* pCmdUI);
	afx_msg void OnColorYellow();
	afx_msg void OnUpdateColorYellow(CCmdUI* pCmdUI);
	afx_msg void OnShapeLine();
	afx_msg void OnUpdateShapeLine(CCmdUI* pCmdUI);
	afx_msg void OnShapeRectangle();
	afx_msg void OnUpdateShapeRectangle(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	CMyRect m_MyRect;
	CLine m_MyLine;
	CShape * m_MyShape;
	int m_nShape;
	UINT m_nColor;
};

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

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

#endif // !defined(AFX_LQ01DOC_H__9DC40EA8_FC58_44C1_85B5_39EBE828B739__INCLUDED_)

⌨️ 快捷键说明

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