本文整理汇总了C++中Layout::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Layout::Load方法的具体用法?C++ Layout::Load怎么用?C++ Layout::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Layout *SystemMenuResource::LoadLayout( const U8Archive &arc, const std::string &lytName )
{
// read layout data
u8 *stuff = arc.GetFile( "/arc/blyt/" + lytName + ".brlyt" );
if( !stuff )
{
return NULL;
}
// load layout
Layout *ret = new Layout;
if( !ret->Load( stuff ) )
{
delete ret;
return NULL;
}
//ret->SetLanguage( "ENG" );
// load fonts and textures
//ret->LoadFonts( U8Archive(SystemFont::GetFont(), SystemFont::GetFontSize()) );
ret->LoadFonts( arc );
if( !ret->LoadTextures( arc ) )
{
delete ret;
return NULL;
}
//gprintf( "loaded layout: \"%s\" %.2f x %.2f\n", lytName.c_str(), ret->GetWidth(), ret->GetHeight() );
return ret;
}
示例2: ParseCMSD
void CCMSDIntegrator::ParseCMSD(std::string filename)
{
CMSD::CCMSD doc = CMSD::CCMSD::LoadFromFile(filename);
doc.SaveToFile((::ExeDirectory() + "Test1.xml").c_str(), true);
//CMSD::CCMSD::DataSection d = doc.DataSection().first();
CMSD::CwhiteSpaceType root = doc.whiteSpace.first();
CMSD::CCMSDDocument cmsddocument = doc.CMSDDocument[0];
CMSD::CDataSectionType2 data = cmsddocument.DataSection[0];
for(int i=0; i< data.PartType.count() ; i++)
{
Part * apart ( (Part*) Part().CreateSave<Part>());
apart->Load(data.PartType[i].GetNode());
//std::vector<IObjectPtr> &someparts ( apart->objects());
//Part * part2=(Part *) someparts[0].get();
}
for(int i=0; i< data.ProcessPlan.count() ; i++)
{
ProcessPlan * aplan ( (ProcessPlan *) IObject::CreateSave<ProcessPlan>());
aplan->Load(data.ProcessPlan[i].GetNode());
}
for(int i=0; i< data.Resource.count() ; i++)
{
if(Cell::IsResourceCell(data.Resource[i].GetNode()))
{
Cell * acell( (Cell *) IObject::CreateSave<Cell>());
acell->Load(data.Resource[i].GetNode());
}
else
{
Resource * aresource ((Resource *) IObject::CreateSave<Resource>());
aresource->Load(data.Resource[i].GetNode());
}
}
for(int i=0; i< data.Job.count() ; i++)
{
Job * ajob ( IObject::CreateSave<Job>() );
ajob->Load(data.Job[i].GetNode());
}
for(int i=0; i< data.DistributionDefinition.count() ; i++)
{
Distribution * astat ( (Distribution *) IObject::CreateSave<Distribution>() );
astat->LoadDefinition(data.DistributionDefinition[i].GetNode());
}
for(int i=0; i< data.Calendar.count() ; i++)
{
Calendar * calendar ( (Calendar *) IObject::CreateSave<Calendar>());
calendar->Load(data.Calendar[i].GetNode());
}
for(int i=0; i< data.Layout.count() ; i++)
{
Layout * layout ((Layout *) IObject::CreateSave<Layout>());
layout->Load(data.Layout[i].GetNode());
}
//CMSD::CInventoryItem inv = data.InventoryItem[0];
//inv.Location
int j=0;
}