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

📄 draw1view.h

📁 用c++编写的简单的绘图程序
💻 H
字号:
// DRAW1View.h : interface of the CDRAW1View class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DRAW1VIEW_H__32FB6238_91D9_41C1_BF34_AE38EE4701DE__INCLUDED_)
#define AFX_DRAW1VIEW_H__32FB6238_91D9_41C1_BF34_AE38EE4701DE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "book.h"
#include "MainFrm.h"

class CDRAW1View : public  CScrollView
{
private:
   int curretHandObj;         //当前手中的物品	
   int curretShape;           //当前形状
   int currectBordarScal;     //当前边框模式
   COLORREF curretColor;      //当前前景色
   COLORREF currectBkColor;   //当前背景色
   int onMore;                //是否正在选择更多前景色

   CList<CShape*,CShape*&>* objectAll;//所有对象集合(链表)
   CShape* createObject;   //正在创建的对象
   CShape* currectObject;  //当前选择的对象
   CString  currectName;   //当前选择的对象名称

   int currectState;      //激活对象所处状态(无,创建,编辑)
   bool currectFill;      //当前填充情况
 
   double currectZoom;    //当前放大或缩小模式
   CSize currectSize;     //当前窗口大小


protected: // create from serialization only
	CDRAW1View();
	DECLARE_DYNCREATE(CDRAW1View)

// Attributes
public:
	CDRAW1Doc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDRAW1View)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	virtual void OnInitialUpdate();
	virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE);
	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 Activation(CDC* pDC);
	void FindObjByName(CString objectName);
	POSITION FindThePos(CShape* shape);
	CString GiveName();
	long GiveID();
	long ShapeCount(int type);
	void SetAllObectScal();
	void DrawAllObject(CDC* pDC);
	void InitDC(CDC *pDC);
	virtual ~CDRAW1View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	void SetPageSize(CSize size);
	//{{AFX_MSG(CDRAW1View)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnImagePen();
	afx_msg void OnShapeStrLine();
	afx_msg void OnBorderScaleSmall();
	afx_msg void OnColorBlack();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnColorYellow();
	afx_msg void OnShapeRectangle();
	afx_msg void OnFillFalse();
	afx_msg void OnShapeSquare();
	afx_msg void OnUpdateImagePen(CCmdUI* pCmdUI);
	afx_msg void OnUpdateColorBlack(CCmdUI* pCmdUI);
	afx_msg void OnUpdateColorYellow(CCmdUI* pCmdUI);
	afx_msg void OnUpdateBorderScaleSmall(CCmdUI* pCmdUI);
	afx_msg void OnUpdateShapeRectangle(CCmdUI* pCmdUI);
	afx_msg void OnUpdateFillFalse(CCmdUI* pCmdUI);
	afx_msg void OnFillTrue();
	afx_msg void OnUpdateFillTrue(CCmdUI* pCmdUI);
	afx_msg void OnUpdateShapeSquare(CCmdUI* pCmdUI);
	afx_msg void OnShapeEllipse();
	afx_msg void OnUpdateShapeEllipse(CCmdUI* pCmdUI);
	afx_msg void OnShapeCircle();
	afx_msg void OnUpdateShapeCircle(CCmdUI* pCmdUI);
	afx_msg void OnBorderScaleMiddle();
	afx_msg void OnUpdateBorderScaleMiddle(CCmdUI* pCmdUI);
	afx_msg void OnBorderScaleLarge();
	afx_msg void OnUpdateBorderScaleLarge(CCmdUI* pCmdUI);
	afx_msg void OnFileSave();
	afx_msg void OnFileOpen();
	afx_msg void OnColorWhite();
	afx_msg void OnUpdateColorWhite(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 OnColorBlue();
	afx_msg void OnUpdateColorBlue(CCmdUI* pCmdUI);
	afx_msg void OnImageZoom();
	afx_msg void OnUpdateImageZoom(CCmdUI* pCmdUI);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnBkColor();
	afx_msg void OnUpdateBkColor(CCmdUI* pCmdUI);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSelchangeObjNameBox();
	afx_msg void OnObjDelete();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnObjNewname();
	afx_msg void OnUpdateShapeStrLine(CCmdUI* pCmdUI);
	afx_msg void OnColorMore();
	afx_msg void OnUpdateColorMore(CCmdUI* pCmdUI);
	afx_msg void OnObjMoveEast();
	afx_msg void OnObjMoveWest();
	afx_msg void OnObjMoveSouth();
	afx_msg void OnObjMoveNorth();
	afx_msg void OnObjAntic();
	afx_msg void OnObjDelic();
	afx_msg void OnShapeTriangle();
	afx_msg void OnUpdateShapeTriangle(CCmdUI* pCmdUI);
	afx_msg void OnObjLarge();
	afx_msg void OnObjSmall();
	afx_msg void OnObjFillHave();
	afx_msg void OnObjFillNone();
	afx_msg void OnObjSizeLarge();
	afx_msg void OnObjSizeSmall();
	afx_msg void OnObjActHave();
	afx_msg void OnObjActNone();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DRAW1View.cpp
inline CDRAW1Doc* CDRAW1View::GetDocument()
   { return (CDRAW1Doc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_DRAW1VIEW_H__32FB6238_91D9_41C1_BF34_AE38EE4701DE__INCLUDED_)

⌨️ 快捷键说明

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