Tool.h
资源名称:CAD.zip [点击查看]
上传用户:hehe2haha
上传日期:2013-08-16
资源大小:161k
文件大小:1k
源码类别:
CAD
开发平台:
Visual C++
- // Tool.h: interface for the CTool class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TOOL_H__2293E5B7_9DAB_4A65_9656_FB03EBAC255E__INCLUDED_)
- #define AFX_TOOL_H__2293E5B7_9DAB_4A65_9656_FB03EBAC255E__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "resource.h"
- #include "Shape.h"
- enum tagToolState
- {Init_State,FirstHit,SecondHit};
- class CTool
- {
- public:
- POINT m_ptBeginPos; // 始点
- POINT m_ptPrePos; // 终点
- protected:
- tagToolState m_eToolState; //鼠标状态标记
- public:
- CTool();
- virtual ~CTool();
- public:
- virtual void OnMouseMove(HWND hWnd, UINT nFlags, POINT ptPos) { }
- virtual void OnRButtonDown(HWND hWnd,UINT nFlags, POINT ptPos) {OverCurTool(hWnd);}
- virtual void OnLButtonDown(HWND hWnd,UINT nFlags, POINT ptPos) { }
- void OverCurTool(HWND hWnd)
- {
- //发送一个鼠标无状态消息
- ::PostMessage(hWnd,WM_COMMAND,OVER_CUR_TOOL,0);
- }
- };
- #endif // !defined(AFX_TOOL_H__2293E5B7_9DAB_4A65_9656_FB03EBAC255E__INCLUDED_)