diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2009-11-12 09:23:57 -0800 |
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-12 09:23:57 -0800 |
| commit | 3dd79ad226bc8e0aec18dba87223a3f50ecf360b (patch) | |
| tree | 2af4f4e5d50d35065dda3101b60b40a3c1c21aee /indra/newview/llspeakbutton.cpp | |
| parent | 72af8dc3f0a249f69869bc6f52dd7a887702a964 (diff) | |
| parent | 7a45dec2d540581ef080386e4a967befd22b6adb (diff) | |
merge
Diffstat (limited to 'indra/newview/llspeakbutton.cpp')
| -rw-r--r-- | indra/newview/llspeakbutton.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index cd765b0338..51d53b2674 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -62,6 +62,14 @@ LLSpeakButton::Params::Params() // See widgets/talk_button.xml } +void LLSpeakButton::draw() +{ + // gVoiceClient is the authoritative global source of info regarding our open-mic state, we merely reflect that state. + bool openmic = gVoiceClient->getUserPTTState(); + mSpeakBtn->setToggleState(openmic); + LLUICtrl::draw(); +} + LLSpeakButton::LLSpeakButton(const Params& p) : LLUICtrl(p) , mPrivateCallPanel(NULL) @@ -84,7 +92,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) addChild(mSpeakBtn); LLTransientFloaterMgr::getInstance()->addControlView(mSpeakBtn); - mSpeakBtn->setClickedCallback(boost::bind(&LLSpeakButton::onClick_SpeakBtn, this)); + mSpeakBtn->setMouseDownCallback(boost::bind(&LLSpeakButton::onMouseDown_SpeakBtn, this)); + mSpeakBtn->setMouseUpCallback(boost::bind(&LLSpeakButton::onMouseUp_SpeakBtn, this)); mSpeakBtn->setToggleState(FALSE); LLButton::Params show_params = p.show_button; @@ -120,17 +129,29 @@ LLSpeakButton::LLSpeakButton(const Params& p) LLSpeakButton::~LLSpeakButton() { + LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn); + LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); +} + +void LLSpeakButton::setSpeakToolTip(const std::string& msg) +{ + mSpeakBtn->setToolTip(msg); } -void LLSpeakButton::setSpeakBtnToggleState(bool state) +void LLSpeakButton::setShowToolTip(const std::string& msg) { - mSpeakBtn->setToggleState(state); + mShowBtn->setToolTip(msg); } -void LLSpeakButton::onClick_SpeakBtn() +void LLSpeakButton::onMouseDown_SpeakBtn() +{ + bool down = true; + gVoiceClient->inputUserControlState(down); // this method knows/care about whether this translates into a toggle-to-talk or down-to-talk +} +void LLSpeakButton::onMouseUp_SpeakBtn() { - bool speaking = mSpeakBtn->getToggleState(); - gVoiceClient->setUserPTTState(speaking); + bool down = false; + gVoiceClient->inputUserControlState(down); } void LLSpeakButton::onClick_ShowBtn() |
