本文整理汇总了C++中LLTextBox::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTextBox::setColor方法的具体用法?C++ LLTextBox::setColor怎么用?C++ LLTextBox::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTextBox
的用法示例。
在下文中一共展示了LLTextBox::setColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showType
void LLFloaterKeyTool::showType(LLKeyTool::LLKeyType key_type, LLAssetType::EType asset_type, isness result)
{
std::string name = LLKeyTool::aWhat(key_type, asset_type);
if((key_type == LLKeyTool::KT_ASSET) && (asset_type == LLAssetType::AT_COUNT))
name = "other assets";
LLTextBox* text = getChild<LLTextBox>(name, FALSE, FALSE);
if(!text)
{
text = new LLTextBox(name, LLRect(10, mListBottom + 20, getRect().mRight, mListBottom));
text->setFollowsTop();
text->setColor(LLColor4::white);
text->setHoverColor(LLColor4::white);
mListBottom -= 20;
addChild(text);
clickData* data = new clickData;
data->floater = this;
data->key_type = key_type;
data->asset_type = asset_type;
text->setCallbackUserData((void*)data);
//text->setClickedCallback(onClickType);
}
switch(result)
{
case YES:
if(gSavedSettings.getBOOL("KeyToolAutomaticOpen"))
{
LLKeyTool::openKey(mKey, key_type, asset_type);
}
if(gSavedSettings.getBOOL("KeyToolAutomaticClose"))
{
this->close(FALSE);
}
text->setColor(LLColor4::green);
break;
case NO:
text->setColor(LLColor4::grey);
break;
default:
text->setColor(LLColor4::white);
break;
}
}
示例2: setup
void setup(const LLChat& chat,const LLStyle::Params& style_params)
{
mAvatarID = chat.mFromID;
mSessionID = chat.mSessionID;
mSourceType = chat.mSourceType;
gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4));
//*TODO overly defensive thing, source type should be maintained out there
if (chat.mFromID.isNull() && (chat.mFromName.empty() || chat.mFromName == SYSTEM_FROM))
{
mSourceType = CHAT_SOURCE_SYSTEM;
}
LLTextBox* userName = getChild<LLTextBox>("user_name");
userName->setReadOnlyColor(style_params.readonly_color());
userName->setColor(style_params.color());
userName->setValue(chat.mFromName);
mFrom = chat.mFromName;
if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType)
{
mFrom = LLTrans::getString("SECOND_LIFE");
userName->setValue(mFrom);
}
mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING;
setTimeField(chat);
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
if(mSourceType != CHAT_SOURCE_AGENT)
icon->setDrawTooltip(false);
switch (mSourceType)
{
case CHAT_SOURCE_AGENT:
icon->setValue(chat.mFromID);
break;
case CHAT_SOURCE_OBJECT:
icon->setValue(LLSD("OBJECT_Icon"));
break;
case CHAT_SOURCE_SYSTEM:
icon->setValue(LLSD("SL_Logo"));
break;
case CHAT_SOURCE_UNKNOWN:
icon->setValue(LLSD("Unknown_Icon"));
}
}
示例3: icon_id
LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
const char* message,
const char* from_name,
const LLUUID& group_id,
const LLUUID& group_insignia,
const char* group_name,
const U32& t,
const bool& has_inventory,
const char* inventory_name,
LLOfferInfo* inventory_offer)
: LLPanel("groupnotify", LLGroupNotifyBox::getGroupNotifyRect(), BORDER_YES),
mAnimating(TRUE),
mTimer(),
mGroupID(group_id),
mHasInventory(has_inventory),
mInventoryOffer(inventory_offer)
{
mIsFocusRoot = TRUE;
time_t timestamp = (time_t)t;
if (!timestamp) time(×tamp);
std::string timestr;
timeToFormattedString(timestamp, gSavedSettings.getString("TimestampFormat"), timestr);
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 = mRect.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 = mRect.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;
// Title
LLTextBox* line;
line = new LLTextBox("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge);
line->setHAlign(LLFontGL::RIGHT);
line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
line->setBorderVisible(FALSE);
line->setColor(LLColor4::white);
line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
addChild(line);
y -= llfloor(1.5f*LINE_HEIGHT);
x += HPAD + HPAD + ICON_WIDTH;
std::stringstream from;
from << "Sent by " << from_name << ", " << group_name;
line = new LLTextBox("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif);
line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
line->setHAlign(LLFontGL::RIGHT);
line->setBorderVisible(FALSE);
line->setColor(LLColor4::white);
line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
addChild(line);
y -= (LINE_HEIGHT + VPAD);
LLUUID icon_id(gViewerArt.getString("notify_box_icon.tga"));
// TODO: change this to be the group icon.
if (!group_insignia.isNull())
{
icon_id = group_insignia;
}
x = HPAD + HPAD;
icon = new LLIconCtrl("icon",
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
icon_id);
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("box",
LLRect(x, y, RIGHT, box_bottom),
DB_GROUP_NOTICE_MSG_STR_LEN,
"",
//.........这里部分代码省略.........