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


C++ LLPanel::initPanelXML方法代码示例

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


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

示例1: fromXML

LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory)
{
	std::string name("panel");
	node->getAttributeString("name", name);

	LLPanel* panelp = factory->createFactoryPanel(name);
	// Fall back on a default panel, if there was no special factory.
	if (!panelp)
	{
		LLRect rect;
		createRect(node, rect, parent, LLRect());
		// create a new panel without a border, by default
		panelp = new LLPanel(name, rect, FALSE);
		panelp->initPanelXML(node, parent, factory);
		// preserve panel's width and height, but override the location
		const LLRect& panelrect = panelp->getRect();
		S32 w = panelrect.getWidth();
		S32 h = panelrect.getHeight();
		rect.setLeftTopAndSize(rect.mLeft, rect.mTop, w, h);
		panelp->setRect(rect);
	}
	else
	{
		panelp->initPanelXML(node, parent, factory);
	}

	return panelp;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:28,代码来源:llpanel.cpp

示例2: fromXML

LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *factory)
{
	std::string name("panel");
	node->getAttributeString("name", name);

	LLPanel* panelp = factory->createFactoryPanel(name);
	LLFastTimer _(FTM_PANEL_CONSTRUCTION);
	// Fall back on a default panel, if there was no special factory.
	if (!panelp)
	{
		LLRect rect;
		createRect(node, rect, parent, LLRect());
		// create a new panel without a border, by default
		panelp = new LLPanel(name, rect, FALSE);
		// for local registry callbacks; define in constructor, referenced in XUI or postBuild
		panelp->mCommitCallbackRegistrar.pushScope(); 
		panelp->mEnableCallbackRegistrar.pushScope();
		panelp->initPanelXML(node, parent, factory);
		panelp->mCommitCallbackRegistrar.popScope();
		panelp->mEnableCallbackRegistrar.popScope();
		// preserve panel's width and height, but override the location
		const LLRect& panelrect = panelp->getRect();
		S32 w = panelrect.getWidth();
		S32 h = panelrect.getHeight();
		rect.setLeftTopAndSize(rect.mLeft, rect.mTop, w, h);
		panelp->setRect(rect);
	}
	else
	{
		if(!factory->builtPanel(panelp))
		{
			// for local registry callbacks; define in constructor, referenced in XUI or postBuild
			panelp->mCommitCallbackRegistrar.pushScope(); 
			panelp->mEnableCallbackRegistrar.pushScope();
			panelp->initPanelXML(node, parent, factory);
			panelp->mCommitCallbackRegistrar.popScope();
			panelp->mEnableCallbackRegistrar.popScope();
		}
		else
		{
			LLRect new_rect = panelp->getRect();
			// override rectangle with embedding parameters as provided
			panelp->createRect(node, new_rect, parent);
			panelp->setOrigin(new_rect.mLeft, new_rect.mBottom);
			panelp->setShape(new_rect);
			// optionally override follows flags from including nodes
			panelp->parseFollowsFlags(node);
		}
	}

	return panelp;
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:52,代码来源:llpanel.cpp

示例3: fromXML

LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node)
{
	std::string name("panel");
	node->getAttributeString("name", name);

	std::string class_attr;
	node->getAttributeString("class", class_attr);

	LLPanel* panelp = NULL;
	
	{
		LLFastTimer timer(FTM_PANEL_CONSTRUCTION);
		
		if(!class_attr.empty())
		{
			panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr);
			if (!panelp)
			{
				llwarns << "Panel class \"" << class_attr << "\" not registered." << llendl;
			}
		}

		if (!panelp)
		{
			panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name);
			llassert(panelp);
			
			if (!panelp)
			{
				return NULL; // :(
			}
		}

	}
	// factory panels may have registered their own factory maps
	if (!panelp->getFactoryMap().empty())
	{
		LLUICtrlFactory::instance().pushFactoryFunctions(&panelp->getFactoryMap());
	}
	// for local registry callbacks; define in constructor, referenced in XUI or postBuild
	panelp->mCommitCallbackRegistrar.pushScope(); 
	panelp->mEnableCallbackRegistrar.pushScope();

	panelp->initPanelXML(node, parent, output_node);
	
	panelp->mCommitCallbackRegistrar.popScope();
	panelp->mEnableCallbackRegistrar.popScope();

	if (!panelp->getFactoryMap().empty())
	{
		LLUICtrlFactory::instance().popFactoryFunctions();
	}

	return panelp;
}
开发者ID:otwstephanie,项目名称:hpa2oar,代码行数:55,代码来源:llpanel.cpp


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