本文整理汇总了C++中LLTextBox::setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextBox::setBackgroundColor方法的具体用法?C++ LLTextBox::setBackgroundColor怎么用?C++ LLTextBox::setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextBox
的用法示例。
在下文中一共展示了LLTextBox::setBackgroundColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: semi_transparent
LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
const std::string& message,
const std::string& from_name,
const LLUUID& group_id,
const LLUUID& group_insignia,
const std::string& group_name,
const U32& t,
const bool& has_inventory,
const std::string& inventory_name,
LLOfferInfo* inventory_offer)
: LLPanel(std::string("groupnotify"), LLGroupNotifyBox::getGroupNotifyRect(), BORDER_YES),
mAnimating(TRUE),
mTimer(),
mGroupID(group_id),
mHasInventory(has_inventory),
mInventoryOffer(inventory_offer)
{
setFocusRoot(TRUE);
time_t timestamp = (time_t)t;
std::string time_buf = g_formatted_time(timestamp);
setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
setBackgroundVisible(TRUE);
setBackgroundOpaque(TRUE);
// TODO: add a color for group notices
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
LLIconCtrl* icon;
LLTextEditor* text;
const S32 VPAD = 2;
const S32 TOP = getRect().getHeight() - 32; // Get past the top menu bar
const S32 BOTTOM_PAD = VPAD * 2;
const S32 BTN_TOP = BOTTOM_PAD + BTN_HEIGHT + VPAD;
const S32 RIGHT = getRect().getWidth() - HPAD - HPAD;
const S32 LINE_HEIGHT = 16;
const S32 LABEL_WIDTH = 64;
const S32 ICON_WIDTH = 64;
S32 y = TOP;
S32 x = HPAD + HPAD;
class NoticeText : public LLTextBox
{
public:
NoticeText(const std::string& name, const LLRect& rect, const std::string& text = LLStringUtil::null, const LLFontGL* font = NULL)
: LLTextBox(name, rect, text, font)
{
setHAlign(LLFontGL::RIGHT);
setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
setBorderVisible(FALSE);
setColor( gColors.getColor("GroupNotifyTextColor") );
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
}
};
// Title
addChild(new NoticeText(std::string("title"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),std::string("Group Notice"),LLFontGL::sSansSerifHuge));
y -= llfloor(1.5f*LINE_HEIGHT);
x += HPAD + HPAD + ICON_WIDTH;
std::stringstream from;
from << "Sent by " << from_name << ", " << group_name;
addChild(new NoticeText(std::string("group"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str(),LLFontGL::sSansSerif));
y -= (LINE_HEIGHT + VPAD);
x = HPAD + HPAD;
// TODO: change this to be the group icon.
if (!group_insignia.isNull())
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
group_insignia);
}
else
{
icon = new LLIconCtrl(std::string("icon"),
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
std::string("notify_box_icon.tga"));
}
icon->setMouseOpaque(FALSE);
addChild(icon);
x += HPAD + HPAD + ICON_WIDTH;
// If we have inventory with this message, leave room for the name.
S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*VPAD) : 0);
text = new LLViewerTextEditor(std::string("box"),
LLRect(x, y, RIGHT, box_bottom),
DB_GROUP_NOTICE_MSG_STR_LEN,
//.........这里部分代码省略.........