本文整理汇总了C++中LLFloaterPay::getChildView方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterPay::getChildView方法的具体用法?C++ LLFloaterPay::getChildView怎么用?C++ LLFloaterPay::getChildView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterPay
的用法示例。
在下文中一共展示了LLFloaterPay::getChildView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onKeystroke
// static
void LLFloaterPay::onKeystroke(LLLineEditor*, void* data)
{
LLFloaterPay* self = reinterpret_cast<LLFloaterPay*>(data);
if(self)
{
// enable the Pay button when amount is non-empty and positive, disable otherwise
std::string amtstr = self->getChild<LLUICtrl>("amount")->getValue().asString();
self->getChildView("pay btn")->setEnabled(!amtstr.empty() && atoi(amtstr.c_str()) > 0);
}
}
示例2: payDirectly
void LLFloaterPay::payDirectly(money_callback callback,
const LLUUID& target_id,
bool is_group)
{
LLFloaterPay *floater = LLFloaterReg::showTypedInstance<LLFloaterPay>("pay_resident", LLSD(target_id));
if (!floater)
return;
floater->setCallback(callback);
floater->mObjectSelection = NULL;
floater->getChildView("amount")->setVisible(TRUE);
floater->getChildView("pay btn")->setVisible(TRUE);
floater->getChildView("amount text")->setVisible(TRUE);
floater->getChildView("fastpay text")->setVisible(TRUE);
for(S32 i=0;i<MAX_PAY_BUTTONS;++i)
{
floater->mQuickPayButton[i]->setVisible(TRUE);
}
floater->finishPayUI(target_id, is_group);
}
示例3: processPayPriceReply
// static
void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata)
{
LLFloaterPay* self = (LLFloaterPay*)userdata;
if (self)
{
S32 price;
LLUUID target;
msg->getUUIDFast(_PREHASH_ObjectData,_PREHASH_ObjectID,target);
if (target != self->mTargetUUID)
{
// This is a message for a different object's pay info
return;
}
msg->getS32Fast(_PREHASH_ObjectData,_PREHASH_DefaultPayPrice,price);
if (PAY_PRICE_HIDE == price)
{
self->getChildView("amount")->setVisible(FALSE);
self->getChildView("pay btn")->setVisible(FALSE);
self->getChildView("amount text")->setVisible(FALSE);
}
else if (PAY_PRICE_DEFAULT == price)
{
self->getChildView("amount")->setVisible(TRUE);
self->getChildView("pay btn")->setVisible(TRUE);
self->getChildView("amount text")->setVisible(TRUE);
}
else
{
// PAY_PRICE_HIDE and PAY_PRICE_DEFAULT are negative values
// So we take the absolute value here after we have checked for those cases
self->getChildView("amount")->setVisible(TRUE);
self->getChildView("pay btn")->setVisible(TRUE);
self->getChildView("pay btn")->setEnabled(TRUE);
self->getChildView("amount text")->setVisible(TRUE);
self->getChild<LLUICtrl>("amount")->setValue(llformat("%d", llabs(price)));
}
S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_ButtonData);
S32 i = 0;
if (num_blocks > MAX_PAY_BUTTONS) num_blocks = MAX_PAY_BUTTONS;
S32 max_pay_amount = 0;
S32 padding_required = 0;
for (i=0;i<num_blocks;++i)
{
S32 pay_button;
msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i);
if (pay_button > 0)
{
std::string button_str = "L$";
button_str += LLResMgr::getInstance()->getMonetaryString( pay_button );
self->mQuickPayButton[i]->setLabelSelected(button_str);
self->mQuickPayButton[i]->setLabelUnselected(button_str);
self->mQuickPayButton[i]->setVisible(TRUE);
self->mQuickPayInfo[i]->mAmount = pay_button;
self->getChildView("fastpay text")->setVisible(TRUE);
if ( pay_button > max_pay_amount )
{
max_pay_amount = pay_button;
}
}
else
{
self->mQuickPayButton[i]->setVisible(FALSE);
}
}
// build a string containing the maximum value and calc nerw button width from it.
std::string balance_str = "L$";
balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount );
const LLFontGL* font = LLFontGL::getFontSansSerif();
S32 new_button_width = font->getWidth( std::string(balance_str));
new_button_width += ( 12 + 12 ); // padding
// dialong is sized for 2 digit pay amounts - larger pay values need to be scaled
const S32 threshold = 100000;
if ( max_pay_amount >= threshold )
{
S32 num_digits_threshold = (S32)log10((double)threshold) + 1;
S32 num_digits_max = (S32)log10((double)max_pay_amount) + 1;
// calculate the extra width required by 2 buttons with max amount and some commas
padding_required = ( num_digits_max - num_digits_threshold + ( num_digits_max / 3 ) ) * font->getWidth( std::string("0") );
};
// change in button width
S32 button_delta = new_button_width - FASTPAY_BUTTON_WIDTH;
if ( button_delta < 0 )
button_delta = 0;
// now we know the maximum amount, we can resize all the buttons to be
//.........这里部分代码省略.........