本文整理汇总了C++中LLIconCtrl::setRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LLIconCtrl::setRect方法的具体用法?C++ LLIconCtrl::setRect怎么用?C++ LLIconCtrl::setRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLIconCtrl
的用法示例。
在下文中一共展示了LLIconCtrl::setRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
if (hasTitleBar())
{
dialog_height += LINE_HEIGHT; // room for title bar
}
// it's ok for the edit text body to be empty, but we want the name to exist if we're going to draw it
if (!edit_text_name.empty())
{
dialog_height += EDITOR_HEIGHT + VPAD;
dialog_width = llmax(dialog_width, (S32)(font->getWidth( edit_text_contents ) + 0.99f));
}
if (mCaution)
{
// Make room for the caution icon.
dialog_width += 32 + HPAD;
}
LLToastPanel::reshape( dialog_width, dialog_height, FALSE );
S32 msg_y = LLToastPanel::getRect().getHeight() - VPAD;
S32 msg_x = HPAD;
if (hasTitleBar())
{
msg_y -= LINE_HEIGHT; // room for title
}
static LLUIColor alert_caution_text_color = LLUIColorTable::instance().getColor("AlertCautionTextColor");
if (mCaution)
{
LLIconCtrl* icon = LLUICtrlFactory::getInstance()->createFromFile<LLIconCtrl>("alert_icon.xml", this, LLPanel::child_registry_t::instance());
if(icon)
{
icon->setRect(LLRect(msg_x, msg_y, msg_x+32, msg_y-32));
LLToastPanel::addChild(icon);
}
msg_x += 32 + HPAD;
msg_box->setColor( alert_caution_text_color );
}
LLRect rect;
rect.setLeftTopAndSize( msg_x, msg_y, text_rect.getWidth(), text_rect.getHeight() );
msg_box->setRect( rect );
LLToastPanel::addChild(msg_box);
// (Optional) Edit Box
if (!edit_text_name.empty())
{
S32 y = VPAD + BTN_HEIGHT + VPAD/2;
mLineEditor = LLUICtrlFactory::getInstance()->createFromFile<LLLineEditor>("alert_line_editor.xml", this, LLPanel::child_registry_t::instance());
if (mLineEditor)
{
LLRect leditor_rect = LLRect( HPAD, y+EDITOR_HEIGHT, dialog_width-HPAD, y);
mLineEditor->setName(edit_text_name);
mLineEditor->reshape(leditor_rect.getWidth(), leditor_rect.getHeight());
mLineEditor->setRect(leditor_rect);
mLineEditor->setMaxTextChars(edit_text_max_chars);
mLineEditor->setText(edit_text_contents);
// decrease limit of line editor of teleport offer dialog to avoid truncation of
// location URL in invitation message, see EXT-6891
if ("OfferTeleport" == mNotification->getName())
{
mLineEditor->setMaxTextLength(gSavedSettings.getS32(