本文整理汇总了C++中LLUIString::setArg方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUIString::setArg方法的具体用法?C++ LLUIString::setArg怎么用?C++ LLUIString::setArg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUIString
的用法示例。
在下文中一共展示了LLUIString::setArg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
if (!sInstance)
{
new LLFloaterBump();
}
if (mcd->mFirstName.empty() || list->getItemCount() >= 20)
{
return;
}
// There's only one internal tm buffer.
struct tm* timep;
// Convert to Pacific, based on server's opinion of whether
// it's daylight savings time there.
timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
std::string time = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min);
std::string action;
switch(mcd->mType)
{
case MEAN_BUMP:
action = "bump";
break;
case MEAN_LLPUSHOBJECT:
action = "llpushobject";
break;
case MEAN_SELECTED_OBJECT_COLLIDE:
action = "selected_object_collide";
break;
case MEAN_SCRIPTED_OBJECT_COLLIDE:
action = "scripted_object_collide";
break;
case MEAN_PHYSICAL_OBJECT_COLLIDE:
action = "physical_object_collide";
break;
default:
llinfos << "LLFloaterBump::add unknown mean collision type "
<< mcd->mType << llendl;
return;
}
// All above action strings are in XML file
LLUIString text = sInstance->getString(action);
text.setArg("[TIME]", time);
text.setArg("[FIRST]", mcd->mFirstName);
text.setArg("[LAST]", mcd->mLastName);
LLSD row;
row["id"] = mcd->mPerp;
row["columns"][0]["value"] = text;
row["columns"][0]["font"] = "SansSerifBold";
list->addElement(row);
//@hook OnBump(action,time,firstname,lastname) You were bumped by something
LUA_CALL("OnBump") << action << time << mcd->mFirstName << mcd->mLastName << LUA_END;
}
示例2: addAgent
void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
{
std::string first, last;
gCacheName->getName(uuid, first, last);
LLUIString fullname = sNameFormat;
fullname.setArg("[FIRST]", first);
fullname.setArg("[LAST]", last);
LLSD row;
row["id"] = uuid;
row["columns"][0]["value"] = fullname;
row["columns"][0]["width"] = COL_1_WIDTH;
row["columns"][0]["font"] = "SANSSERIF";
row["columns"][0]["font-style"] = online ? "BOLD" : "NORMAL";
row["columns"][1]["value"] = online ? sOnlineDescriptor : "";
row["columns"][1]["font"] = "SANSSERIF";
row["columns"][1]["font-style"] = "BOLD";
LLScrollListItem* itemp = mSelectionList->addElement(row);
itemp->setUserdata(data);
if (mSelectionList->getFirstSelectedIndex() == -1)
{
mSelectionList->selectFirstItem();
}
}
示例3: noteOfflineUsers
void LLIMMgr::noteOfflineUsers(
LLFloaterIMPanel* floater,
const LLDynamicArray<LLUUID>& ids)
{
S32 count = ids.count();
if(count == 0)
{
floater->addHistoryLine(sOnlyUserMessage, gSavedSettings.getColor4("SystemChatColor"));
}
else
{
const LLRelationship* info = NULL;
LLAvatarTracker& at = LLAvatarTracker::instance();
for(S32 i = 0; i < count; ++i)
{
info = at.getBuddyInfo(ids.get(i));
std::string first, last;
if(info && !info->isOnline()
&& gCacheName->getName(ids.get(i), first, last))
{
LLUIString offline = sOfflineMessage;
offline.setArg("[FIRST]", first);
offline.setArg("[LAST]", last);
floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
floater->setOffline();
}
}
}
}
示例4: add
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
if (mcd->mFullName.empty() || list->getItemCount() >= 20)
{
return;
}
// There's only one internal tm buffer.
// Convert to Pacific, based on server's opinion of whether
// it's daylight savings time there.
tm* timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
std::string timeStr = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min);
std::string action;
switch(mcd->mType)
{
case MEAN_BUMP:
action = "bump";
break;
case MEAN_LLPUSHOBJECT:
action = "llpushobject";
break;
case MEAN_SELECTED_OBJECT_COLLIDE:
action = "selected_object_collide";
break;
case MEAN_SCRIPTED_OBJECT_COLLIDE:
action = "scripted_object_collide";
break;
case MEAN_PHYSICAL_OBJECT_COLLIDE:
action = "physical_object_collide";
break;
default:
LL_INFOS() << "LLFloaterBump::add unknown mean collision type "
<< mcd->mType << LL_ENDL;
return;
}
// All above action strings are in XML file
LLUIString text = getString(action);
text.setArg("[TIME]", timeStr);
text.setArg("[NAME]", mcd->mFullName);
LLSD row;
row["id"] = mcd->mPerp;
row["columns"][0]["value"] = text;
row["columns"][0]["font"] = "SansSerifBold";
list->addElement(row);
}
示例5: add
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
if (mcd->mFirstName.empty() || list->getItemCount() >= 20)
{
return;
}
std::string timeStr = getString ("timeStr");
LLSD substitution;
substitution["datetime"] = (S32) mcd->mTime;
LLStringUtil::format (timeStr, substitution);
std::string action;
switch(mcd->mType)
{
case MEAN_BUMP:
action = "bump";
break;
case MEAN_LLPUSHOBJECT:
action = "llpushobject";
break;
case MEAN_SELECTED_OBJECT_COLLIDE:
action = "selected_object_collide";
break;
case MEAN_SCRIPTED_OBJECT_COLLIDE:
action = "scripted_object_collide";
break;
case MEAN_PHYSICAL_OBJECT_COLLIDE:
action = "physical_object_collide";
break;
default:
llinfos << "LLFloaterBump::add unknown mean collision type "
<< mcd->mType << llendl;
return;
}
// All above action strings are in XML file
LLUIString text = getString(action);
text.setArg("[TIME]", timeStr);
text.setArg("[FIRST]", mcd->mFirstName);
text.setArg("[LAST]", mcd->mLastName);
LLSD row;
row["id"] = mcd->mPerp;
row["columns"][0]["value"] = text;
row["columns"][0]["font"] = "SansSerifBold";
list->addElement(row);
}
示例6: buy
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
if (!canBuy())
{
return;
}
LLUIString msg = buy_msg;
msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
msg.setArg("[LOCALAMOUNT]", getLocalEstimate());
LLConfirmationManager::confirm(impl.mSiteConfirm,
msg,
impl,
&LLCurrencyUIManager::Impl::startCurrencyBuy);
}
示例7: buy
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
if (!canBuy())
{
return;
}
LLUIString msg = buy_msg;
msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
msg.setArg("[USD]", llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0));
LLConfirmationManager::confirm(impl.mSiteConfirm,
msg,
impl,
&LLCurrencyUIManager::Impl::startCurrencyBuy);
}
示例8: postBuild
BOOL LLFloaterLandHoldings::postBuild()
{
childSetAction("Teleport", onClickTeleport, this);
childSetAction("Show on Map", onClickMap, this);
// Grant list
childSetDoubleClickCallback("grant list", onGrantList);
childSetUserData("grant list", this);
LLCtrlListInterface *list = childGetListInterface("grant list");
if (!list) return TRUE;
S32 count = gAgent.mGroups.count();
for(S32 i = 0; i < count; ++i)
{
LLUUID id(gAgent.mGroups.get(i).mID);
LLSD element;
element["id"] = id;
element["columns"][0]["column"] = "group";
element["columns"][0]["value"] = gAgent.mGroups.get(i).mName;
element["columns"][0]["font"] = "SANSSERIF";
LLUIString areastr = getString("area_string");
areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution));
element["columns"][1]["column"] = "area";
element["columns"][1]["value"] = areastr;
element["columns"][1]["font"] = "SANSSERIF";
list->addElement(element, ADD_SORTED);
}
return TRUE;
}
示例9: noteOfflineUsers
void LLIMMgr::noteOfflineUsers(
LLFloaterIMPanel* floater,
const std::vector<LLUUID>& ids)
{
S32 count = ids.size();
if(count == 0)
{
const std::string& only_user = LLTrans::getString("only_user_message");
floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor"));
}
else
{
const LLRelationship* info = NULL;
LLAvatarTracker& at = LLAvatarTracker::instance();
for(S32 i = 0; i < count; ++i)
{
info = at.getBuddyInfo(ids.at(i));
std::string full_name;
if (info
&& !info->isOnline()
&& LLAvatarNameCache::getNSName(ids.at(i), full_name))
{
LLUIString offline = LLTrans::getString("offline_message");
offline.setArg("[NAME]", full_name);
floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor"));
}
}
}
}
示例10: buy
void LLCurrencyUIManager::buy(const std::string& buy_msg)
{
if (!canBuy())
{
return;
}
LLUIString msg = buy_msg;
msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy));
msg.setArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
msg.setArg("[USD]", llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0));
msg.setArg("[REALCURRENCY]", gHippoGridManager->getConnectedGrid()->getRealCurrencySymbol());
LLConfirmationManager::confirm(impl.mSiteConfirm,
msg,
impl,
&LLCurrencyUIManager::Impl::startCurrencyBuy);
}
示例11: getOfflineMessage
std::string LLIMMgr::getOfflineMessage(const LLUUID& id)
{
std::string full_name;
if (LLAvatarNameCache::getNSName(id, full_name))
{
LLUIString offline = LLTrans::getString("offline_message");
offline.setArg("[NAME]", full_name);
return offline;
}
return LLStringUtil::null;
}
示例12: postBuild
BOOL LLFloaterJoystick::postBuild()
{
F32 range = gSavedSettings.getBOOL("Cursor3D") ? 1024.f : 2.f;
LLUIString axis = getString("Axis");
LLUIString joystick = getString("JoystickMonitor");
// use this child to get relative positioning info; we'll place the
// joystick monitor on its right, vertically aligned to it.
LLView* child = getChild<LLView>("FlycamAxisScale1");
LLRect rect;
if (child)
{
LLRect r = child->getRect();
rect = LLRect(350, r.mTop, r.mRight + 200, 0);
}
LLStatView::Params params;
params.name("axis values");
params.rect(rect);
params.show_label(true);
params.label(joystick);
mAxisStatsView = LLUICtrlFactory::create<LLStatView>(params);
for (U32 i = 0; i < 6; i++)
{
axis.setArg("[NUM]", llformat("%d", i));
std::string stat_name(llformat("Joystick axis %d", i));
mAxisStats[i] = new LLStat(stat_name,4);
mAxisStatsBar[i] = mAxisStatsView->addStat(axis, mAxisStats[i]);
mAxisStatsBar[i]->mMinBar = -range;
mAxisStatsBar[i]->mMaxBar = range;
mAxisStatsBar[i]->mLabelSpacing = range * 0.5f;
mAxisStatsBar[i]->mTickSpacing = range * 0.25f;
}
addChild(mAxisStatsView);
mCheckJoystickEnabled = getChild<LLCheckBoxCtrl>("enable_joystick");
childSetCommitCallback("enable_joystick",onCommitJoystickEnabled,this);
mCheckFlycamEnabled = getChild<LLCheckBoxCtrl>("JoystickFlycamEnabled");
childSetCommitCallback("JoystickFlycamEnabled",onCommitJoystickEnabled,this);
getChild<LLUICtrl>("Default")->setCommitCallback(boost::bind(&LLFloaterJoystick::onClickDefault, this, _2));
childSetAction("cancel_btn", onClickCancel, this);
childSetAction("ok_btn", onClickOK, this);
refresh();
return TRUE;
}
示例13: show
// static
void LLFloaterJoystick::show(void*)
{
if (sInstance)
{
sInstance->open(); /*Flawfinder: ignore*/
}
else
{
LLFloaterJoystick* floater = new LLFloaterJoystick();
gUICtrlFactory->buildFloater(floater, "floater_joystick.xml");
F32 range = gSavedSettings.getBOOL("FlycamAbsolute") ? 1024.f : 2.f;
LLUIString axis = floater->childGetText("Axis");
LLUIString joystick = floater->childGetText("JoystickMonitor");
LLView* child = floater->getChildByName("ZoomLabel");
LLRect rect;
if (child)
{
LLRect r = child->getRect();
LLRect f = floater->getRect();
rect = LLRect(150, r.mTop, r.mRight, 0);
}
floater->mAxisStats = new LLStatView("axis values", joystick, "", rect);
floater->mAxisStats->setDisplayChildren(TRUE);
for (U32 i = 0; i < 6; i++)
{
axis.setArg("[NUM]", llformat("%d", i));
floater->mAxis[i] = new LLStat(4);
floater->mAxisBar[i] = floater->mAxisStats->addStat(axis, floater->mAxis[i]);
floater->mAxisBar[i]->mMinBar = -range;
floater->mAxisBar[i]->mMaxBar = range;
floater->mAxisBar[i]->mLabelSpacing = range * 0.5f;
floater->mAxisBar[i]->mTickSpacing = range * 0.25f;
}
floater->addChild(floater->mAxisStats);
floater->open(); /*Flawfinder: ignore*/
}
}
示例14: processProperties
void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType type)
{
if(APT_CLASSIFIED_INFO == type)
{
LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data);
if(c_info && getClassifiedId() == c_info->classified_id)
{
setClassifiedName(c_info->name);
setDescription(c_info->description);
setSnapshotId(c_info->snapshot_id);
setParcelId(c_info->parcel_id);
setPosGlobal(c_info->pos_global);
setSimName(c_info->sim_name);
setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global));
getChild<LLUICtrl>("category")->setValue(LLClassifiedInfo::sCategories[c_info->category]);
static std::string mature_str = getString("type_mature");
static std::string pg_str = getString("type_pg");
static LLUIString price_str = getString("l$_price");
static std::string date_fmt = getString("date_fmt");
bool mature = is_cf_mature(c_info->flags);
getChild<LLUICtrl>("content_type")->setValue(mature ? mature_str : pg_str);
getChild<LLIconCtrl>("content_type_moderate")->setVisible(mature);
getChild<LLIconCtrl>("content_type_general")->setVisible(!mature);
std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ?
getString("auto_renew_on") : getString("auto_renew_off");
getChild<LLUICtrl>("auto_renew")->setValue(auto_renew_str);
price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing));
getChild<LLUICtrl>("price_for_listing")->setValue(LLSD(price_str));
std::string date_str = date_fmt;
LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date));
getChild<LLUICtrl>("creation_date")->setValue(date_str);
setInfoLoaded(true);
}
}
}
示例15: postBuild
BOOL LLFloaterLandHoldings::postBuild()
{
childSetAction("Teleport", onClickTeleport, this);
childSetAction("Show on Map", onClickMap, this);
// Grant list
LLScrollListCtrl *grant_list = getChild<LLScrollListCtrl>("grant list");
grant_list->setDoubleClickCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, grant_list)));
LLCtrlListInterface *list = grant_list->getListInterface();
if (!list) return TRUE;
S32 count = gAgent.mGroups.size();
for(S32 i = 0; i < count; ++i)
{
LLUUID id(gAgent.mGroups.at(i).mID);
LLSD element;
element["id"] = id;
element["columns"][0]["column"] = "group";
element["columns"][0]["value"] = gAgent.mGroups.at(i).mName;
element["columns"][0]["font"] = "SANSSERIF";
LLUIString areastr = getString("area_string");
areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.at(i).mContribution));
element["columns"][1]["column"] = "area";
element["columns"][1]["value"] = areastr;
element["columns"][1]["font"] = "SANSSERIF";
list->addElement(element, ADD_SORTED);
}
center();
return TRUE;
}