drawtool.h
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:7k
- #ifndef __DRAWTOOL_H__
- #define __DRAWTOOL_H__
- #include "drawobj.h"
- class CProjView;
- enum DrawShape
- {
- selection,
- line,
- rect,
- ellipse,
- poly,
- text,
- barGraph,
- clockGraph,
- animateTag,
- cursor,
- isa,
- loop,
- custom,
- button
- };
- class CDrawTool
- {
- // Constructors
- public:
- CDrawTool(DrawShape nDrawShape);
- // Overridables
- virtual void OnChar(CProjView* pView,UINT nFlags,UINT nChar);
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- //virtual void OnRButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnEditProperties(CProjView* pView);
- virtual void OnCancel(CProjView* pView);
- // 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();
- public:
- public:
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnEditProperties(CProjView* pView);
- };
- class CRectTool : public CDrawTool
- {
- // Constructors
- public:
- CRectTool(DrawShape drawShape);
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- class CPolyTool : public CDrawTool
- {
- // Constructors
- public:
- CPolyTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnCancel(CProjView* pView);
- CDrawPoly* m_pDrawObj;
- };
- ////////////////////////////////////////////////////////////////////////////
- class CTextTool : public CDrawTool
- {
- // Constructors
- public:
- CTextTool();
- // Implementation
- virtual void OnChar(CProjView* pView,UINT nFlags,UINT nChar);
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- //virtual void OnRButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- // virtual void OnEditPropeties(CProjView* pView);
- virtual void OnCancel(CProjView* pView);
-
- CDrawText* m_pDrawText;
- };
- ////////////////////////////////////////////////////////////////////////////
- class CBarTool : public CDrawTool
- {
- // Constructors
- public:
- CBarTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- //////////////////////////////////////////////////////
- /// CLineTool
- class CLineTool : public CDrawTool
- {
- // Constructors
- public:
- CLineTool(DrawShape drawShape);
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- //////////////////////////////////////////////////////
- /// CCustomTool
- class CCustomTool : public CDrawTool
- {
- // Constructors
- public:
- CCustomTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- ///////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////
- class CEllipseTool : public CDrawTool
- {
- // Constructors
- public:
- CEllipseTool(DrawShape drawShape);
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- /*class CClockTool : public CDrawTool
- {
- // Constructors
- public:
- CClockTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- */
- ////////////////////////////////////////////////////////////////////////////
- class CAnimateTagTool : public CTextTool
- {
- // Constructors
- public:
- CAnimateTagTool();
- // Implementation
- virtual void OnChar(CProjView* pView,UINT nFlags,UINT nChar);
- void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- class CCursorTool : public CDrawTool
- {
- // Constructors
- public:
- CCursorTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- class CISATool : public CAnimateTagTool
- {
- // Constructors
- public:
- CISATool();
- void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- /////////////////////////////////////////////
- /// CLoopTool Class Definition
- class CLoopTool : public CDrawTool
- {
- // Constructors
- public:
- CLoopTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- //CDrawObj* g_pOutRect = NULL;
- class CButtonTool : public CDrawTool
- {
- // Constructors
- public:
- CButtonTool();
- // Implementation
- virtual void OnLButtonDown(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonDblClk(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnLButtonUp(CProjView* pView, UINT nFlags, const CPoint& point);
- virtual void OnMouseMove(CProjView* pView, UINT nFlags, const CPoint& point);
- };
- #endif // __DRAWTOOL_H__