www.pudn.com > GandyDraw_MFC.rar > GandyDrawView.h, change:2006-11-17,size:7967b


// GandyDrawView.h : CGandyDrawView 类的接口 
// 
 
 
#pragma once 
#include "atltypes.h" 
#include "afxwin.h" 
 
 
class CGandyDrawView : public CView 
{ 
protected: // 仅从序列化创建 
	CGandyDrawView(); 
	DECLARE_DYNCREATE(CGandyDrawView) 
 
// 属性 
public: 
	CGandyDrawDoc* GetDocument() const; 
 
// 操作 
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 ~CGandyDrawView(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// 生成的消息映射函数 
protected: 
	DECLARE_MESSAGE_MAP() 
public: 
	bool m_bTBar; 
public: 
	afx_msg void OnViewDsTbar(); 
public: 
	afx_msg void OnUpdateViewDsTbar(CCmdUI *pCmdUI); 
public: 
	// 标识当前鼠标是否在绘图过程中 
	bool m_bDoing; 
public: 
	// 画笔颜色PEN 
	COLORREF m_PenColor; 
public: 
	// 窗口横坐标最大值 
	int m_iMaxX; 
public: 
	// 窗口纵坐标最大值 
	int m_iMaxY; 
public: 
	// 当前画笔宽度 
	int m_iWidth; 
public: 
	// 位图GDI对象 
	CBitmap *m_pBmp; 
public: 
	// 存于内存中的设备环境变量 
	CDC *m_pMDC; 
public: 
	// 光标原位置 
	CPoint m_PointOld; 
public: 
	// 光标新位置 
	CPoint m_PointNew; 
public: 
	// 当前选择绘图类型 直线 折线 多边形等 
	int m_DrawType; 
public: 
	// 画笔风格  实线 虚线 点线等等 
	int m_iPenStyle; 
public: 
	// 刷子颜色 
	COLORREF m_BrushColor; 
public: 
	// 画刷的条纹风格  水平线 垂直线 之类 
	int m_iHatchStyle; 
public: 
	// 刷子的风格 空心 实心  条纹 图像 刷 ? 
	int m_iBrushStyle; 
public: 
	afx_msg void OnLine(); 
public: 
	afx_msg void OnPolyline(); 
public: 
	afx_msg void OnRect(); 
public: 
	afx_msg void OnEllirect(); 
public: 
	afx_msg void OnEllipse(); 
public: 
	afx_msg void OnPolygon(); 
public: 
	afx_msg void OnTextdraw(); 
public: 
	afx_msg void OnSolid(); 
public: 
	afx_msg void OnDash(); 
public: 
	afx_msg void OnDot(); 
public: 
	afx_msg void OnDashdot(); 
public: 
	afx_msg void OnDashdotdot(); 
public: 
	afx_msg void OnSetwidth1(); 
public: 
	afx_msg void OnSetwidth2(); 
public: 
	afx_msg void OnSetwidth3(); 
public: 
	afx_msg void OnSetwidth4(); 
public: 
	afx_msg void OnSetwidth8(); 
public: 
	afx_msg void OnSetwidth10(); 
public: 
	afx_msg void OnSetwidth20(); 
public: 
	afx_msg void OnSetwidth50(); 
public: 
	afx_msg void OnBruHollow(); 
public: 
	afx_msg void OnBruSolid(); 
public: 
	afx_msg void OnFillwithpicture(); 
public: 
	afx_msg void OnStrHor(); 
public: 
	afx_msg void OnStrVer(); 
public: 
	afx_msg void OnStrBia(); 
public: 
	afx_msg void OnStrBla(); 
public: 
	afx_msg void OnStrCro(); 
public: 
	afx_msg void OnStrCcro(); 
public: 
	afx_msg void OnPencolor(); 
public: 
	afx_msg void OnBruColor(); 
public: 
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); 
public: 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
public: 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
public: 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
public: 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
public: 
	CPoint arrayP[255]; 
public: 
	// //画折线与多边形时用来对顶点计数 
	int m_iPCount; 
public: 
	CPoint m_PointLast_PL; 
public: 
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point); 
public: 
	// 用来记录多边形的第一个点,以最后连接时使用。。 
	CPoint m_PointFirst_PL; 
