本文整理汇总了C++中LLCurrencyUIManager::getEstimate方法的典型用法代码示例。如果您正苦于以下问题:C++ LLCurrencyUIManager::getEstimate方法的具体用法?C++ LLCurrencyUIManager::getEstimate怎么用?C++ LLCurrencyUIManager::getEstimate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLCurrencyUIManager
的用法示例。
在下文中一共展示了LLCurrencyUIManager::getEstimate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runWebSitePrep
void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password)
{
if (!mCanBuy)
{
return;
}
BOOL remove_contribution = childGetValue("remove_contribution").asBoolean();
mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(),
gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution);
if (mParcelBuyInfo
&& !mSiteMembershipUpgrade
&& !mSiteLandUseUpgrade
&& mCurrency.getAmount() == 0
&& mSiteConfirm != "password")
{
sendBuyLand();
return;
}
std::string newLevel = "noChange";
if (mSiteMembershipUpgrade)
{
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
mUserPlanChoice = levels->getCurrentIndex();
newLevel = mSiteMembershipPlanIDs[mUserPlanChoice];
}
}
LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct();
keywordArgs.appendString("agentId", gAgent.getID().asString());
keywordArgs.appendString(
"secureSessionId",
gAgent.getSecureSessionID().asString());
keywordArgs.appendString("levelId", newLevel);
keywordArgs.appendInt("billableArea",
mIsForGroup ? 0 : mParcelBillableArea);
keywordArgs.appendInt("currencyBuy", mCurrency.getAmount());
keywordArgs.appendInt("estimatedCost", mCurrency.getEstimate());
keywordArgs.appendString("confirm", mSiteConfirm);
if (!password.empty())
{
keywordArgs.appendString("password", password);
}
LLXMLRPCValue params = LLXMLRPCValue::createArray();
params.append(keywordArgs);
startTransaction(TransactionBuy, params);
}
示例2: startBuyPreConfirm
void LLFloaterBuyLandUI::startBuyPreConfirm()
{
std::string action;
if (mSiteMembershipUpgrade)
{
action += mSiteMembershipAction;
action += "\n";
LLComboBox* levels = getChild<LLComboBox>( "account_level");
if (levels)
{
action += " * ";
action += mSiteMembershipPlanNames[levels->getCurrentIndex()];
action += "\n";
}
}
if (mSiteLandUseUpgrade)
{
action += mSiteLandUseAction;
action += "\n";
}
if (mCurrency.getAmount() > 0)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount());
string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0);
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("buy_for_US", string_args);
}
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice);
string_args["[SELLER]"] = mParcelSellerName;
string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
action += getString("pay_to_for_land", string_args);
LLConfirmationManager::confirm(mSiteConfirm,
action,
*this,
&LLFloaterBuyLandUI::startBuyPostConfirm);
}
示例3: refreshUI
//.........这里部分代码省略.........
childHide("land_use_action");
childHide("land_use_reason");
}
// section three: purchase & currency
S32 finalBalance = mAgentCashBalance + mCurrency.getAmount() - mParcelPrice;
bool willHaveEnough = finalBalance >= 0;
bool haveEnough = mAgentCashBalance >= mParcelPrice;
S32 minContribution = llceil((F32)mParcelBillableArea / GROUP_LAND_BONUS_FACTOR);
bool groupContributionEnough = mParcelGroupContribution >= minContribution;
mCurrency.updateUI(!showingError && !haveEnough);
if (!showingError)
{
mChildren.setBadge(std::string("step_3"),
!willHaveEnough
? LLViewChildren::BADGE_WARN
: mCurrency.getAmount() > 0
? LLViewChildren::BADGE_NOTE
: LLViewChildren::BADGE_OK);
childSetText("purchase_action",
llformat(
"Pay I'z$ %d to %s for this land",
mParcelPrice,
mParcelSellerName.c_str()
));
childSetVisible("purchase_action", mParcelValid);
std::string reasonString;
if (haveEnough)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance);
childSetText("currency_reason", getString("have_enough_lindens", string_args));
}
else
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance);
string_args["[AMOUNT2]"] = llformat("%d", mParcelPrice - mAgentCashBalance);
childSetText("currency_reason", getString("not_enough_lindens", string_args));
childSetTextArg("currency_est", "[AMOUNT2]", llformat("%#.2f", mCurrency.getEstimate() / 100.0));
}
if (willHaveEnough)
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", finalBalance);
childSetText("currency_balance", getString("balance_left", string_args));
}
else
{
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance);
childSetText("currency_balance", getString("balance_needed", string_args));
}
childSetValue("remove_contribution", LLSD(groupContributionEnough));
childSetEnabled("remove_contribution", groupContributionEnough);
bool showRemoveContribution = mParcelIsGroupLand
&& (mParcelGroupContribution > 0);
childSetLabelArg("remove_contribution", "[AMOUNT]",
llformat("%d", minContribution));
childSetVisible("remove_contribution", showRemoveContribution);
childShow("step_3");
childShow("purchase_action");
childShow("currency_reason");
childShow("currency_balance");
}
else
{
childHide("step_3");
childHide("purchase_action");
childHide("currency_reason");
childHide("currency_balance");
childHide("remove_group_donation");
}
bool agrees_to_covenant = false;
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
if (check)
{
agrees_to_covenant = check->get();
}
childSetEnabled("buy_btn",
mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant);
}