diff options
author | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
commit | 3f27ba891ac4d032753b219b4b96d1ffbc9fb488 (patch) | |
tree | 504932ee91a0356fba7ea48798887c96867e492f /linden/indra/newview/llviewertexteditor.cpp | |
parent | Second Life viewer sources 1.18.4.3 (diff) | |
download | meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.zip meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.gz meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.bz2 meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.xz |
Second Life viewer sources 1.18.5.0-RC
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.cpp')
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 2c382cb..1e75e42 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -53,8 +53,10 @@ | |||
53 | #include "llviewerimagelist.h" | 53 | #include "llviewerimagelist.h" |
54 | #include "llviewerwindow.h" | 54 | #include "llviewerwindow.h" |
55 | #include "llviewerinventory.h" | 55 | #include "llviewerinventory.h" |
56 | #include "llvieweruictrlfactory.h" | ||
56 | #include "llnotecard.h" | 57 | #include "llnotecard.h" |
57 | #include "llmemorystream.h" | 58 | #include "llmemorystream.h" |
59 | #include "llmenugl.h" | ||
58 | 60 | ||
59 | extern BOOL gPacificDaylightTime; | 61 | extern BOOL gPacificDaylightTime; |
60 | 62 | ||
@@ -567,6 +569,18 @@ LLViewerTextEditor::LLViewerTextEditor(const LLString& name, | |||
567 | { | 569 | { |
568 | mEmbeddedItemList = new LLEmbeddedItems(this); | 570 | mEmbeddedItemList = new LLEmbeddedItems(this); |
569 | mInventoryCallback->setEditor(this); | 571 | mInventoryCallback->setEditor(this); |
572 | |||
573 | // Build the right click menu | ||
574 | // make the popup menu available | ||
575 | |||
576 | LLMenuGL* menu = gUICtrlFactory->buildMenu("menu_slurl.xml", this); | ||
577 | if (!menu) | ||
578 | { | ||
579 | menu = new LLMenuGL(""); | ||
580 | } | ||
581 | menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); | ||
582 | // menu->setVisible(FALSE); | ||
583 | mPopupMenuHandle = menu->mViewHandle; | ||
570 | } | 584 | } |
571 | 585 | ||
572 | LLViewerTextEditor::~LLViewerTextEditor() | 586 | LLViewerTextEditor::~LLViewerTextEditor() |
@@ -732,6 +746,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) | |||
732 | } | 746 | } |
733 | // assume we're starting a drag select | 747 | // assume we're starting a drag select |
734 | mIsSelecting = TRUE; | 748 | mIsSelecting = TRUE; |
749 | |||
735 | } | 750 | } |
736 | else | 751 | else |
737 | { | 752 | { |
@@ -941,6 +956,42 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | |||
941 | return handled; | 956 | return handled; |
942 | } | 957 | } |
943 | 958 | ||
959 | BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) | ||
960 | { | ||
961 | |||
962 | |||
963 | BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; | ||
964 | |||
965 | if(! handled) | ||
966 | { | ||
967 | LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); | ||
968 | if( cur_segment ) | ||
969 | { | ||
970 | if(cur_segment->getStyle().isLink()) | ||
971 | { | ||
972 | handled = TRUE; | ||
973 | mHTML = cur_segment->getStyle().getLinkHREF(); | ||
974 | } | ||
975 | } | ||
976 | } | ||
977 | LLMenuGL* menu = (LLMenuGL*)LLView::getViewByHandle(mPopupMenuHandle); | ||
978 | if(handled && menu && mParseHTML && mHTML.length() > 0) | ||
979 | { | ||
980 | menu->setVisible(TRUE); | ||
981 | menu->arrange(); | ||
982 | menu->updateParent(LLMenuGL::sMenuContainer); | ||
983 | LLMenuGL::showPopup(this, menu, x, y); | ||
984 | mHTML = ""; | ||
985 | } | ||
986 | else | ||
987 | { | ||
988 | if(menu && menu->getVisible()) | ||
989 | { | ||
990 | menu->setVisible(FALSE); | ||
991 | } | ||
992 | } | ||
993 | return handled; | ||
994 | } | ||
944 | 995 | ||
945 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | 996 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) |
946 | { | 997 | { |