本文整理汇总了C++中LLPanel::setShape方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPanel::setShape方法的具体用法?C++ LLPanel::setShape怎么用?C++ LLPanel::setShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPanel
的用法示例。
在下文中一共展示了LLPanel::setShape方法的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);
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;
}
示例2: reshapeToPanel
void LLToast::reshapeToPanel()
{
LLPanel* panel = getPanel();
if(!panel)
return;
LLRect panel_rect = panel->getLocalRect();
panel->setShape(panel_rect);
LLRect toast_rect = getRect();
toast_rect.setLeftTopAndSize(toast_rect.mLeft, toast_rect.mTop,
panel_rect.getWidth() + getRightPad(), panel_rect.getHeight() + getTopPad());
setShape(toast_rect);
}
示例3: updateLayout
//.........这里部分代码省略.........
delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0;
shrink_headroom_available -= (cur_height - (*panel_it)->mMinDim);
}
else
{
delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels);
num_resizable_panels--;
}
pixels_to_distribute -= delta_size;
new_height = llmax((*panel_it)->mMinDim, cur_height + delta_size);
}
else
{
new_height = getDefaultHeight(new_height);
}
}
else
{
if (mOrientation == HORIZONTAL)
{
new_height = getDefaultHeight(new_height);
}
else // VERTICAL
{
new_width = getDefaultWidth(new_width);
}
}
// adjust running headroom count based on new sizes
shrink_headroom_total += delta_size;
LLRect panel_rect;
panel_rect.setLeftTopAndSize(cur_x, cur_y, new_width, new_height);
panelp->setShape(panel_rect);
LLRect resize_bar_rect = panel_rect;
if (mOrientation == HORIZONTAL)
{
resize_bar_rect.mLeft = panel_rect.mRight - resize_bar_overlap;
resize_bar_rect.mRight = panel_rect.mRight + mPanelSpacing + resize_bar_overlap;
}
else
{
resize_bar_rect.mTop = panel_rect.mBottom + resize_bar_overlap;
resize_bar_rect.mBottom = panel_rect.mBottom - mPanelSpacing - resize_bar_overlap;
}
(*panel_it)->mResizeBar->setRect(resize_bar_rect);
if (mOrientation == HORIZONTAL)
{
cur_x += llround(new_width * (*panel_it)->getCollapseFactor(mOrientation)) + mPanelSpacing;
}
else //VERTICAL
{
cur_y -= llround(new_height * (*panel_it)->getCollapseFactor(mOrientation)) + mPanelSpacing;
}
}
// update resize bars with new limits
LLResizeBar* last_resize_bar = NULL;
for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it)
{
LLPanel* panelp = (*panel_it);
if (mOrientation == HORIZONTAL)
{