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


C++ DataPtr::getPropertyValue方法代码示例

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


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

示例1: writeStateText

	void SkinExportSerializer::writeStateText(pugi::xml_node _parent, DataPtr _data, const MyGUI::IntCoord& _value)
	{
		pugi::xml_node node = _parent.append_child("State");
		node.append_attribute("name").set_value(convertEditorToExportStateName(_data->getPropertyValue("Name")).c_str());
		node.append_attribute("colour").set_value(_data->getPropertyValue("TextColour").c_str());
		node.append_attribute("shift").set_value(_data->getPropertyValue("TextShift").c_str());
	}
开发者ID:xzwang2005,项目名称:mygui,代码行数:7,代码来源:SkinExportSerializer.cpp

示例2: generateFont

	void FontExportSerializer::generateFont(DataPtr _data)
	{
		std::string fontName = _data->getPropertyValue("FontName");
		removeFont(fontName);

		std::string resourceCategory = MyGUI::ResourceManager::getInstance().getCategoryName();
		MyGUI::ResourceTrueTypeFont* font = MyGUI::FactoryManager::getInstance().createObject<MyGUI::ResourceTrueTypeFont>(resourceCategory);

		font->setResourceName(fontName);

		font->setSource(_data->getPropertyValue("Source"));
		font->setSize(_data->getPropertyValue<float>("Size"));
		font->setResolution(_data->getPropertyValue<int>("Resolution"));
		font->setHinting(_data->getPropertyValue("Hinting"));
		font->setAntialias(_data->getPropertyValue<bool>("Antialias"));
		font->setTabWidth(_data->getPropertyValue<float>("TabWidth"));
		font->setOffsetHeight(_data->getPropertyValue<int>("OffsetHeight"));
		font->setSubstituteCode(_data->getPropertyValue<int>("SubstituteCode"));
		font->setDistance(_data->getPropertyValue<int>("Distance"));

		std::string ranges = _data->getPropertyValue("FontCodeRanges");
		std::vector<std::string> values = MyGUI::utility::split(ranges, "|");
		for (size_t index = 0; index < values.size(); index ++)
		{
			MyGUI::IntSize size = MyGUI::IntSize::parse(values[index]);
			font->addCodePointRange(size.width, size.height); // о да
		}

		font->initialise();

		MyGUI::ResourceManager::getInstance().addResource(font);
	}
开发者ID:2asoft,项目名称:MMO-Framework,代码行数:32,代码来源:FontExportSerializer.cpp

