www.pudn.com > jtlab.rar > Command.h
#ifndef _Command_h_
#define _Command_h_
#include "base.h"
#ifdef __cplusplus
enum ECommandType // 命令类
{
ctUnknown = 0,
// 创建对象命令类
ctCreateLine = 1, // 创建线段对象
ctCreateRectangle = 2, // 创建矩形对象
ctCreateCircle = 3, // 创建圆对象
ctCreateArc = 4, // 创建圆弧对象
ctCreateCut= 5, // 创建裁剪对象
ctCreateFill=6, // 创建面区填充对象
ctCreateBezier=7, // 创建曲线对象
// ...其他创建类型
// 修改命令类
ctMove = 11, // 移动
ctRotate = 12, // 旋转
ctMirror = 13 // 镜像
};
class CCommand
{
protected: int m_nStep ; // 命令操作步
public:
CCommand() {}
~CCommand() {}
virtual int GetType() = 0; // 返回命令类型 ECommandType
virtual int OnLButtonDown(UINT nFlags, const Position& pos) = 0 ;
virtual int OnMouseMove(UINT nFlags, const Position& pos) = 0 ;
virtual int OnRButtonDown(UINT nFlags, const Position& pos) = 0 ;
virtual int Cancel() = 0 ;
} ;
#endif
#endif