Home | Products | Download | Purchase | Support 


   

SnapLine Sample

 

The SnapLine sample demonstrates the how to create snap cross point or snap help lines with codes. E-XD++ supports create any number of help lines, and when you creating shape or moving shape, it will snap to help line or snap cross point.

Steps:

Call the codes as below:


void CSnapLineView::OnAddSnapline() 
{
	// TODO: Add your command handler code here
	CSnapLineDlg dlg;
	if(dlg.DoModal() == IDOK)
	{
		CPoint pt = CPoint(dlg.m_x,dlg.m_y);
		switch(dlg.m_nType)
		{
		case 0:
			{
				CFOPHelpLine *pLine = new CFOPHelpLine(FOP_LINE_POINT,pt);
				GetCurrentModel()->AddNewHelpLine(pLine);
				Invalidate(FALSE);
				
			}
			break;
			
		case 1:
			{
				CFOPHelpLine *pLine = new CFOPHelpLine(FOP_LINE_VERTICAL,pt);
				GetCurrentModel()->AddNewHelpLine(pLine);
				Invalidate(FALSE);
				
			}
			break;
			
		case 2:
			{
				CFOPHelpLine *pLine = new CFOPHelpLine(FOP_LINE_HORIZONTAL,pt);
				GetCurrentModel()->AddNewHelpLine(pLine);
				Invalidate(FALSE);
			}
			break;
		
		}
		
	}
}




[ 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