示例3: writeFrame

	void ImageExportSerializer::writeFrame(pugi::xml_node _parent, DataPtr _data)
	{
		pugi::xml_node node = _parent.append_child("Frame");
		node.append_attribute("point").set_value(_data->getPropertyValue("Point").c_str());

		size_t count = MyGUI::utility::parseValue<size_t>(_data->getPropertyValue("Count"));
		if (count > 1)
			node.append_attribute("count").set_value(MyGUI::utility::toString(count).c_str());
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:9,代码来源:ImageExportSerializer.cpp

示例4: writeGroup

	void ImageExportSerializer::writeGroup(pugi::xml_node _parent, DataPtr _data)
	{
		pugi::xml_node node = _parent.append_child("Group");
		node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str());
		node.append_attribute("texture").set_value(_data->getPropertyValue("Texture").c_str());
		node.append_attribute("size").set_value(MyGUI::IntCoord::parse(_data->getPropertyValue("Size")).size().print().c_str());

		for (Data::VectorData::const_iterator child = _data->getChilds().begin(); child != _data->getChilds().end(); child ++)
			writeIndex(node, (*child));
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:10,代码来源:ImageExportSerializer.cpp

示例5: writeState

	pugi::xml_node SkinExportSerializer::writeState(pugi::xml_node _parent, DataPtr _data, const MyGUI::IntCoord& _value)
	{
		MyGUI::IntPoint point = MyGUI::IntPoint::parse(_data->getPropertyValue("Point"));
		MyGUI::IntCoord coord = _value + point;

		pugi::xml_node node = _parent.append_child("State");
		node.append_attribute("name").set_value(convertEditorToExportStateName(_data->getPropertyValue("Name")).c_str());
		node.append_attribute("offset").set_value(coord.print().c_str());

		return node;
	}
开发者ID:xzwang2005,项目名称:mygui,代码行数:11,代码来源:SkinExportSerializer.cpp

示例6: writeIndex

	void ImageExportSerializer::writeIndex(pugi::xml_node _parent, DataPtr _data)
	{
		pugi::xml_node node = _parent.append_child("Index");
		node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str());

		std::string value = _data->getPropertyValue("Rate");
		if (!value.empty())
			node.append_attribute("rate").set_value(value.c_str());

		for (Data::VectorData::const_iterator child = _data->getChilds().begin(); child != _data->getChilds().end(); child ++)
			writeFrame(node, (*child));
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:12,代码来源:ImageExportSerializer.cpp

示例7: parseSkin

	void SkinExportSerializer::parseSkin(pugi::xml_node _node)
	{
		DataPtr data = Data::CreateInstance();
		data->setType(DataTypeManager::getInstance().getType("Skin"));
		data->setPropertyValue("Name", _node.attribute("name").value());
		data->setPropertyValue("Texture", _node.attribute("texture").value());

		DataManager::getInstance().getRoot()->addChild(data);

		SkinDataUtility::CreateSkinData(data);
		fillStateData(data, _node);

		DataPtr state = getChildData(data, "State", "Normal");
		std::string value = state != nullptr ? state->getPropertyValue("Point") : "";
		MyGUI::IntPoint point = MyGUI::IntPoint::parse(value);
		MyGUI::IntSize size = MyGUI::IntSize::parse(_node.attribute("size").value());

		data->setPropertyValue("Size", MyGUI::IntCoord(point.left, point.top, size.width, size.height).print());

		fillSeparatorData(data, _node);

		MyGUI::IntRect separators = SkinDataUtility::getSeparatorsOffset(data);
		SkinDataUtility::VectorCoord coords = SkinDataUtility::getRegions(size, separators);
		SkinDataUtility::fillRegionCoords(data, coords);

		SkinDataUtility::RectVisible visible = SkinDataUtility::getSeparatorsVisible(data);
		SkinDataUtility::fillRegionEnable(data, visible);

		fillRegionData(data, _node);
	}
开发者ID:xzwang2005,项目名称:mygui,代码行数:30,代码来源:SkinExportSerializer.cpp

示例8: updateFont

	void FontTryControl::updateFont()
	{
		DataPtr data = DataUtility::getSelectedDataByType("Font");
		if (data != nullptr)
			mEdit->setFontName(data->getPropertyValue("FontName"));
		else
			mEdit->setFontName("");
	}
开发者ID:2asoft,项目名称:MMO-Framework,代码行数:8,代码来源:FontTryControl.cpp

示例9: writeImage

	void ImageExportSerializer::writeImage(pugi::xml_node _parent, DataPtr _data)
	{
		pugi::xml_node node = _parent.append_child("Resource");
		node.append_attribute("type").set_value("ResourceImageSet");
		node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str());

		for (Data::VectorData::const_iterator child = _data->getChilds().begin(); child != _data->getChilds().end(); child ++)
			writeGroup(node, (*child));
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:9,代码来源:ImageExportSerializer.cpp

示例10: writeSkin

	void SkinExportSerializer::writeSkin(pugi::xml_node _parent, DataPtr _data)
	{
		pugi::xml_node node = _parent.append_child("Resource");
		node.append_attribute("type").set_value("ResourceSkin");
		node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str());
		node.append_attribute("size").set_value(MyGUI::IntCoord::parse(_data->getPropertyValue("Size")).size().print().c_str());
		std::string textureName = _data->getPropertyValue("Texture");
		if (!textureName.empty())
			node.append_attribute("texture").set_value(textureName.c_str());

		Data::VectorData childs = DataUtility::getChildsByType(_data, "Region", false);
		sortByAlign(childs);
		for (Data::VectorData::const_iterator child = childs.begin(); child != childs.end(); child ++)
			writeRegion(node, _data, (*child), false);

		childs = DataUtility::getChildsByType(_data, "RegionText", false);
		for (Data::VectorData::const_iterator child = childs.begin(); child != childs.end(); child ++)
			writeRegion(node, _data, (*child), true);
	}
开发者ID:xzwang2005,项目名称:mygui,代码行数:19,代码来源:SkinExportSerializer.cpp

示例11: notifyChangeProperty

	void ListBoxDataControl::notifyChangeProperty(PropertyPtr _sender)
	{
		if (mParentData == nullptr)
			return;
		if (mParentData != _sender->getOwner()->getParent())
			return;

		for (size_t index = 0; index < mListBox->getItemCount(); index ++)
		{
			DataPtr data = *mListBox->getItemDataAt<DataPtr>(index);
			if (data == _sender->getOwner())
			{
				bool unique = isDataEnabled(data);
				if (unique)
					mListBox->setItemNameAt(index, data->getPropertyValue(mPropertyForName));
				else
					mListBox->setItemNameAt(index, replaceTags(mColourName) + data->getPropertyValue(mPropertyForName));
			}
		}
	}
开发者ID:chhawk,项目名称:MyGUI,代码行数:20,代码来源:ListBoxDataControl.cpp

示例12: invalidateList

	void ListBoxDataControl::invalidateList()
	{
		mLastIndex = MyGUI::ITEM_NONE;
		mListBox->setIndexSelected(MyGUI::ITEM_NONE);

		if (mParentData != nullptr)
		{
			for (size_t index = 0; index < mListBox->getItemCount(); index ++)
				mListBox->setItemDataAt(index, nullptr);

			const Data::VectorData& childs = DataUtility::getChildsByType(mParentData, mThisType);

			while (mListBox->getItemCount() > childs.size())
				mListBox->removeItemAt(mListBox->getItemCount() - 1);

			while (mListBox->getItemCount() < childs.size())
				mListBox->addItem("", nullptr);

			for (size_t index = 0; index < childs.size(); index ++)
			{
				DataPtr child = childs.at(index);

				bool unique = isDataEnabled(child);
				if (unique)
					mListBox->setItemNameAt(index, child->getPropertyValue(mPropertyForName));
				else
					mListBox->setItemNameAt(index, replaceTags(mColourName) + child->getPropertyValue(mPropertyForName));

				mListBox->setItemDataAt(index, child);

				connectToProperty(child);
			}
		}
		else
		{
			mListBox->removeAllItems();
		}

		if (mHelpPanel != nullptr)
			mHelpPanel->setVisible(mListBox->getItemCount() == 0);
	}
