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


C++ CInterfaceElement::getId方法代码示例

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


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

示例1: execute

	virtual void execute (CCtrlBase *pCaller, const string &Params)
	{
		string sValue = getParam(Params,"value");
		string sTarget = getParam(Params,"target");

		if (sTarget.empty()) return;

		if (sTarget.rfind(':') == string::npos)
		{
			if (pCaller == NULL) return;
			sTarget = pCaller->getId() + ":" + sTarget;
		}
		else
		{
			CInterfaceManager *pIM = CInterfaceManager::getInstance();
			string elt = sTarget.substr(0,sTarget.rfind(':'));
			CInterfaceElement *pIE;
			if (pCaller != NULL)
				pIE = pIM->getElementFromId(pCaller->getId(), elt);
			else
				pIE = pIM->getElementFromId(elt);
			if (pIE == NULL) return;
			sTarget = pIE->getId() + ":" + sTarget.substr(sTarget.rfind(':')+1,sTarget.size());
		}

		CInterfaceExprValue evValue;
		if (CInterfaceExpr::eval(sValue, evValue, NULL))
		{
			CInterfaceManager *pIM = CInterfaceManager::getInstance();
			if (evValue.toInteger())
				pIM->addServerString (sTarget, (uint32)evValue.getInteger());
		}
	}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:33,代码来源:action_handler.cpp

示例2: getSizeParent

	void CInterfaceElement::getSizeParent( std::string &id ) const
	{
		CInterfaceElement *p = getParentSize();

		// If there's no parent set then the size parent is the parent
		if( p == NULL )
		{
			id = "parent";
			return;
		}

		// If the size parent is the same as the group parent, then the size parent is the parent ofc
		if( p == getParent() )
		{
			id = "parent";
			return;
		}

		// If the size parent is in the parent group, use the short Id
		if( p->isInGroup( getParent() ) )
		{
			id = p->getShortId();
			return;
		}

		// Otherwise use the full Id
		id = p->getId();
	}
开发者ID:junhuac,项目名称:ryzomcore,代码行数:28,代码来源:interface_element.cpp

示例3: getPosParent

	void CInterfaceElement::getPosParent( std::string &id ) const
	{

		// If there's no pos parent set, then the parent group is the pos parent
		if( getParentPos() == NULL )
		{
			id = "parent";
			return;
		}

		// If pos parent and parent are the same then ofc the parent group is the pos parent...
		CInterfaceElement *p = getParent();
		if( getParentPos() == p )
		{
			id = "parent";
			return;
		}

		// If parent is in the same group, use the short id
		p = getParentPos();
		if( p->isInGroup( getParent() ) )
		{
			id = p->getShortId();
			return;
		}

		// Otherwise use the full id
		id = p->getId();
	}
开发者ID:junhuac,项目名称:ryzomcore,代码行数:29,代码来源:interface_element.cpp

示例4:

	// ------------------------------------------------------------------------------------------------
	void CInterfaceElement::relativeSInt32Read (CInterfaceProperty &rIP, const string &prop, const char *val,
														   const string &defVal)
	{
		if (val == NULL)
		{
			rIP.readSInt32 (defVal.c_str(), _Id+":"+prop);
		}
		else
		{
			if ( isdigit(*val) || *val=='-')
			{
				rIP.readSInt32 (val, _Id+":"+prop);
				return;
			}

			sint32 decal = 0;
			if (val[0] == ':')
				decal = 1;
			if (NLGUI::CDBManager::getInstance()->getDbProp(val+decal, false) != NULL)
			{
				rIP.readSInt32 (val+decal, _Id+":"+prop);
				return;
			}
			else
			{
				string sTmp;
				CInterfaceElement *pIEL = this;

				while (pIEL != NULL)
				{
					sTmp = pIEL->getId()+":"+string(val+decal);
					if (NLGUI::CDBManager::getInstance()->getDbProp(sTmp, false) != NULL)
					{
						rIP.readSInt32 (sTmp.c_str(), _Id+":"+prop);
						return;
					}
					pIEL = pIEL->getParent();
				}

				rIP.readSInt32 (val+decal, _Id+":"+prop);
			}
		}
	}
开发者ID:junhuac,项目名称:ryzomcore,代码行数:44,代码来源:interface_element.cpp

示例5: parseSizeParent

	void CInterfaceElement::parseSizeParent( const std::string &id )
	{
		CInterfaceElement *p = getParent();

		if( ( id == "parent" ) || ( id.empty() ) )
		{
			setParentSize( p );
			return;
		}

		std::string spId;

		if( p != NULL )
			spId = p->getId() + ":" + id;
		else
			spId = std::string( "ui:" ) + id;

		CWidgetManager::getInstance()->getParser()->addParentSizeAssociation( this, spId );
	}
开发者ID:junhuac,项目名称:ryzomcore,代码行数:19,代码来源:interface_element.cpp


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