Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Xmlize values
Re: Xmlize values [message #25442 is a reply to message #25441] Wed, 24 February 2010 00:20 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1308
Registered: September 2007
Ultimate Contributor
For Koldo, a sample ArrayCtrl xmlized with some processing added on load/store.... just a small part of my app.

void GenericLoads::Xmlize(XmlIO xml)
{
	Vector<Vector<Value> >vc;
	Vector<Vector<Value> >vl;
	xml("DAN", DANName);
	if(xml.IsStoring())
	{
		for(int iCond = 0; iCond < conds.GetCount(); iCond++)
			vc.Add(conds.ReadRow(iCond));
		xml("Conds", vc);
		for(int iLoad = 0; iLoad < loads.GetCount(); iLoad++)
			vl.Add(ReadLoadLine(iLoad));
		xml("Loads", vl);
	}
	else
	{
		// setup measurement units reading them
		// from global settings
		distribUM = globalSettings().GetUnitaMisura().Distribuiti;
		concentrUM = globalSettings().GetUnitaMisura().Concentrati;
		lengthUM = globalSettings().GetUnitaMisura().Lunghezze;
		
		xml("Conds", vc);
		xml("Loads", vl);
		conds.SetCount(vc.GetCount());
		loads.SetCount(vl.GetCount());
		PropagateDAN(DANName);
		for(int iCond = 0; iCond < vc.GetCount(); iCond++)
			conds.Set(iCond, vc[iCond]);
		SyncConds();
		for(int iLoad = 0; iLoad < vl.GetCount(); iLoad++)
			WriteLoadLine(iLoad, vl[iLoad]);
		
		// synchronize labels
		SyncLoads();
	}
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strange Win7 issue with large fonts...
Next Topic: libpng1.4
Goto Forum:
  


Current Time: Fri Jul 18 03:39:16 CEST 2025

Total time taken to generate the page: 0.04248 seconds