开发者ID:chhawk,项目名称:MyGUI,代码行数:41,代码来源:ListBoxDataControl.cpp

示例13: generateFontManualXml

	void FontExportSerializer::generateFontManualXml(MyGUI::xml::ElementPtr _root, const MyGUI::UString& _folderName, DataPtr _data)
	{
		MyGUI::IFont* resource = MyGUI::FontManager::getInstance().getByName(_data->getPropertyValue("FontName"));
		MyGUI::ResourceTrueTypeFont* font = resource != nullptr ? resource->castType<MyGUI::ResourceTrueTypeFont>(false) : nullptr;

		if (font != nullptr)
		{
			std::string textureName = _data->getPropertyValue("Name") + ".png";
			MyGUI::ITexture* texture = font->getTextureFont();
			if (texture == nullptr)
				return;
			texture->saveToFile(MyGUI::UString(common::concatenatePath(_folderName, MyGUI::UString(textureName))).asUTF8());

			MyGUI::xml::ElementPtr node = _root->createChild("Resource");
			node->addAttribute("type", "ResourceManualFont");
			node->addAttribute("name", _data->getPropertyValue("Name"));

			addProperty(node, "Source", textureName);
			addProperty(node, "SourceSize", MyGUI::IntSize(texture->getWidth(), texture->getHeight()));
			addProperty(node, "DefaultHeight", font->getDefaultHeight());

			MyGUI::xml::Element* codes = node->createChild("Codes");

			std::vector<std::pair<MyGUI::Char, MyGUI::Char> > codePointRanges = font->getCodePointRanges();
			MyGUI::Char substituteCodePoint = font->getSubstituteCodePoint();
			bool isCustomSubstituteCodePoint = substituteCodePoint != MyGUI::FontCodeType::NotDefined;

			// Add all of the code points. Skip over the substitute code point -- unless it's been customized, in which case it
			// needs to be added here as a regular code point and then at the end as a substitute code point.
			for (std::vector<std::pair<MyGUI::Char, MyGUI::Char> >::const_iterator iter = codePointRanges.begin() ; iter != codePointRanges.end(); ++iter)
				for (MyGUI::Char code = iter->first; code <= iter->second && code >= iter->first; ++code)
					if (code != substituteCodePoint || isCustomSubstituteCodePoint)
						addCode(codes, code, font, false);

			// Always add the substitute code point last, even if it isn't the last one in the range.
			addCode(codes, substituteCodePoint, font, true);
		}
	}
开发者ID:2asoft,项目名称:MMO-Framework,代码行数:38,代码来源:FontExportSerializer.cpp

示例14: updateResultPropery

	void FontTextureController::updateResultPropery(DataPtr _data)
	{
		MyGUI::IResource* resource = MyGUI::ResourceManager::getInstance().findByName(_data->getPropertyValue("FontName"));
		MyGUI::ResourceTrueTypeFont* font = resource != nullptr ? resource->castType<MyGUI::ResourceTrueTypeFont>(false) : nullptr;
		MyGUI::ITexture* texture = font != nullptr ? font->getTextureFont() : nullptr;

		if (texture != nullptr)
			_data->setPropertyValue("TextureSizeResult", MyGUI::utility::toString(texture->getWidth(), " ", texture->getHeight()));
		else
			_data->setPropertyValue("TextureSizeResult", "0 0");

		if (font != nullptr)
			_data->setPropertyValue("FontHeightPix", font->getDefaultHeight());
		else
			_data->setPropertyValue("FontHeightPix", "0");
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:16,代码来源:FontTextureController.cpp

示例15: OnRenameData

	void ListBoxDataControl::OnRenameData()
	{
		size_t index = mListBox->getIndexSelected();
		if (index != MyGUI::ITEM_NONE)
		{
			mListBox->beginToItemAt(index);
			MyGUI::Widget* widget = mListBox->getWidgetByIndex(index);
			if (widget != nullptr)
			{
				DataPtr data = *mListBox->getItemDataAt<DataPtr>(index);

				mTextFieldControl->setCaption(replaceTags("CaptionEnterName"));
				mTextFieldControl->setTextField(data->getPropertyValue(mPropertyForName));
				mTextFieldControl->setUserData(data);
				mTextFieldControl->setCoord(MyGUI::IntCoord(widget->getAbsoluteLeft(), widget->getAbsoluteTop(), widget->getWidth(), widget->getHeight()));
				mTextFieldControl->doModal();
			}
		}
	}
开发者ID:chhawk,项目名称:MyGUI,代码行数:19,代码来源:ListBoxDataControl.cpp


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