資源簡介
本資源包括vc++6.0開發(fā)的流程圖編輯器的工程文件,該流程圖編輯器包含流程圖的基本圖元的編輯功能(添加,移動,修改,雙擊添加內(nèi)容等),路徑識別,流程圖保存和讀取,流程圖生成圖片功能等等。。。。
代碼片段和文件信息
//?Arrowhead.cpp:?implementation?of?the?CArrowhead?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“DrawFlowChart.h“
#include?“Arrowhead.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CArrowhead?Cobject?1)
CArrowhead::CArrowhead()
{
m_AdjustPoint?=?-1;
CConnectPoint?*temp?=?NULL;?
for(int?i?=?0;?i?2;?i++)
{
temp?=?new?CConnectPoint();
m_Points.Add(temp);
}
}
CArrowhead::~CArrowhead()
{
}
void?CArrowhead::Draw(?CDC?*pdc?)
{
AdjustFocusPoint();
CPen?p?*pOldPen;?????
if(m_IsMark)
{
????????p.CreatePen(PS_SOLID1RGB(25500));?????//初始化畫筆(紅色)?
????????pOldPen=pdc->?Selectobject(&p);?????//把畫筆選入DC,并保存原來畫筆
}
pdc->MoveTo(m_Start);
pdc->LineTo(m_End);
if(m_IsMark)
{
pdc->Selectobject(pOldPen);
}
DrawArrow(pdc);
}
void?CArrowhead::DrawFocus(?CDC?*pdc?)
{
CConnectPoint?*temp?=?NULL;
for(int?i?=?0;?i? {
????temp?=?(CConnectPoint?*)m_Points.GetAt(i);
temp->Draw(pdc);
}
}
void?CArrowhead::Move(?int?cx?int?cy?)
{
m_Start?+=??CPoint(cx?cy);
m_End?+=??CPoint(cx?cy);
}
void?CArrowhead::AdjustSize(?CPoint?&pt?)
{
switch(m_AdjustPoint)
{
case?1:?//?起點
{
m_Start?=?pt;
break;
}
case?2:?//?終點
{
m_End?=?pt;
break;
}
}
}
void?CArrowhead::SetPreviousGraph(CGraph?*previousGraph)
{
CConnectPoint?*p?=?(CConnectPoint*)m_Points.GetAt(0);???????????????????????????????????????????????????????
if(previousGraph->IsOn(p))
{
m_Previous?=?previousGraph;
}
else?if(m_Previous?==?previousGraph)
{
m_Previous?=?NULL;
}
}
void?CArrowhead::SetNextgraph(CGraph?*nextGraph)
{
CConnectPoint?*p?=?(CConnectPoint*)m_Points.GetAt(1);???????????????????????????????????????????????????????
if(nextGraph->IsOn(p))
{
m_Next?=?nextGraph;
}
else?if(m_Next?==?nextGraph)
{
m_Next?=?NULL;
}
}
CGraph*?CArrowhead::GetPreviousGraph()
{return?m_Next;
//return?m_Previous;
}
CGraph*?CArrowhead::GetNextgraph()
{return?m_Previous;
//return?m_Next;
}
bool?CArrowhead::IsEditable()
{
return?false;
}
bool?CArrowhead::IsControlFlow()
{
return?true;
}
bool?CArrowhead::IsIn(?CPoint?&pt?)
{
bool?flag?=?false;
CPoint?points[4];
int?tempx?=?0;
int?tempy?=?0;
if(abs(m_End.x?-?m_Start.x)?>?abs(m_End.y?-?m_Start.y))
{
tempy?=?6;
}
else
{
tempx?=?6;
}
CPoint?temp?=?CPoint(tempx?tempy);
points[0]?=?m_Start?-?temp;
points[1]?=?m_Start?+?temp;
points[2]?=?m_End?+?temp;
points[3]?=?m_End?-?temp;
CRgn?cr;
cr.CreatePolygonRgn(points?4?ALTERNATE);
if(cr.PtInRegion(?pt?))
{
flag?=?true;
m_AdjustPoint?=?-1;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5502??2011-01-06?16:41??DrawFlowChart?v1.1\Arrowhead.cpp
?????文件???????1278??2011-01-06?16:31??DrawFlowChart?v1.1\Arrowhead.h
?????文件???????1493??2011-01-05?18:49??DrawFlowChart?v1.1\ConnectPoint.cpp
?????文件????????806??2011-01-05?18:49??DrawFlowChart?v1.1\ConnectPoint.h
?????文件???????6916??2011-01-06?15:36??DrawFlowChart?v1.1\ControlFlow.cpp
?????文件???????1411??2011-01-06?15:37??DrawFlowChart?v1.1\ControlFlow.h
?????文件???????5617??2011-01-05?20:03??DrawFlowChart?v1.1\DealDiamond.cpp
?????文件???????1033??2011-01-06?15:37??DrawFlowChart?v1.1\DealDiamond.h
?????文件???????5154??2011-01-05?20:03??DrawFlowChart?v1.1\Diamond.cpp
?????文件????????995??2011-01-06?15:37??DrawFlowChart?v1.1\Diamond.h
?????文件??????47888??2011-01-06?19:33??DrawFlowChart?v1.1\DrawFlowChart.aps
?????文件???????3097??2011-01-06?20:41??DrawFlowChart?v1.1\DrawFlowChart.clw
?????文件???????4335??2010-11-07?21:13??DrawFlowChart?v1.1\DrawFlowChart.cpp
?????文件???????6637??2011-01-03?14:29??DrawFlowChart?v1.1\DrawFlowChart.dsp
?????文件????????534??2010-11-07?21:13??DrawFlowChart?v1.1\DrawFlowChart.dsw
?????文件???????1433??2010-11-07?21:13??DrawFlowChart?v1.1\DrawFlowChart.h
?????文件????1393664??2011-01-07?10:51??DrawFlowChart?v1.1\DrawFlowChart.ncb
?????文件??????48640??2011-01-07?10:51??DrawFlowChart?v1.1\DrawFlowChart.opt
?????文件????????260??2011-01-07?10:16??DrawFlowChart?v1.1\DrawFlowChart.plg
?????文件??????13449??2011-01-06?19:33??DrawFlowChart?v1.1\DrawFlowChart.rc
?????文件???????2645??2011-01-06?19:16??DrawFlowChart?v1.1\DrawFlowChartDoc.cpp
?????文件???????1723??2011-01-06?19:17??DrawFlowChart?v1.1\DrawFlowChartDoc.h
?????文件??????16463??2011-01-06?20:41??DrawFlowChart?v1.1\DrawFlowChartView.cpp
?????文件???????3268??2011-01-06?19:15??DrawFlowChart?v1.1\DrawFlowChartView.h
?????文件???????4819??2011-01-06?16:06??DrawFlowChart?v1.1\Ellipse.cpp
?????文件????????970??2011-01-06?16:05??DrawFlowChart?v1.1\Ellipse.h
?????文件???????3362??2011-01-05?20:03??DrawFlowChart?v1.1\End.cpp
?????文件????????815??2011-01-06?15:37??DrawFlowChart?v1.1\End.h
?????文件???????2929??2011-01-01?14:56??DrawFlowChart?v1.1\GenericLine.cpp
?????文件???????1186??2011-01-01?14:56??DrawFlowChart?v1.1\GenericLine.h
............此處省略30個文件信息
- 上一篇:帶頭結(jié)點的單鏈表的c算法實現(xiàn)
- 下一篇:好玩的類似病毒文件
評論
共有 條評論