-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmydrawShape.h
executable file
·70 lines (58 loc) · 1.72 KB
/
mydrawShape.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
// CmydrawShape ÃüÁîÄ¿±ê
#include <list>
class CmydrawShape : public CObject
{
public:
CmydrawShape();
virtual ~CmydrawShape();
public:
CRect m_position;
CRect o_position;
bool m_brush;
bool selection;
bool normal;
virtual void Draw(CDC* pDC);
CmydrawShape(const CRect& position);
enum Shape {line , rectangle, ellipse,polygon};
Shape m_nShape;
void DrawTracker(CDC* pDC);
virtual int GetHandleCount();
virtual CPoint GetHandle(int nHandle);
virtual HCURSOR GetHandleCursor(int nHandle);
virtual CRect GetHandleRect(int nHandleID);
virtual int HitTest(CPoint point,BOOL bSelected);
virtual void moveshape(CPoint point);
virtual void MoveHandle(int nHandle,CPoint point);
virtual void Implement();
virtual void ChangeRectPro();
long chg(long length);
};
typedef std::list<CmydrawShape*> ShapeList;
typedef ShapeList::iterator ShpIt;
//////////////////////////////////////////////////////////////////////////////////////////////////////////
class CmydrawPoly : public CmydrawShape
{
public:
CmydrawPoly();
virtual ~CmydrawPoly();
CmydrawPoly(const CRect& position);
void AddPoint(const CPoint& point);
BOOL RecalcBounds();
public:
virtual void Draw(CDC* pDC);
virtual void moveshape(CPoint point);
virtual int GetHandleCount();
virtual CPoint GetHandle(int nHandle);
virtual HCURSOR GetHandleCursor(int nHandle);
virtual void MoveHandle(int nHandle, CPoint point);
virtual int HitTest(CPoint point,BOOL bSelected);
virtual void Implement();
int m_nPoints;
//virtual BOOL Intersects(const CRect& rect);
//virtual CDrawObj* Clone(CDrawDoc* pDoc);
protected:
CPoint* m_points;
int m_nAllocPoints;
CmydrawPoly* m_pDrawObj;
};