public: 
	// 折线时 确定是否已按下左键 以防止没按左键时按右键自动画图  
	bool m_bClick; 
public: 
	// 保存位图。。 
	CBitmap m_Bitmap; 
public: 
	afx_msg void OnSetfont(); 
public: 
	afx_msg void OnTestrotation(); 
public: 
	afx_msg void OnSetfontcolor(); 
public: 
	// 逻辑字体结构 
	LOGFONT logFont; 
public: 
	// 文本前景色 
	COLORREF textColor; 
public: 
	// 文本背景颜色 
	COLORREF textBkColor; 
public: 
	// 字体名称 
	CString fontName; 
public: 
	// 字体大小 
	int fontSize; 
public: 
	BOOL italic; 
public: 
	BOOL bold; 
public: 
	// 下划线 
	BOOL underline; 
public: 
	BOOL strikeOut; 
public: 
	// 将字体大小fontSize转换为中文字号sFontNum的自定义函数 
	CString GetFontNumber(int size); 
public: 
	CFont font; 
public: 
	BOOL SetFont(CDC * pDC, LPCTSTR faceName, int size, COLORREF col, int angle, bool italic, bool bold, bool underline, bool strikeOut); 
public: 
	afx_msg void OnClearall(); 
public: 
	// 用来计算状态栏的dx dy 的变量 
	CPoint m_PointLast_StatusBar; 
public: 
	afx_msg void OnInputstr(); 
public: 
	CString m_strText; 
public: 
	afx_msg void OnOutputstr(); 
public: 
	afx_msg void OnSetfontbkcolor(); 
public: 
	afx_msg void OnOutputfontsize(); 
public: 
	afx_msg void OnDrawoembmp(); 
public: 
	afx_msg void OnOpenbmp(); 
public: 
	// (打开)位图文件变量 
	CBitmap m_FileBitmap; 
public: 
	bool m_bBitmapLoaded; 
public: 
	// 位图显示 拉伸模式(缺省为BLACKONWHITE) 
	int m_iStretchBltMode; 
public: 
	afx_msg void OnBlackonwhite(); 
public: 
	afx_msg void OnWhiteonblack(); 
public: 
	afx_msg void OnColoroncolor(); 
public: 
	afx_msg void OnHalftone(); 
public: 
	afx_msg void OnDispstrbmp(); 
public: 
	bool m_bIsStretchBlt; 
public: 
	BITMAP bs; 
public: 
	CDC dc; 
public: 
	afx_msg void OnDispvirbmp(); 
public: 
	afx_msg void OnStrfillclient(); 
public: 
	afx_msg void OnStrkeeprate(); 
public: 
	bool m_bIsKeepingRate; 
public: 
	afx_msg void OnUpdateStrkeeprate(CCmdUI *pCmdUI); 
public: 
	bool m_bIsOpeningBmp; 
public: 
	afx_msg void OnUpdateDispvirbmp(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateDispstrbmp(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrfillclient(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateBlackonwhite(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateWhiteonblack(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateColoroncolor(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateHalftone(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnSetwidth(); 
public: 
	afx_msg void OnJavaduke(); 
public: 
	afx_msg void OnChangebmp(); 
public: 
	afx_msg void OnDrawset(); 
public: 
	CString m_BmpPathName; 
public: 
	afx_msg void OnUpdateLine(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateEllipse(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateEllirect(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdatePolygon(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateRect(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdatePolyline(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateTextdraw(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateDash(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateDot(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateDashdot(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateDashdotdot(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSolid(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateBruHollow(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateBruSolid(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateFillwithpicture(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrBia(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrBla(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrCcro(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrCro(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrHor(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateStrVer(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth1(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth10(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth2(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth20(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth3(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth4(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth50(CCmdUI *pCmdUI); 
public: 
	afx_msg void OnUpdateSetwidth8(CCmdUI *pCmdUI); 
}; 
 
#ifndef _DEBUG  // GandyDrawView.cpp 中的调试版本 
inline CGandyDrawDoc* CGandyDrawView::GetDocument() const 
   { return reinterpret_cast<CGandyDrawDoc*>(m_pDocument); } 
#endif