diff options
| author | Palmer <palmer@lindenlab.com> | 2009-11-11 15:16:49 -0800 |
|---|---|---|
| committer | Palmer <palmer@lindenlab.com> | 2009-11-11 15:16:49 -0800 |
| commit | 6f3536d5979efa6db28098056ab5e3a158020225 (patch) | |
| tree | aae087995fa1c3df3cebbdf345fca7a2e7c1b548 /indra/llui/lltextbox.cpp | |
| parent | 7fa698252060a72be6b5ebc52f0ff01bcea6134c (diff) | |
| parent | 25d8cf689aa04a1bd4ebb336714730d29040d05c (diff) | |
Merged in viewer 2 changes, adjusted xui problems, added mesh folder type and more mesh inventory type info
Diffstat (limited to 'indra/llui/lltextbox.cpp')
| -rw-r--r-- | indra/llui/lltextbox.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 20bceb4675..00f1d833a3 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -45,6 +45,9 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p) mClickedCallback(NULL) {} +LLTextBox::~LLTextBox() +{} + BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLTextBase::handleMouseDown(x, y, mask); @@ -97,6 +100,18 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLTextBase::handleHover(x, y, mask); + if (!handled && mClickedCallback) + { + // Clickable text boxes change the cursor to a hand + LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } + return handled; +} + void LLTextBox::setText(const LLStringExplicit& text) { // does string argument insertion @@ -105,6 +120,11 @@ void LLTextBox::setText(const LLStringExplicit& text) LLTextBase::setText(mText.getString()); } +void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) +{ + mClickedCallback = boost::bind(cb, userdata); +} + S32 LLTextBox::getTextPixelWidth() { return getContentsRect().getWidth(); @@ -115,6 +135,12 @@ S32 LLTextBox::getTextPixelHeight() return getContentsRect().getHeight(); } + +LLSD LLTextBox::getValue() const +{ + return LLSD(getText()); +} + BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); |
