diff options
author | Josh Bell <josh@lindenlab.com> | 2007-11-01 22:02:35 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-11-01 22:02:35 +0000 |
commit | 7afa8058aae0d5363cc19c7df1e6d2d7ec3bf7ac (patch) | |
tree | 52f41bda3e57a58e968421212a8a48eead6f653d /indra/newview/llviewertexteditor.cpp | |
parent | 833e8d5c2a1dd48fd89b8b438dbe56572697bb76 (diff) |
svn merge -r 72652:72881 svn+ssh://svn.lindenlab.com/svn/linden/branches/sl-search-11 --> release
QAR-11: pair-reviewed the merge w/ Sam.
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rw-r--r-- | indra/newview/llviewertexteditor.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 2c382cba67..1e75e421a1 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -53,8 +53,10 @@ #include "llviewerimagelist.h" #include "llviewerwindow.h" #include "llviewerinventory.h" +#include "llvieweruictrlfactory.h" #include "llnotecard.h" #include "llmemorystream.h" +#include "llmenugl.h" extern BOOL gPacificDaylightTime; @@ -567,6 +569,18 @@ LLViewerTextEditor::LLViewerTextEditor(const LLString& name, { mEmbeddedItemList = new LLEmbeddedItems(this); mInventoryCallback->setEditor(this); + + // Build the right click menu + // make the popup menu available + + LLMenuGL* menu = gUICtrlFactory->buildMenu("menu_slurl.xml", this); + if (!menu) + { + menu = new LLMenuGL(""); + } + menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); + // menu->setVisible(FALSE); + mPopupMenuHandle = menu->mViewHandle; } LLViewerTextEditor::~LLViewerTextEditor() @@ -732,6 +746,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) } // assume we're starting a drag select mIsSelecting = TRUE; + } else { @@ -941,6 +956,42 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + + + BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; + + if(! handled) + { + LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); + if( cur_segment ) + { + if(cur_segment->getStyle().isLink()) + { + handled = TRUE; + mHTML = cur_segment->getStyle().getLinkHREF(); + } + } + } + LLMenuGL* menu = (LLMenuGL*)LLView::getViewByHandle(mPopupMenuHandle); + if(handled && menu && mParseHTML && mHTML.length() > 0) + { + menu->setVisible(TRUE); + menu->arrange(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, menu, x, y); + mHTML = ""; + } + else + { + if(menu && menu->getVisible()) + { + menu->setVisible(FALSE); + } + } + return handled; +} BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { |