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

📄 visdrawview.h

📁 参数化车间设备资源绘制程序
💻 H
字号:
// VisDrawView.h : CVisDrawView 类的接口
//


#pragma once
#include "atltypes.h"
//#include  "rectobj.h"
#include "VisDrawScrollView.h"
#include "visdrawdoc.h"
#include "GongXu.h"

class COLEContainItem;

#define HINT_UPDATE_WINDOW      0
#define HINT_UPDATE_DRAWOBJ     1
#define HINT_UPDATE_SELECTION   2
#define HINT_DELETE_SELECTION   3
#define HINT_UPDATE_OLE_ITEMS   4


//#include "VisDrawScrollView.h"
//#include "visdrawdoc.h"

#define ZOOM_ONE 1000

//#define HINT_UPDATE_DRAWOBJ  
//const int FIG_MAX=1000;

class CVisDrawView: public CVisDrawScrollView

{
protected: // 仅从序列化创建
	CVisDrawView();
	DECLARE_DYNCREATE(CVisDrawView)
   // DECLARE_HINT_UPDATE_DRAWOBJ

// 属性
public:
	CVisDrawDoc* GetDocument() const;
	//CRectObj* pObj;
	COLEContainItem* m_pSelection;
		//鼠标句柄
	HCURSOR m_HCursor;

protected:
	CSize m_sizeDoc; //文档尺寸
	
	long m_x0,m_y0;  // 文档原点

	//CPoint m_Offset;
	long m_Scale;

	long m_xo,m_yo;

    void  OnZoom(long Zoom);
	long m_Zoom,m_ZoomMin, m_ZoomMax;
    long scale;

	BOOL m_bGrid;
	COLORREF m_gridColor;
	int m_GridDistance;

   

	BOOL m_bActive; // is the view active?

	int m_nMapMode;
	double m_nPageWidth;
	double m_nPageHeight;
	CGongXu gongxu;
	CGongBu gongbu;

	CString m_strDrawing;

public:

	//被选择对象链表
	CFigureObjList m_selection;
	CTextObjList m_select;
	CMoObjList m_moselect;
   // CXiObjList m_xiselect;
	

    
// 操作
public:
	//void ClientToDoc(CPoint& point);

	//逻辑坐标转化为世界坐标
	void ClientToWorld(CPoint npoint, double& pointx, double& pointy);
	//世界坐标转化为逻辑坐标
	void WorldToClient(CPoint& npoint, double pointx, double pointy);

	//逻辑长度转化为世界长度
	double ClientToWorld(double distance);
    //世界长度转化为逻辑长度
	double WorldToClient(double distance);

	void DrawGrid(CDC* pDC);

    void Select(CFigureObj* pObj, BOOL bAdd = FALSE);
	void SelectWithinRect(CRect rect, BOOL bAdd = FALSE);
	void Deselect(CFigureObj* pObj);

	void InvalObj(CFigureObj* pObj);
	BOOL IsSelected(const CObject* pDocItem) const;

	void PrintHeader( CDC* pDC, CPrintInfo* pInfo);
	void PrintFooter( CDC* pDC, CPrintInfo* pInfo);
	//void StringText();
	




// 重写

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

	static CLIPFORMAT m_cfDraw; // 自定义剪切板格式

	void PasteNative(COleDataObject& dataObject);


protected:
	

// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
public:
	
//	afx_msg void OnDrawEllipse();
	//int RandomCoord(void);
	//void RandomRect(CRect* pRect);
	//CRect m_position;
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo= NULL);
    virtual void OnInitialUpdate();
public:
	afx_msg void OnDrawLine();
	afx_msg void OnDrawRectangle();
	afx_msg void OnDrawCircle();
	afx_msg void OnDrawHorizen();
	afx_msg void OnDrawPoint();
	afx_msg void OnDrawPolygon();
	afx_msg void OnDrawPolyline();
	afx_msg void OnDrawSec();
	afx_msg void OnDrawSelection();
	afx_msg void OnDrawTripoint();
	afx_msg void OnDrawVertical();
	afx_msg void OnUpdateDrawTripoint(CCmdUI *pCmdUI);
	afx_msg void OnZoomIn();
	afx_msg void OnZoomOut();
	afx_msg void OnZoomFit();
	afx_msg void OnZoomWindow();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnDrawCse();

	
protected:

	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);

//COLORREF GetPaperColor() const { return m_cuurentColor; }
protected:
	virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);
	//属性

	int m_deletepic;
    BOOL m_RedoUndo;
	BOOL m_bEnable;
	//int m_LMouseDownStep;
	
	//CPoint prePoint,lastPoint;
	//CRect rect;
	//鼠标句柄
	//HCURSOR m_HCursor;

	//图形工具类型
	//enum Shape{rectangle,ellipse,line};
	
	//当前绘制的图形类型
  // Shape m_nShape;

	//struct FigureObj
	//{
		//图形包围矩形
   //CRect m_position;
//图形类型
  // Shape m_nShapeType;
//	};




//当前绘制的图形结构
//FigureObj m_nShapeTemp;
//图形结构数组
//FigureObj m_arShps[FIG_MAX];
//已经绘制图形的个数
//int m_countShapes;
	
