本文整理汇总了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);
}
示例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;
}
}
示例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();
}
}
}