本文整理汇总了C++中LLPanel::removeChild方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPanel::removeChild方法的具体用法?C++ LLPanel::removeChild怎么用?C++ LLPanel::removeChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPanel
的用法示例。
在下文中一共展示了LLPanel::removeChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reparent
void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
{
LLPanel* parent = dynamic_cast<LLPanel*>(getParent());
if (!parent)
{
llwarns << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << llendl;
return;
}
if (move_view != NULL)
{
llassert(move_view != parent); // sanity check
// Save our original container.
if (!mOriginalParent.get())
mOriginalParent = parent->getHandle();
// Attach to movement controls.
parent->removeChild(this);
move_view->addChild(this);
// Origin must be set by movement controls.
mAttached = true;
}
else
{
if (!mOriginalParent.get())
{
llwarns << "Original parent of the stand / stop flying panel not found" << llendl;
return;
}
// Detach from movement controls.
parent->removeChild(this);
mOriginalParent.get()->addChild(this);
// update parent with self visibility (it is changed in setVisible()). EXT-4743
mOriginalParent.get()->setVisible(getVisible());
mAttached = false;
updatePosition(); // don't defer until next draw() to avoid flicker
}
// <FS:Zi> Make sure to resize the panel to fit the new parent. Important for
// proper layouting of the buttons. Skins should adapt the parent container.
if(getParent())
reshape(getParent()->getRect().getWidth(),getParent()->getRect().getHeight(),FALSE);
// </FS:Zi>
}
示例2: reparent
void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
{
LLPanel* parent = dynamic_cast<LLPanel*>(getParent());
if (!parent)
{
llwarns << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << llendl;
return;
}
if (move_view != NULL)
{
llassert(move_view != parent); // sanity check
// Save our original container.
if (!mOriginalParent.get())
mOriginalParent = parent->getHandle();
// Attach to movement controls.
parent->removeChild(this);
move_view->addChild(this);
// Origin must be set by movement controls.
mAttached = true;
}
else
{
if (!mOriginalParent.get())
{
llwarns << "Original parent of the stand / stop flying panel not found" << llendl;
return;
}
// Detach from movement controls.
parent->removeChild(this);
mOriginalParent.get()->addChild(this);
// update parent with self visibility (it is changed in setVisible()). EXT-4743
mOriginalParent.get()->setVisible(getVisible());
mAttached = false;
updatePosition(); // don't defer until next draw() to avoid flicker
}
}