diff options
author | Merov Linden <merov@lindenlab.com> | 2010-12-08 21:52:19 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-12-08 21:52:19 -0800 |
commit | 03b74be7fd180e43e3baa44c86a328cf5999f8ab (patch) | |
tree | f08c7520800e663b319e3e8962f1ae3cf2d59042 /indra/newview/llstatusbar.cpp | |
parent | 39e4303653a2eb4e6582fdea9646db8b29f96805 (diff) |
STORM-524 : Add a click event on the L$ balance so to force refresh its content, modified tooltip to mention this
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r-- | indra/newview/llstatusbar.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index e9fc25404a..1b8be7a5b2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -115,6 +115,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mSGBandwidth(NULL), mSGPacketLoss(NULL), mBtnVolume(NULL), + mBoxBalance(NULL), mBalance(0), mHealth(100), mSquareMetersCredit(0), @@ -168,6 +169,9 @@ BOOL LLStatusBar::postBuild() getChild<LLUICtrl>("buyL")->setCommitCallback( boost::bind(&LLStatusBar::onClickBuyCurrency, this)); + mBoxBalance = getChild<LLTextBox>("balance"); + mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); + mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); @@ -304,6 +308,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) { mTextTime->setVisible(visible); getChild<LLUICtrl>("balance_bg")->setVisible(visible); + mBoxBalance->setVisible(visible); mBtnVolume->setVisible(visible); mMediaToggle->setVisible(visible); mSGBandwidth->setVisible(visible); @@ -330,16 +335,15 @@ void LLStatusBar::setBalance(S32 balance) std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); - LLTextBox* balance_box = getChild<LLTextBox>("balance"); LLStringUtil::format_map_t string_args; string_args["[AMT]"] = llformat("%s", money_str.c_str()); std::string label_str = getString("buycurrencylabel", string_args); - balance_box->setValue(label_str); + mBoxBalance->setValue(label_str); // Resize the L$ balance background to be wide enough for your balance plus the buy button { const S32 HPAD = 24; - LLRect balance_rect = balance_box->getTextBoundingRect(); + LLRect balance_rect = mBoxBalance->getTextBoundingRect(); LLRect buy_rect = getChildView("buyL")->getRect(); LLView* balance_bg_view = getChildView("balance_bg"); LLRect balance_bg_rect = balance_bg_view->getRect(); @@ -506,6 +510,14 @@ static void onClickVolume(void* data) } //static +void LLStatusBar::onClickBalance(void* ) +{ + // Force a balance request message: + LLStatusBar::sendMoneyBalanceRequest(); + // The refresh of the display (call to setBalance()) will be done by process_money_balance_reply() +} + +//static void LLStatusBar::onClickMediaToggle(void* data) { LLStatusBar *status_bar = (LLStatusBar*)data; |