diff options
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.cpp')
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 86 |
1 files changed, 39 insertions, 47 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 46908f5..5e131b9 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -96,6 +96,13 @@ public: | |||
96 | } | 96 | } |
97 | else | 97 | else |
98 | { | 98 | { |
99 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
100 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) ) | ||
101 | { | ||
102 | return; | ||
103 | } | ||
104 | // [/RLVa:KB] | ||
105 | |||
99 | // See if we can bring an existing preview to the front | 106 | // See if we can bring an existing preview to the front |
100 | if(!LLPreview::show(item->getUUID(), true)) | 107 | if(!LLPreview::show(item->getUUID(), true)) |
101 | { | 108 | { |
@@ -896,51 +903,9 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) | |||
896 | 903 | ||
897 | BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | 904 | BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) |
898 | { | 905 | { |
899 | BOOL handled = FALSE; | 906 | BOOL handled = FALSE; |
900 | |||
901 | // let scrollbar have first dibs | ||
902 | handled = LLView::childrenHandleMouseUp(x, y, mask) != NULL; | ||
903 | |||
904 | // Used to enable I Agree checkbox if the user scrolled through entire text | ||
905 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | ||
906 | if (mOnScrollEndCallback && was_scrolled_to_bottom) | ||
907 | { | ||
908 | mOnScrollEndCallback(mOnScrollEndData); | ||
909 | } | ||
910 | |||
911 | if( !handled && mTakesNonScrollClicks) | ||
912 | { | ||
913 | if( mIsSelecting ) | ||
914 | { | ||
915 | // Finish selection | ||
916 | if( y > getTextRect().mTop ) | ||
917 | { | ||
918 | mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); | ||
919 | } | ||
920 | else | ||
921 | if( y < getTextRect().mBottom ) | ||
922 | { | ||
923 | mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); | ||
924 | } | ||
925 | |||
926 | setCursorAtLocalPos( x, y, TRUE ); | ||
927 | endSelection(); | ||
928 | |||
929 | updateScrollFromCursor(); | ||
930 | } | ||
931 | |||
932 | if( !hasSelection() ) | ||
933 | { | ||
934 | handleMouseUpOverSegment( x, y, mask ); | ||
935 | } | ||
936 | |||
937 | handled = TRUE; | ||
938 | } | ||
939 | |||
940 | // Delay cursor flashing | ||
941 | resetKeystrokeTimer(); | ||
942 | 907 | ||
943 | if( hasMouseCapture() ) | 908 | if( hasMouseCapture() ) |
944 | { | 909 | { |
945 | if (mDragItem) | 910 | if (mDragItem) |
946 | { | 911 | { |
@@ -960,8 +925,15 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | |||
960 | } | 925 | } |
961 | } | 926 | } |
962 | mDragItem = NULL; | 927 | mDragItem = NULL; |
963 | gFocusMgr.setMouseCapture( NULL ); | 928 | } |
964 | handled = TRUE; | 929 | |
930 | handled = LLTextEditor::handleMouseUp(x,y,mask); | ||
931 | |||
932 | // Used to enable I Agree checkbox if the user scrolled through entire text | ||
933 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | ||
934 | if (mOnScrollEndCallback && was_scrolled_to_bottom) | ||
935 | { | ||
936 | mOnScrollEndCallback(mOnScrollEndData); | ||
965 | } | 937 | } |
966 | 938 | ||
967 | return handled; | 939 | return handled; |
@@ -1003,6 +975,24 @@ BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) | |||
1003 | return handled; | 975 | return handled; |
1004 | } | 976 | } |
1005 | 977 | ||
978 | BOOL LLViewerTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) | ||
979 | { | ||
980 | BOOL handled = FALSE; | ||
981 | handled = childrenHandleMiddleMouseDown(x, y, mask) != NULL; | ||
982 | if (!handled) | ||
983 | { | ||
984 | handled = LLTextEditor::handleMiddleMouseDown(x, y, mask); | ||
985 | } | ||
986 | return handled; | ||
987 | } | ||
988 | |||
989 | BOOL LLViewerTextEditor::handleMiddleMouseUp(S32 x, S32 y, MASK mask) | ||
990 | { | ||
991 | BOOL handled = childrenHandleMiddleMouseUp(x, y, mask) != NULL; | ||
992 | |||
993 | return handled; | ||
994 | } | ||
995 | |||
1006 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | 996 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) |
1007 | { | 997 | { |
1008 | BOOL handled = FALSE; | 998 | BOOL handled = FALSE; |
@@ -1025,7 +1015,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1025 | } | 1015 | } |
1026 | } | 1016 | } |
1027 | } | 1017 | } |
1028 | |||
1029 | 1018 | ||
1030 | setCursorAtLocalPos( x, y, FALSE ); | 1019 | setCursorAtLocalPos( x, y, FALSE ); |
1031 | deselect(); | 1020 | deselect(); |
@@ -1063,6 +1052,9 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1063 | // delay cursor flashing | 1052 | // delay cursor flashing |
1064 | resetKeystrokeTimer(); | 1053 | resetKeystrokeTimer(); |
1065 | 1054 | ||
1055 | // take selection to 'primary' clipboard | ||
1056 | updatePrimary(); | ||
1057 | |||
1066 | handled = TRUE; | 1058 | handled = TRUE; |
1067 | } | 1059 | } |
1068 | return handled; | 1060 | return handled; |