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


C++ LLFloater::closeHostedFloater方法代码示例

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


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

示例1: hideInstance

//static
// returns true if the instance exists
bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) 
{ 
	LLFloater* instance = findInstance(name, key); 
	if (instance)
	{
		instance->closeHostedFloater();
	}
	return (instance != NULL);
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:11,代码来源:llfloaterreg.cpp

示例2: toggleInstance

//static
// returns true if the instance is visible when completed
bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
{
	LLFloater* instance = findInstance(name, key); 
	if (LLFloater::isShown(instance))
	{
		instance->closeHostedFloater();
		return false;
	}
	else
	{
		return showInstance(name, key, TRUE) ? true : false;
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:15,代码来源:llfloaterreg.cpp

示例3: toggleInstanceOrBringToFront

//static
void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& key)
{
	//
	// Floaters controlled by the toolbar behave a bit differently from others.
	// Namely they have 3-4 states as defined in the design wiki page here:
	//   https://wiki.lindenlab.com/wiki/FUI_Button_states
	//
	// The basic idea is this:
	// * If the target floater is minimized, this button press will un-minimize it.
	// * Else if the target floater is closed open it.
	// * Else if the target floater does not have focus, give it focus.
	//       * Also, if it is not on top, bring it forward when focus is given.
	// * Else the target floater is open, close it.
	// 
	std::string name = sdname.asString();
	LLFloater* instance = getInstance(name, key); 
	

	if (!instance)
	{
		LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL;
		return;
	}
	
	// If hosted, we need to take that into account
	LLFloater* host = instance->getHost();
	
	if (host)
	{
		//FS:LO from above: * Else if the target floater does not have focus, give it focus. * Also, if it is not on top, bring it forward when focus is given.
		//if (host->isMinimized() || !host->isShown() || !host->isFrontmost())
		if (host->isMinimized() || !host->isShown() || (!host->hasFocus() || !host->isFrontmost()))
		{
			host->setMinimized(FALSE);
			instance->openFloater(key);
			instance->setVisibleAndFrontmost(true, key);
		}
		else if (!instance->getVisible())
		{
			instance->openFloater(key);
			instance->setVisibleAndFrontmost(true, key);
			instance->setFocus(TRUE);
		}
		else
		{
			instance->closeHostedFloater();
		}
	}
	else
	{
		if (instance->isMinimized())
		{
			instance->setMinimized(FALSE);
			instance->setVisibleAndFrontmost(true, key);
		}
		else if (!instance->isShown())
		{
			instance->openFloater(key);
			instance->setVisibleAndFrontmost(true, key);
		}
		//FS:LO from above: * Else if the target floater does not have focus, give it focus. * Also, if it is not on top, bring it forward when focus is given.
		//else if (!instance->isFrontmost())
		else if (!instance->hasFocus() || !instance->isFrontmost())
		{
			instance->setVisibleAndFrontmost(true, key);
		}
		else
		{
			instance->closeHostedFloater();
		}
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:73,代码来源:llfloaterreg.cpp


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