本文整理汇总了C++中LLUIString::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ LLUIString::getString方法的具体用法?C++ LLUIString::getString怎么用?C++ LLUIString::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLUIString
的用法示例。
在下文中一共展示了LLUIString::getString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSystemMessage
void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args)
{
LLUIString message;
// null session id means near me (chat history)
if (session_id.isNull())
{
LLFloaterChat* floaterp = LLFloaterChat::getInstance();
message = floaterp->getString(message_name);
message.setArgs(args);
LLChat chat(message);
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::getInstance()->addChatHistory(chat);
}
else // going to IM session
{
LLFloaterIMPanel* floaterp = findFloaterBySession(session_id);
if (floaterp)
{
message = floaterp->getString(message_name);
message.setArgs(args);
gIMMgr->addMessage(session_id, LLUUID::null, SYSTEM_FROM, message.getString());
}
}
}
示例2: resize
void LLButton::resize(LLUIString label)
{
// get label length
S32 label_width = mGLFont->getWidth(label.getString());
// get current btn length
S32 btn_width =getRect().getWidth();
// check if it need resize
if (mAutoResize == TRUE)
{
if (btn_width - (mRightHPad + mLeftHPad) < label_width)
{
setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mLeft + label_width + mLeftHPad + mRightHPad , getRect().mBottom));
}
}
}
示例3: refreshFromItem
void LLPreview::refreshFromItem()
{
const LLInventoryItem* item = getItem();
if (!item)
{
return;
}
if (hasString("Title"))
{
LLStringUtil::format_map_t args;
args["[NAME]"] = item->getName();
LLUIString title = getString("Title", args);
setTitle(title.getString());
}
getChild<LLUICtrl>("desc")->setValue(item->getDescription());
getChildView("desc")->setEnabled(canModify(mObjectUUID, item));
}
示例4: refreshFromItem
void LLPreview::refreshFromItem()
{
const LLInventoryItem* item = getItem();
if (!item)
{
return;
}
if (hasString("Title"))
{
LLStringUtil::format_map_t args;
args["[NAME]"] = item->getName();
LLUIString title = getString("Title", args);
setTitle(title.getString());
}
getChild<LLUICtrl>("desc")->setValue(item->getDescription());
BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID());
getChildView("desc")->setEnabled(can_agent_manipulate);
}
示例5: openEmbeddedTexture
void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc )
{
// *NOTE: Just for embedded Texture , we should use getAssetUUID(),
// not getUUID(), because LLPreviewTexture pass in AssetUUID into
// LLPreview constructor ItemUUID parameter.
if (!item)
return;
LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), TAKE_FOCUS_YES);
if (preview)
{
preview->setAuxItem( item );
preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
if (preview->hasString("Title"))
{
LLStringUtil::format_map_t args;
args["[NAME]"] = item->getName();
LLUIString title = preview->getString("Title", args);
preview->setTitle(title.getString());
}
preview->getChild<LLUICtrl>("desc")->setValue(item->getDescription());
}
}
示例6: resize
void LLButton::resize(LLUIString label)
{
// get label length
S32 label_width = mGLFont->getWidth(label.getString());
// get current btn length
S32 btn_width =getRect().getWidth();
// check if it need resize
if (mAutoResize)
{
S32 min_width = label_width + mLeftHPad + mRightHPad;
if (mImageOverlay)
{
S32 overlay_width = mImageOverlay->getWidth();
F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
overlay_width = ll_round((F32)overlay_width * scale_factor);
switch(mImageOverlayAlignment)
{
case LLFontGL::LEFT:
case LLFontGL::RIGHT:
min_width += overlay_width + mImgOverlayLabelSpace;
break;
case LLFontGL::HCENTER:
min_width = llmax(min_width, overlay_width + mLeftHPad + mRightHPad);
break;
default:
// draw nothing
break;
}
}
if (btn_width < min_width)
{
reshape(min_width, getRect().getHeight());
}
}
}
示例7: setClickThrough
// static
void LLPanelClassifiedInfo::setClickThrough(
const LLUUID& classified_id,
S32 teleport,
S32 map,
S32 profile,
bool from_new_table)
{
LL_INFOS() << "Click-through data for classified " << classified_id << " arrived: ["
<< teleport << ", " << map << ", " << profile << "] ("
<< (from_new_table ? "new" : "old") << ")" << LL_ENDL;
for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
{
LLPanelClassifiedInfo* self = *iter;
if (self->getClassifiedId() != classified_id)
{
continue;
}
// *HACK: Skip LLPanelClassifiedEdit instances: they don't display clicks data.
// Those instances should not be in the list at all.
if (typeid(*self) != typeid(LLPanelClassifiedInfo))
{
continue;
}
LL_INFOS() << "Updating classified info panel" << LL_ENDL;
// We need to check to see if the data came from the new stat_table
// or the old classified table. We also need to cache the data from
// the two separate sources so as to display the aggregate totals.
if (from_new_table)
{
self->mTeleportClicksNew = teleport;
self->mMapClicksNew = map;
self->mProfileClicksNew = profile;
}
else
{
self->mTeleportClicksOld = teleport;
self->mMapClicksOld = map;
self->mProfileClicksOld = profile;
}
static LLUIString ct_str = self->getString("click_through_text_fmt");
ct_str.setArg("[TELEPORT]", llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld));
ct_str.setArg("[MAP]", llformat("%d", self->mMapClicksNew + self->mMapClicksOld));
ct_str.setArg("[PROFILE]", llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld));
self->getChild<LLUICtrl>("click_through_text")->setValue(ct_str.getString());
// *HACK: remove this when there is enough room for click stats in the info panel
self->getChildView("click_through_text")->setToolTip(ct_str.getString());
LL_INFOS() << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld)
<< ", map: " << llformat("%d", self->mMapClicksNew + self->mMapClicksOld)
<< ", profile: " << llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)
<< LL_ENDL;
}
}
示例8: if
//.........这里部分代码省略.........
vote_cast = proposal_cell->getValue().asString();
}
// col 8: Vote Initiator
proposal_cell = item->getColumn(8);
if (proposal_cell)
{
//quorum
mQuorum->set(
(F32)atoi(proposal_cell->getValue().asString().c_str()));
}
else
{
mQuorum->set(0);
}
F32 majority = 0.0f;
proposal_cell = item->getColumn(9);
if (proposal_cell)
{
//majority
majority =
(F32)atof(proposal_cell->getValue().asString().c_str());
}
if(majority == 0.0f)
{ // Select the Simple Majority
mMajority->setSelectedIndex(0);
}
else if (majority == 1.0f)
{
//Select Unanimous
mMajority->setSelectedIndex(2);
}
else
{
//Select 2/3 Majority
mMajority->setSelectedIndex(1);
}
if (already_voted == "Yes")
{
LLUIString votestr = mPanel.getString("proposals_header_voted_inst");
votestr.setArg("[VOTE]", vote_cast);
mPanel.childSetText("proposal_instructions", votestr.getString());
mBtnYes->setEnabled(FALSE);
mBtnNo->setEnabled(FALSE);
mBtnAbstain->setEnabled(FALSE);
}
else
{
mPanel.childSetText("proposal_instructions", mPanel.getString("proposals_header_vote_inst"));
mBtnYes->setEnabled(TRUE);
mBtnNo->setEnabled(TRUE);
mBtnAbstain->setEnabled(TRUE);
}
mPanel.childSetText("proposal_header", mPanel.getString("proposals_header_vote_txt"));
mPanel.childSetVisible("proposal_lbl", TRUE);
mPanel.childSetVisible("proposal_voting_lbl", FALSE);
mProposals->setVisible(FALSE);
mProposalText->setEnabled(FALSE);
mProposalText->setVisible(TRUE);
mBtnYes->setVisible(TRUE);
mBtnNo->setVisible(TRUE);
mBtnAbstain->setVisible(TRUE);
mBtnSubmitProposal->setEnabled(FALSE);
mBtnSubmitProposal->setVisible(FALSE);
mBtnCreateProposal->setEnabled(FALSE);
mBtnCreateProposal->setVisible(FALSE);
mBtnCancelProposal->setEnabled(FALSE);
mBtnCancelProposal->setVisible(FALSE);
mBtnViewProposalItem->setEnabled(FALSE);
mBtnViewProposalItem->setVisible(FALSE);
mBtnViewProposalList->setEnabled(TRUE);
mBtnViewProposalList->setVisible(TRUE);
mQuorumLbl->setVisible(TRUE);
mQuorum->setEnabled(FALSE);
mQuorum->setVisible(TRUE);
mPanel.childSetVisible("quorum_text", TRUE);
mDurationLbl->setVisible(FALSE);
mDuration->setEnabled(FALSE);
mDuration->setVisible(FALSE);
mDurationText->setVisible(FALSE);
mMajorityLbl->setVisible(TRUE);
mMajority->setEnabled(FALSE);
mMajority->setVisible(TRUE);
mStartLbl->setVisible(TRUE);
mStartDate->setVisible(TRUE);
mEndLbl->setVisible(TRUE);
mEndDate->setVisible(TRUE);
}
}