drawtool.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:3k
- // drawtool.h - interface for CDrawTool and derivatives
- //
- // This file is a part of the XTREME TOOLKIT PRO MFC class library.
- // (c)1998-2008 Codejock Software, All Rights Reserved.
- //
- // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
- // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
- // CONSENT OF CODEJOCK SOFTWARE.
- //
- // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
- // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
- // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
- // SINGLE COMPUTER.
- //
- // CONTACT INFORMATION:
- // support@codejock.com
- // http://www.codejock.com
- //
- /////////////////////////////////////////////////////////////////////////////
- #ifndef __DRAWTOOL_H__
- #define __DRAWTOOL_H__
- #include "drawobj.h"
- class CDrawView;
- enum DrawShape
- {
- selection,
- line,
- rect,
- roundRect,
- ellipse,
- poly
- };
- class CDrawTool
- {
- // Constructors
- public:
- CDrawTool(DrawShape nDrawShape);
- // Overridables
- virtual void OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnEditProperties(CDrawView* pView);
- virtual void OnCancel();
- // Attributes
- DrawShape m_drawShape;
- static CDrawTool* FindTool(DrawShape drawShape);
- static CPtrList c_tools;
- static CPoint c_down;
- static UINT c_nDownFlags;
- static CPoint c_last;
- static DrawShape c_drawShape;
- };
- class CSelectTool : public CDrawTool
- {
- // Constructors
- public:
- CSelectTool();
- // Implementation
- virtual void OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnEditProperties(CDrawView* pView);
- };
- class CRectTool : public CDrawTool
- {
- // Constructors
- public:
- CRectTool(DrawShape drawShape);
- // Implementation
- virtual void OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CDrawView* pView, UINT nFlags, const CPoint& point);
- };
- class CPolyTool : public CDrawTool
- {
- // Constructors
- public:
- CPolyTool();
- // Implementation
- virtual void OnLButtonDown(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CDrawView* pView, UINT nFlags, const CPoint& point);
- virtual void OnCancel();
- CDrawPoly* m_pDrawObj;
- };
- ////////////////////////////////////////////////////////////////////////////
- #endif // __DRAWTOOL_H__