// Load and save to an XML file
void CDrawSquare::SaveXML( CXMLWriter &xml )
{
    xml.addTag(GetXMLTag(IsSquare()));

    xml.addAttribute( _T("a"), CDPoint(m_point_a) );
    xml.addAttribute( _T("b"), CDPoint(m_point_b) );
    xml.addAttribute( _T("style"), Style );
    xml.addAttribute( _T("fill"), Fill );

    xml.closeTag();
}
Beispiel #2
0
// Load and save to an XML file
void CDrawPower::SaveXML(CXMLWriter &xml)
{
	xml.addTag(GetXMLTag());

	xml.addAttribute(_T("pos"), CDPoint(m_point_a));
	xml.addAttribute(_T("which"), which);
	xml.addAttribute(_T("direction"), dir);
	xml.addChildData(str);

	xml.closeTag();
}
// Load and save to an XML file
void CDrawMetaFile::SaveXML( CXMLWriter &xml )
{
	xml.addTag(GetXMLTag());

	xml.addAttribute( _T("a"), CDPoint(m_point_a) );
	xml.addAttribute( _T("b"), CDPoint(m_point_b) );
	xml.addAttribute( _T("id"), m_metafile );

	xml.closeTag();

}
// Load and save to an XML file
void CDrawLine::SaveXML( CXMLWriter &xml )
{
	xml.addTag(GetXMLTag(xtype));

	switch (xtype) 
	{
	case xBus:
	case xWire:
		if (!m_use_default_style)
		{
			xml.addAttribute( _T("style"), m_style );
		}
		break;
	default:
		xml.addAttribute( _T("style"), m_style );
		break;
	}	

	xml.addAttribute( _T("a"), m_point_a );
	xml.addAttribute( _T("b"), m_point_b );
	xml.closeTag();
}
//-------------------------------------------------------------------------
void CDocResource::SaveXML( CTinyCadDoc* pDesign, const TCHAR* name, CXMLWriter& xml )
{
	// Now actually save the resources
	for( CDocResource* pointer = this; pointer != NULL; pointer = pointer->next )
	{
		if( pointer->InUse )
		{
			xml.addTag( name );
			xml.addAttribute( _T("id"), pointer->ResourceNumber );
			pointer->SaveItemXML( pDesign, xml );
			xml.closeTag();
		}
	}
}