diff options
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.cpp')
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 79 |
1 files changed, 32 insertions, 47 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 3e2cc19..54b7743 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -893,51 +893,9 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) | |||
893 | 893 | ||
894 | BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | 894 | BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) |
895 | { | 895 | { |
896 | BOOL handled = FALSE; | 896 | BOOL handled = FALSE; |
897 | |||
898 | // let scrollbar have first dibs | ||
899 | handled = LLView::childrenHandleMouseUp(x, y, mask) != NULL; | ||
900 | |||
901 | // Used to enable I Agree checkbox if the user scrolled through entire text | ||
902 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | ||
903 | if (mOnScrollEndCallback && was_scrolled_to_bottom) | ||
904 | { | ||
905 | mOnScrollEndCallback(mOnScrollEndData); | ||
906 | } | ||
907 | |||
908 | if( !handled && mTakesNonScrollClicks) | ||
909 | { | ||
910 | if( mIsSelecting ) | ||
911 | { | ||
912 | // Finish selection | ||
913 | if( y > getTextRect().mTop ) | ||
914 | { | ||
915 | mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); | ||
916 | } | ||
917 | else | ||
918 | if( y < getTextRect().mBottom ) | ||
919 | { | ||
920 | mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); | ||
921 | } | ||
922 | |||
923 | setCursorAtLocalPos( x, y, TRUE ); | ||
924 | endSelection(); | ||
925 | |||
926 | updateScrollFromCursor(); | ||
927 | } | ||
928 | |||
929 | if( !hasSelection() ) | ||
930 | { | ||
931 | handleMouseUpOverSegment( x, y, mask ); | ||
932 | } | ||
933 | |||
934 | handled = TRUE; | ||
935 | } | ||
936 | |||
937 | // Delay cursor flashing | ||
938 | resetKeystrokeTimer(); | ||
939 | 897 | ||
940 | if( hasMouseCapture() ) | 898 | if( hasMouseCapture() ) |
941 | { | 899 | { |
942 | if (mDragItem) | 900 | if (mDragItem) |
943 | { | 901 | { |
@@ -956,8 +914,15 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | |||
956 | } | 914 | } |
957 | } | 915 | } |
958 | mDragItem = NULL; | 916 | mDragItem = NULL; |
959 | gFocusMgr.setMouseCapture( NULL ); | 917 | } |
960 | handled = TRUE; | 918 | |
919 | handled = LLTextEditor::handleMouseUp(x,y,mask); | ||
920 | |||
921 | // Used to enable I Agree checkbox if the user scrolled through entire text | ||
922 | BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); | ||
923 | if (mOnScrollEndCallback && was_scrolled_to_bottom) | ||
924 | { | ||
925 | mOnScrollEndCallback(mOnScrollEndData); | ||
961 | } | 926 | } |
962 | 927 | ||
963 | return handled; | 928 | return handled; |
@@ -999,6 +964,24 @@ BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) | |||
999 | return handled; | 964 | return handled; |
1000 | } | 965 | } |
1001 | 966 | ||
967 | BOOL LLViewerTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) | ||
968 | { | ||
969 | BOOL handled = FALSE; | ||
970 | handled = childrenHandleMiddleMouseDown(x, y, mask) != NULL; | ||
971 | if (!handled) | ||
972 | { | ||
973 | handled = LLTextEditor::handleMiddleMouseDown(x, y, mask); | ||
974 | } | ||
975 | return handled; | ||
976 | } | ||
977 | |||
978 | BOOL LLViewerTextEditor::handleMiddleMouseUp(S32 x, S32 y, MASK mask) | ||
979 | { | ||
980 | BOOL handled = childrenHandleMiddleMouseUp(x, y, mask) != NULL; | ||
981 | |||
982 | return handled; | ||
983 | } | ||
984 | |||
1002 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | 985 | BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) |
1003 | { | 986 | { |
1004 | BOOL handled = FALSE; | 987 | BOOL handled = FALSE; |
@@ -1021,7 +1004,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1021 | } | 1004 | } |
1022 | } | 1005 | } |
1023 | } | 1006 | } |
1024 | |||
1025 | 1007 | ||
1026 | setCursorAtLocalPos( x, y, FALSE ); | 1008 | setCursorAtLocalPos( x, y, FALSE ); |
1027 | deselect(); | 1009 | deselect(); |
@@ -1059,6 +1041,9 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1059 | // delay cursor flashing | 1041 | // delay cursor flashing |
1060 | resetKeystrokeTimer(); | 1042 | resetKeystrokeTimer(); |
1061 | 1043 | ||
1044 | // take selection to 'primary' clipboard | ||
1045 | updatePrimary(); | ||
1046 | |||
1062 | handled = TRUE; | 1047 | handled = TRUE; |
1063 | } | 1048 | } |
1064 | return handled; | 1049 | return handled; |