Home | Products | Download | Purchase | Support 


   

AnchorTest Sample

 

The AnchorTest sample demonstrates how to create customize shape of E-XD++ Library. Some of the printing related features demonstrated in the sample are headers/footers, print zoom, zoom to fit, page borders and page layout setup. The sample shows the use of the Header Footer, Page Setup and Page Border dialogs for configuring the respective attributes. With E-XD++, you can create any kind of customize shapes.

Steps:

1.Create a new class CAnchorShape which uses CFODrawPortsShape as base class, this work can be done with ClassWizard.exe that shipped with E-XD++.

2.Modify the following method of CExtDataModel:

// Call before create shape new shape.
virtual void DoInitCreateShape(CFODrawShape *pShape);

3. Add new methods to CAnchorTestView for mouse drawing:


void CAnchorTestView::OnDrawAnchor() 
{
	// TODO: Add your command handler code here
	m_drawshape = MY_ANCHOR_SHAPE;
	SetCurrentDrawingCursor(IDC_FO_DRAW_COMP_CURSOR);
	m_action_state = State_DrawRect;
	m_bUpRightMode = FALSE;
}

void CAnchorTestView::OnUpdateDrawAnchor(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck(m_drawshape == MY_ANCHOR_SHAPE);
}

And

Steps:

1.Create a new class CMyThreePointEllipseShape which uses CFOPAdvAnchorShapeas base class, this work can be done with ClassWizard.exe that shipped with E-XD++.

2.Modify the following method of CExtDataModel:

// Call before create shape new shape.
virtual void DoInitCreateShape(CFODrawShape *pShape);

case My_THREEPOINT_ELLIPSE:
{
pReturn = new CMyThreePointEllipseShape;
pReturn->AddRef();
pReturn->Create(rc,"");
pReturn->UpdatePosition();
strCaption = GetUniqueCaption(pReturn->GetType());
strName = GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
}
break;

3. Add new methods to CAnchorTestView for mouse drawing:


void CAnchorTestView::OnDrawThreeellipse() 
{
	// TODO: Add your command handler code here
	m_drawshape = My_THREEPOINT_ELLIPSE;
	SetCurrentDrawingCursor(IDC_CURSOR_ELLIPSE);
	m_action_state = State_DrawDimLine;
	m_bUpRightMode = FALSE;
}

void CAnchorTestView::OnUpdateDrawThreeellipse(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	BOOL bDesign = GetCurrentModel()->IsDesignMode();
	pCmdUI->Enable(bDesign);

	pCmdUI->SetCheck(m_drawshape == My_THREEPOINT_ELLIPSE);
}

4. Override the following method of CAnchorTestView for handle drawing:

// Draw Track Dimension Line
virtual void OnDrawTrackDimLine(CPoint point);



[ 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