• 大小: 179.63 KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-10-12
  • 语言: 其他
  • 标签: vc++6.0  

资源简介

本资源包括vc++6.0开发的流程图编辑器的工程文件,该流程图编辑器包含流程图的基本图元的编辑功能(添加,移动,修改,双击添加内容等),路径识别,流程图保存和读取,流程图生成图片功能等等。。。。

资源截图

代码片段和文件信息

// 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 < m_Points.GetSize(); 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个文件信息

评论

共有 条评论