コード例 #1
0
void
JXTreeListWidget::HandleNodeMoveFinished()
{
	// restore selection

	(GetTableSelection()).ClearSelection();
	SelectNodes(*itsReselectNodeList);
	itsReselectNodeList->RemoveAll();

	// restore scroll position

	assert( itsSavedScrollSetup != NULL );
	const std::string s(itsSavedScrollSetup->GetCString(), itsSavedScrollSetup->GetLength());
	std::istringstream input(s);
	ReadScrollSetup(input);

	delete itsSavedScrollSetup;
	itsSavedScrollSetup = NULL;
}
コード例 #2
0
CAppearanceDatabase CAppearanceDatabase::CreateFromXml(Framework::CStream& stream)
{
	CAppearanceDatabase result;
	auto documentNode = std::unique_ptr<Framework::Xml::CNode>(Framework::Xml::CParser::ParseDocument(stream));
	auto appearanceNodes = documentNode->SelectNodes("Appearances/Appearance");
	for(const auto& appearanceNode : appearanceNodes)
	{
		APPEARANCE_DEFINITION appearance;
		uint32 itemId = Framework::Xml::GetAttributeIntValue(appearanceNode, "ItemId");
		for(const auto& appearanceAttribute : appearanceNode->GetAttributes())
		{
			if(appearanceAttribute.first == "ItemId") continue;
			uint32 attributeValue = atoi(appearanceAttribute.second.c_str());
			appearance.attributes.insert(std::make_pair(appearanceAttribute.first, attributeValue));
		}
		result.m_appearances.insert(std::make_pair(itemId, appearance));
	}
	return result;
}