public:
	//void OnInitialUpdate(void);
	afx_msg void OnEditCopy();
	afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI);
	afx_msg void OnEditCut();
	afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI);
	afx_msg void OnEditPaste();
	afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI);
	afx_msg void OnEditDelete();
	afx_msg void OnUpdateEditDelete(CCmdUI *pCmdUI);
	afx_msg void OnEditSelectall();
	afx_msg void OnUpdateEditSelectall(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawLine(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawPoint(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawSec(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawCse(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawPolyline(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawRectangle(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawCircle(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawPolygon(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawHorizen(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawVertical(CCmdUI *pCmdUI);
	afx_msg void OnUpdateDrawSelection(CCmdUI *pCmdUI);
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);

protected:
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
public:
	//afx_msg void OnChe();
	//afx_msg void OnUpdateChe(CCmdUI *pCmdUI);
	int m_picID;int m_picIDbao;int m_picIDxi;
	//CString m_picPath;
	//int m_type;
	//CPoint ps;
	//afx_msg void OnChe();
	//afx_msg void OnOpenBmp();
	afx_msg void OnBao();
	//afx_msg void OnChe();
	afx_msg void OnChong();
	afx_msg void OnJu();
	afx_msg void OnMo();
	afx_msg void OnTang();
	afx_msg void OnZuan();
	afx_msg void OnZhongxin();
	afx_msg void OnZhewan();
	afx_msg void OnXi();
	//void DrawBmp1(CDC* pDC, int x, int y, int wide, int high, UINT idCBitmap, int DrawMode);
	//void DrawBmp1(void);
	//void DrawImage(CDC* pDC);
	// 初始坐标
	//CPoint m_pOrigin;
	// 旧坐标,用于重绘
	//CPoint m_pOld;
	
	//afx_msg void OnXuanze();
	afx_msg void OnDrawChe();
	//afx_msg void OnUpdateChe(CCmdUI *pCmdUI);
	afx_msg void OnDrawText();
	afx_msg void OnUpdateDrawText(CCmdUI *pCmdUI);
	//afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	//afx_msg void OnTimer(UINT nIDEvent);
	//afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//static void PASCAL SetCaretPos( POINT point );//移动插入符号
	CDC* m_pmdc;
	BOOL m_bdoing;
	CBitmap* m_pbmp;
	int m_type;

	
	
/*
	protected:
		TextWriteDlg* pTextDlg;
		float m_FontHeight,m_FontWide,m_FontBetween,m_TextAngle,m_FontAngle;
		float m_TextX,m_TextY;
		CString m_TextString;
		CText* m_Text1;
		*/

	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnToolviewer();
	afx_msg void OnUpdateDrawChe(CCmdUI *pCmdUI);
	afx_msg void OnUpdateBao(CCmdUI *pCmdUI);
	
	afx_msg void OnUpdateXi(CCmdUI *pCmdUI);
	int m_pID,m_picIDmo,m_picIDtang,m_picIDzuan,m_picIDchong,m_picIDju,m_picIDjia,m_picIDzhe;
	afx_msg void OnUpdateMo(CCmdUI *pCmdUI);
	afx_msg void OnUpdateChong(CCmdUI *pCmdUI);
	afx_msg void OnUpdateTang(CCmdUI *pCmdUI);
	afx_msg void OnUpdateZhewan(CCmdUI *pCmdUI);
	afx_msg void OnUpdateZhongxin(CCmdUI *pCmdUI);
	afx_msg void OnUpdateZuan(CCmdUI *pCmdUI);
	afx_msg void OnUpdateJu(CCmdUI *pCmdUI);
	/*virtual void OnEditProperties(void);*/
	afx_msg void OnEditProperties();
	afx_msg void OnUpdateEditProperties(CCmdUI *pCmdUI);
	//afx_msg void OnStnEnablePicturebox();
public:
//	afx_msg void OnGongyiguochengka();
public:
//	afx_msg void OnGoyiguihua();
public:
	//afx_msg void OnZhishiku();
public:
	//afx_msg void OnBnClickedButtonGbsc();
public:
	afx_msg void OnBnClickedButtonGbsc1();
	CString strWZGB1;
public:
	afx_msg void OnBnClickedButton1();
public:
	afx_msg void OnGridEdit();
public:
//	afx_msg void OnBackColor();
		int m_mouseStep;
public:
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	CTextObj* pTextObj;
public:
	afx_msg void OnBnClickedButtonLanguage();

public:
	afx_msg void OnBnClickedButtonGxsc();
public:
	afx_msg void OnDlg4();
public:
	afx_msg void OnBnClickedButtonGsjs();
public:
	//afx_msg void OnBnClickedProcessShow();
public:
	afx_msg void OnBnClickedButtonAddgongxu();

public:
	afx_msg void OnBnClickedButtonGbwc();
public:
	//afx_msg void OnBnClickedButtonSbnl();
public:
	//afx_msg void OnBnClickedButtonSbnlpz();
public:
	afx_msg void OnGongxuka();

public:
	afx_msg void OnEditUndo();
public:
	afx_msg void OnEditRedo();
public:
	afx_msg void OnUpdateEditUndo(CCmdUI *pCmdUI);
public:
	afx_msg void OnUpdateEditRedo(CCmdUI *pCmdUI);
public:
//	afx_msg void OnBackColor();
};



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

⌨️ 快捷键说明

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