www.pudn.com > my2cadtest07261930.rar > Tool.h, change:2006-07-25,size:1374b


 
 
#ifndef _tool_ 
#define _tool_ 
 
#include <windows.h> 
#include "CSuperPoint\\SuperPoint.h" 
#include "Shape.h" 
#include "list.h" 
 
#include "SetPenAttr.h"          //划笔划刷管理类 
extern CSetPenAttr  *penattrib; 
 
class CTool   
{ 
public:  
	enum STATUS {NoClick,FirstClick,SecClick,ThirdClick}; 
 
public: 
	CTool(HWND hWnd); 
	virtual ~CTool(); 
 
public: 
    virtual void OnLButtonDown(WPARAM wParam,LPARAM lParam); 
	virtual void OnMouseMove(WPARAM wParam,LPARAM lParam); 
    virtual void OnRButtonDown(WPARAM wParam,LPARAM lParam);    //如有图形绘制需要右键点击 派生类重写之 
     
 
    virtual void OnLButtonUp(WPARAM wParam,LPARAM lParam){};  //左键弹起消息(7.20) 
	virtual void RollBackOper(HDC &hdc);   //右键回滚操作(7.20) 
 
	virtual void PreDraw(){};        //鼠标移动时调用此方法绘制动态图形 
    virtual void Draw(){};          //图形绘制好后 用标准划笔将图形再划一次	 
	virtual void SaveSelf(){};       //图形完成绘制的最后一次点击时同时调用此方法生成图形类将图形信息保存进去 
 
	virtual void SetNumPoly(int num){}; //为正多边形设置边数欲留接口(7.19) 
     
    int GetStatus(){return m_status;}; 
protected: 
   CSuperPoint m_begPT; 
   CSuperPoint m_endPT; 
   CSuperPoint m_oldPT; 
   STATUS m_status; 
   HWND m_hWnd; 
   HDC m_hdc; 
     
   CList<CShape *> m_catchShapeList;  //将已经选取的图形拷贝集中放一张新链表中 
  
}; 
 
#endif