当前位置: 首页>>代码示例>>C++>>正文


C++ ElementPtr::findAttribute方法代码示例

本文整理汇总了C++中mygui::xml::ElementPtr::findAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ ElementPtr::findAttribute方法的具体用法?C++ ElementPtr::findAttribute怎么用?C++ ElementPtr::findAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mygui::xml::ElementPtr的用法示例。


在下文中一共展示了ElementPtr::findAttribute方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: deserialization

 void EditTextStateInfo::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) {
     mShift = MyGUI::utility::parseBool(_node->findAttribute("shift"));
     
     std::string colour = _node->findAttribute("colour");
     if (_version >= MyGUI::Version(1, 1))
     {
         colour = MyGUI::LanguageManager::getInstance().replaceTags(colour);
     }
     
     mColour = MyGUI::Colour::parse(colour);
 }
开发者ID:andryblack,项目名称:sandbox,代码行数:11,代码来源:sb_mygui_edit_text.cpp

示例2: loadJoint

void Framework::loadJoint( MyGUI::xml::ElementPtr node,RigidPtr parent )
{
    ObjectFactory& factory = ObjectFactory::getSingleton();
    string typeName = node->findAttribute("type");
    JointPtr jpt = boost::dynamic_pointer_cast<Joint>(factory.createObject(typeName));
    if(jpt)
    {
        if( parent )
        {
            jpt->mRigid[0] = parent;
        }
        addJoint(jpt);
        jpt->load(node);
        MyGUI::xml::ElementEnumerator ce = node->getElementEnumerator();
        while(ce.next())
        {
            MyGUI::xml::ElementPtr child = ce.current();
            if( child->getName() == "rigid" )
            {
                loadRigid(child, jpt);
            }
            break;
        }
    }
    else
    {
        WARNING_LOG("Factory can't make "<<typeName);
    }
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:29,代码来源:Framework.cpp

示例3: isMetaSolution

bool EditorState::isMetaSolution(const MyGUI::UString& _fileName)
{
	MyGUI::xml::Document doc;
	if (!doc.open(_fileName))
	{
		return false;
	}

	MyGUI::xml::ElementPtr root = doc.getRoot();
	if (!root || (root->getName() != "MyGUI"))
	{
		return false;
	}

	std::string type;
	if (root->findAttribute("type", type))
	{
		if (type == "MetaSolution")
		{
			return true;
		}
	}

	return false;
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:25,代码来源:EditorState.cpp

示例4: load

void Rigid::load( MyGUI::xml::ElementPtr node )
{
    string ms;
	VisualObject::load(node);
    if(node->findAttribute("mass", ms))
    {
        mMassDensity = toValue(ms,(dReal)1);
    }
    _init();
	_visual2physic();
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:11,代码来源:Rigid.cpp

示例5: load

void Framework::load( MyGUI::xml::ElementPtr node )
{
    removeAllJoint();
    mName = node->findAttribute("name");
    MyGUI::xml::ElementEnumerator e=node->getElementEnumerator();
    while(e.next())
    {
        MyGUI::xml::ElementPtr node = e.current();
        if( node->getName() == "body" )
        {
            loadRigid(node, JointPtr());
        }
        break;
    }
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:15,代码来源:Framework.cpp

示例6: convertProjectName

	MyGUI::UString EditorState::convertProjectName(const MyGUI::UString& _fileName)
	{
		size_t pos = mFileName.find_last_of("\\/");
		MyGUI::UString shortName = pos == MyGUI::UString::npos ? mFileName : mFileName.substr(pos + 1);
		addUserTag("ResourceName", shortName);

		size_t index = _fileName.find("|");
		if (index == MyGUI::UString::npos)
			return _fileName;

		MyGUI::UString fileName = _fileName.substr(0, index);
		MyGUI::UString itemIndexName = _fileName.substr(index + 1);
		size_t itemIndex = MyGUI::utility::parseValue<size_t>(itemIndexName);

		MyGUI::xml::Document doc;
		if (!doc.open(fileName))
			return _fileName;

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if ((nullptr == root) || (root->getName() != "MyGUI"))
			return _fileName;

		if (root->findAttribute("type") == "Resource")
		{
			// берем детей и крутимся
			MyGUI::xml::ElementEnumerator element = root->getElementEnumerator();
			while (element.next("Resource"))
			{
				if (element->findAttribute("type") == "ResourceLayout")
				{
					if (itemIndex == 0)
					{
						// поменять на теги
						std::string resourceName = element->findAttribute("name");
						addUserTag("ResourceName", resourceName);
						return MyGUI::utility::toString(fileName, " [", resourceName, "]");
					}
					else
					{
						itemIndex --;
					}
				}
			}
		}

		return _fileName;
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:47,代码来源:EditorState.cpp

示例7: loadSettings

	void SettingsManager::loadSettings(const MyGUI::UString& _fileName, bool _internal)
	{
		std::string _instance = "Editor";

		MyGUI::xml::Document doc;
		if (_internal)
		{
			MyGUI::DataStreamHolder data = MyGUI::DataManager::getInstance().getData(_fileName);
			if (data.getData() != nullptr)
			{
				if (!doc.open(data.getData()))
				{
					MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
					return;
				}
			}
		}
		else
		{
			if (!doc.open(_fileName))
			{
				MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
				return;
			}
		}

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if (!root || (root->getName() != "MyGUI"))
		{
			MYGUI_LOGGING(LogSection, Error, _instance << " : '" << _fileName << "', tag 'MyGUI' not found");
			return;
		}

		std::string type;
		if (root->findAttribute("type", type))
		{
			if (type == "Settings")
			{
				// берем детей и крутимся
				MyGUI::xml::ElementEnumerator field = root->getElementEnumerator();
				while (field.next())
					loadSector(field.current());
			}
		}
	}
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:45,代码来源:SettingsManager.cpp

示例8: deserialization

 void MaskSetSubSkinState::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) {
     std::string texture = _node->getParent()->findAttribute("texture");
     if (texture.empty()) {
         texture = _node->getParent()->getParent()->findAttribute("texture");
     }
     // tags replacement support for Skins
     if (_version >= MyGUI::Version(1, 1))
     {
         texture = MyGUI::LanguageManager::getInstance().replaceTags(texture);
     }
     
     const MyGUI::IntSize& size = MyGUI::texture_utility::getTextureSize(texture);
     
     m_texture = MyGUI::RenderManager::getInstance().getTexture(texture);
     
     const MyGUI::IntCoord& coord = MyGUI::IntCoord::parse(_node->findAttribute("offset"));
     setRect(MyGUI::CoordConverter::convertTextureCoord(coord, size));
 }
开发者ID:andryblack,项目名称:sandbox,代码行数:18,代码来源:sb_mygui_skin.cpp

示例9: loadSettings

//===================================================================================
void EditorState::loadSettings(const MyGUI::UString& _fileName, bool _internal)
{
	std::string _instance = "Editor";

	MyGUI::xml::Document doc;
	if (_internal)
	{
		MyGUI::IDataStream* data = MyGUI::DataManager::getInstance().getData(_fileName);
		if (data)
		{
			PtrHolder<MyGUI::IDataStream> holder = PtrHolder<MyGUI::IDataStream>(data);

			if (!doc.open(data))
			{
				MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
				return;
			}
		}
	}
	else
	{
		if (!doc.open(_fileName))
		{
			MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
			return;
		}
	}

	MyGUI::xml::ElementPtr root = doc.getRoot();
	if (!root || (root->getName() != "MyGUI"))
	{
		MYGUI_LOGGING(LogSection, Error, _instance << " : '" << _fileName << "', tag 'MyGUI' not found");
		return;
	}

	std::string type;
	if (root->findAttribute("type", type))
	{
		if (type == "Settings")
		{
			// берем детей и крутимс¤
			MyGUI::xml::ElementEnumerator field = root->getElementEnumerator();
			while (field.next())
			{
				if (field->getName() == "PropertiesPanelView") mPropertiesPanelView->load(field);
				else if (field->getName() == "SettingsWindow") mSettingsWindow->load(field);
				else if (field->getName() == "WidgetsWindow") mWidgetsWindow->load(field);
				else if (field->getName() == "MetaSolutionWindow")
				{
					if (isNeedSolutionLoad(field))
					{
						clearWidgetWindow();
						mMetaSolutionWindow->load(field);
					}
				}
				else if (field->getName() == "RecentFile")
				{
					std::string name;
					if (!field->findAttribute("name", name)) continue;
					recentFiles.push_back(name);
				}
				else if (field->getName() == "AdditionalPath")
				{
					std::string name;
					if (!field->findAttribute("name", name)) continue;
					additionalPaths.push_back(name);
				}
			}
		}
	}
}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:72,代码来源:EditorState.cpp


注:本文中的mygui::xml::ElementPtr::findAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。