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.cpp
Package: MiniCAD_ALL.zip [view]
Upload User: netltd
Upload Date: 2013-02-12
Package Size: 7234k
Code Size: 2k
Category:
Graph Drawing
Development Platform:
Visual C++
- #include "stdafx.h"
- #include "MyDefine.h"
- #include "MyCommand.h"
- //////////////////////////////////////////////////////////////////////////////////////////////
- CMyCommandStruct::CMyCommandStruct(int command, int num, int* object, int* index)
- {
- int i;
- m_command = command;
- m_num = num;
- m_object = new int[m_num];
- m_index = new int[m_num];
- for(i=0; i<m_num; i++)
- {
- m_object[i] = object[i];
- m_index[i] = index[i];
- }
- }
- CMyCommandStruct::~CMyCommandStruct()
- {
- delete m_object;
- delete m_index;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////
- IMPLEMENT_DYNCREATE(CMyCommand, CObject)
- CMyCommand::CMyCommand()
- {
- CommandPointer = -1; //命令指针
- ProportionPointer = -1;
- PositionPointer = -1;
- LineStylePointer = -1;
- ColorPointer = -1;
- }
- CMyCommand::~CMyCommand()
- {
- int index = m_CommandArray.GetSize();
- while(index--)
- delete (CMyCommandStruct*)m_CommandArray.GetAt(index);
- m_CommandArray.RemoveAll();
- }
- void CMyCommand::AddCommand(int command, int num, int* object, int* index)
- {
- CMyCommandStruct* pCommand;
- pCommand = new CMyCommandStruct(command, num, object, index);
- m_CommandArray.Add(pCommand);
- }
- CMyCommandStruct* CMyCommand::GetCommandAt(int index)
- {
- CMyCommandStruct* pCommand;
- pCommand = (CMyCommandStruct*)m_CommandArray.GetAt(index);
- return pCommand;
- }
- void CMyCommand::DelCommandFrom(int index)
- {
- while(index < m_CommandArray.GetSize())
- {
- delete (CMyCommandStruct*)m_CommandArray.GetAt(index);
- m_CommandArray.RemoveAt(index);
- }
- }