Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MyCommand.h
Package: MiniCAD_ALL.zip [view]
Upload User: netltd
Upload Date: 2013-02-12
Package Size: 7234k
Code Size: 1k
Category:
Graph Drawing
Development Platform:
Visual C++
- #include <afxtempl.h>
- /////////////////////////////////////////////////////////////////////////////////////////////
- class CCommandStruct: public CObject
- {
- public:
- int m_command; //操作命令ID号
- int m_num; //操作命令操作的对象数目
- int* m_object; //图形对象代号,操作命令无对象时为NULL
- int* m_index; //图形对象在其数列中的序号
- public:
- CCommandStruct(int command, int num, int* object, int* index);
- ~CCommandStruct();
- };
- /////////////////////////////////////////////////////////////////////////////////////////////
- //命令类,用于分析绘图、修改命令,并且存储所有发生的命令,以便Undo,Redo命令使用
- //命令类只涉及到绘图、修改命令的实现步骤,不能与图形对象类的数据结构相关。
- class CCommandStack: public CObject
- {
- public:
- DECLARE_DYNCREATE(CCommandStack)
- //用于储存命令列表类指针
- CObArray m_CommandArray;
- //用于存储图形对象发生改变后先前的信息
- CArray<float, float> m_SavedProportion;
- CArray<CPoint, CPoint> m_SavedPosition;
- CArray<int, int> m_SavedLineStyle;
- CArray<int, int> m_SavedColor;
- private:
- int CommandPointer; //命令指针
- public:
- CCommandStack();
- //增加命令
- void PushCommand(int command, int num, int* object, int* index);
- CCommandStruct* Undo();
- CCommandStruct* Redo();
- BOOL CanUndo();
- BOOL CanRedo();
- private:
- //删除序号从index之后的命令
- void DelCommandFrom(int index);
- public:
- ~CCommandStack();
- };