Home | Products | Download | Purchase | Support 


   

DynaGraph Sample

 

 

UCanCode E-XD++ is also the best source code component for adding any kind of organization chart diagram drawing feature to your own application, it was designed specifically to help you create diagrams for human resources management, staff organization, office administration, and management structures. It will help you visualize and structure information, add illustrations and drawings to your documents and make all this fast and easy, currently, it supports horizontal and vertical tree layout, layer layout..., it is full written with VC++ Source Codes.

Steps:

1. Create new shape with:


void CDynaGraphView::OnFoAddNewpage() 
{
	// TODO: Add your command handler code here
	CFORoundRectShape * pNode1 = NULL;
	if(m_pCurRunModelHitShape != NULL)
	{
		if(m_pCurRunModelHitShape->IsKindOf(RUNTIME_CLASS(CFOLinkShape)))
		{
			CFOLinkShape *pLink = (CFOLinkShape *)(m_pCurRunModelHitShape);
			pNode1 = (CFORoundRectShape *)pLink->GetFromPort()->GetParentComp();
		}
		else
		{
			pNode1 = (CFORoundRectShape *)m_pCurRunModelHitShape;
		}
	}
	else
	{
		AfxMessageBox(_T("Please select a root node for adding at first!"), MB_OK|MB_ICONINFORMATION);
		return;
	}
	
	CFORoundRectShape * pNode2 = CreateNode();
	m_pCurRunModelHitShape = pNode1;
	
	if(pNode1 != NULL && pNode2 != NULL)
	{
		switch(theApp.m_nLinkType)
		{
		case 0:
			{
				AddLinkShapeNoUndo(pNode1, pNode2, FO_COMP_LINK, 1);
			}
			break;

		case 1:
			{
				AddLinkShapeNoUndo(pNode1, pNode2, FO_COMP_UPRIGHTLINK, 1);
			}
			break;

		case 2:
			{
				AddLinkShapeNoUndo(pNode1, pNode2, FO_COMP_BEZIERLINK, 1);
			}
			break;
		}
		

		if(theApp.m_bHorz)
		{
			AfxGetApp()->BeginWaitCursor();
			CFOPHorzLayout layout1;
			layout1.m_nLayerSpace = 160;
			layout1.Initialize(GetCurrentModel(), *GetCurrentModel()->GetFormObjects());
			layout1.DoLayout();
			AfxGetApp()->EndWaitCursor();
		}
		else
		{
			AfxGetApp()->BeginWaitCursor();
			CFOPVertLayout layout1;
			layout1.m_nLayerSpace = 160;
			layout1.Initialize(GetCurrentModel(), *GetCurrentModel()->GetFormObjects());
			layout1.DoLayout();
			AfxGetApp()->EndWaitCursor();
		}

		CMainFrame *pParent = STATIC_DOWNCAST(CMainFrame,AfxGetMainWnd());
		ASSERT_VALID(pParent);
		//	if(pParent->IsWindowVisible())
		{
			pParent->m_wndTableBar.InitShapes(GetCurrentModel());
		}
	}

}

2. Layout nodes:


void CNewVisualProxy::GenerateDefaultPorts(CArray<FOP_PortScale,FOP_PortScale>* mpSpot)
{
	mpSpot->RemoveAll();
	FOP_PortScale m_Scale;
	m_Scale.xScale = 0.5;
	m_Scale.yScale = 0.5;
	mpSpot->SetSize(1);
	mpSpot->SetAt(0,m_Scale);
}
 

 


[ Home | Products | Download Area | Purchase | SupportContact us ]


Copyright ?1998-2007 UCanCode.Net Software, all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.com