diff options
Diffstat (limited to 'linden/indra/llui')
-rw-r--r-- | linden/indra/llui/lllineeditor.cpp | 5 | ||||
-rw-r--r-- | linden/indra/llui/lllineeditor.h | 1 | ||||
-rw-r--r-- | linden/indra/llui/llscrollbar.cpp | 5 | ||||
-rw-r--r-- | linden/indra/llui/llscrollbar.h | 1 | ||||
-rw-r--r-- | linden/indra/llui/llscrollcontainer.cpp | 17 | ||||
-rw-r--r-- | linden/indra/llui/llscrollcontainer.h | 1 | ||||
-rw-r--r-- | linden/indra/llui/llview.cpp | 41 | ||||
-rw-r--r-- | linden/indra/llui/llview.h | 2 |
8 files changed, 73 insertions, 0 deletions
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index a3785e4..76b8927 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp | |||
@@ -1034,6 +1034,11 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) | |||
1034 | 1034 | ||
1035 | return handled; | 1035 | return handled; |
1036 | } | 1036 | } |
1037 | BOOL LLLineEditor::handleHScrollWheel(S32 x, S32 y, S32 clicks) | ||
1038 | { | ||
1039 | mScrollHPos = llclamp(mScrollHPos + clicks * 3, 0, mText.length()); | ||
1040 | return TRUE; | ||
1041 | } | ||
1037 | 1042 | ||
1038 | 1043 | ||
1039 | BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) | 1044 | BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) |
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index f9e0621..d217859 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h | |||
@@ -90,6 +90,7 @@ public: | |||
90 | /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); | 90 | /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); |
91 | /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); | 91 | /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); |
92 | /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); | 92 | /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); |
93 | /*virtual*/ BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks); | ||
93 | /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); | 94 | /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); |
94 | /*virtual*/ BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask); | 95 | /*virtual*/ BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask); |
95 | /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); | 96 | /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); |
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp index 65086d8..11e6239 100644 --- a/linden/indra/llui/llscrollbar.cpp +++ b/linden/indra/llui/llscrollbar.cpp | |||
@@ -426,6 +426,11 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
426 | changeLine( clicks * mStepSize, TRUE ); | 426 | changeLine( clicks * mStepSize, TRUE ); |
427 | return TRUE; | 427 | return TRUE; |
428 | } | 428 | } |
429 | BOOL LLScrollbar::handleHScrollWheel(S32 x, S32 y, S32 clicks) | ||
430 | { | ||
431 | changeLine( clicks * mStepSize, TRUE ); | ||
432 | return TRUE; | ||
433 | } | ||
429 | 434 | ||
430 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 435 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
431 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg) | 436 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg) |
diff --git a/linden/indra/llui/llscrollbar.h b/linden/indra/llui/llscrollbar.h index 0bbf866..6969662 100644 --- a/linden/indra/llui/llscrollbar.h +++ b/linden/indra/llui/llscrollbar.h | |||
@@ -69,6 +69,7 @@ public: | |||
69 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); | 69 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); |
70 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | 70 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); |
71 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 71 | virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
72 | virtual BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks); | ||
72 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 73 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
73 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg); | 74 | EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string &tooltip_msg); |
74 | 75 | ||
diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index 6f037e2..8737a70 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp | |||
@@ -239,6 +239,23 @@ BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks ) | |||
239 | return TRUE; | 239 | return TRUE; |
240 | } | 240 | } |
241 | 241 | ||
242 | BOOL LLScrollableContainerView::handleHScrollWheel( S32 x, S32 y, S32 clicks ) | ||
243 | { | ||
244 | for( S32 i = SCROLLBAR_COUNT - 1; i >= 0; i++ ) | ||
245 | { | ||
246 | // Note: tries horizontal and then vertical | ||
247 | |||
248 | // Pretend the mouse is over the scrollbar | ||
249 | if( mScrollbar[i]->handleScrollWheel( 0, 0, clicks ) ) | ||
250 | { | ||
251 | return TRUE; | ||
252 | } | ||
253 | } | ||
254 | |||
255 | // Eat scroll wheel event (to avoid scrolling nested containers?) | ||
256 | return TRUE; | ||
257 | } | ||
258 | |||
242 | BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContainerView::SCROLL_ORIENTATION axis) const | 259 | BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContainerView::SCROLL_ORIENTATION axis) const |
243 | { | 260 | { |
244 | if(mScrollbar[axis]->getVisible()) | 261 | if(mScrollbar[axis]->getVisible()) |
diff --git a/linden/indra/llui/llscrollcontainer.h b/linden/indra/llui/llscrollcontainer.h index 70fc908..c18a0db 100644 --- a/linden/indra/llui/llscrollcontainer.h +++ b/linden/indra/llui/llscrollcontainer.h | |||
@@ -91,6 +91,7 @@ public: | |||
91 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 91 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
92 | virtual BOOL handleKeyHere(KEY key, MASK mask); | 92 | virtual BOOL handleKeyHere(KEY key, MASK mask); |
93 | virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); | 93 | virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); |
94 | virtual BOOL handleHScrollWheel( S32 x, S32 y, S32 clicks ); | ||
94 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 95 | virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
95 | EDragAndDropType cargo_type, | 96 | EDragAndDropType cargo_type, |
96 | void* cargo_data, | 97 | void* cargo_data, |
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index d4eda8f..507c5f5 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -960,6 +960,19 @@ BOOL LLView::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
960 | return handled; | 960 | return handled; |
961 | } | 961 | } |
962 | 962 | ||
963 | BOOL LLView::handleHScrollWheel(S32 x, S32 y, S32 clicks) | ||
964 | { | ||
965 | BOOL handled = FALSE; | ||
966 | if( getVisible() && getEnabled() ) | ||
967 | { | ||
968 | handled = childrenHandleHScrollWheel( x, y, clicks ) != NULL; | ||
969 | if( !handled && blockMouseEvent(x, y) ) | ||
970 | { | ||
971 | handled = TRUE; | ||
972 | } | ||
973 | } | ||
974 | return handled; | ||
975 | } | ||
963 | BOOL LLView::handleRightMouseDown(S32 x, S32 y, MASK mask) | 976 | BOOL LLView::handleRightMouseDown(S32 x, S32 y, MASK mask) |
964 | { | 977 | { |
965 | BOOL handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; | 978 | BOOL handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; |
@@ -1032,6 +1045,34 @@ LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) | |||
1032 | return handled_view; | 1045 | return handled_view; |
1033 | } | 1046 | } |
1034 | 1047 | ||
1048 | LLView* LLView::childrenHandleHScrollWheel(S32 x, S32 y, S32 clicks) | ||
1049 | { | ||
1050 | LLView* handled_view = NULL; | ||
1051 | if (getVisible() && getEnabled() ) | ||
1052 | { | ||
1053 | for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) | ||
1054 | { | ||
1055 | LLView* viewp = *child_it; | ||
1056 | S32 local_x = x - viewp->getRect().mLeft; | ||
1057 | S32 local_y = y - viewp->getRect().mBottom; | ||
1058 | if (viewp->pointInView(local_x, local_y) | ||
1059 | && viewp->getVisible() | ||
1060 | && viewp->getEnabled() | ||
1061 | && viewp->handleHScrollWheel( local_x, local_y, clicks )) | ||
1062 | { | ||
1063 | if (sDebugMouseHandling) | ||
1064 | { | ||
1065 | sMouseHandlerMessage = std::string("->") + viewp->mName + sMouseHandlerMessage; | ||
1066 | } | ||
1067 | |||
1068 | handled_view = viewp; | ||
1069 | break; | ||
1070 | } | ||
1071 | } | ||
1072 | } | ||
1073 | return handled_view; | ||
1074 | } | ||
1075 | |||
1035 | LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) | 1076 | LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) |
1036 | { | 1077 | { |
1037 | LLView* handled_view = NULL; | 1078 | LLView* handled_view = NULL; |
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index 1c8ab31..9243f4f 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h | |||
@@ -473,6 +473,7 @@ public: | |||
473 | /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); | 473 | /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); |
474 | /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); | 474 | /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); |
475 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); | 475 | /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); |
476 | /*virtual*/ BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks); | ||
476 | /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); | 477 | /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); |
477 | /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); | 478 | /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); |
478 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. | 479 | /*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect); // Display mToolTipMsg if no child handles it. |
@@ -613,6 +614,7 @@ protected: | |||
613 | LLView* childrenHandleMiddleMouseDown(S32 x, S32 y, MASK mask); | 614 | LLView* childrenHandleMiddleMouseDown(S32 x, S32 y, MASK mask); |
614 | LLView* childrenHandleDoubleClick(S32 x, S32 y, MASK mask); | 615 | LLView* childrenHandleDoubleClick(S32 x, S32 y, MASK mask); |
615 | LLView* childrenHandleScrollWheel(S32 x, S32 y, S32 clicks); | 616 | LLView* childrenHandleScrollWheel(S32 x, S32 y, S32 clicks); |
617 | LLView* childrenHandleHScrollWheel(S32 x, S32 y, S32 clicks); | ||
616 | LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask); | 618 | LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask); |
617 | LLView* childrenHandleRightMouseUp(S32 x, S32 y, MASK mask); | 619 | LLView* childrenHandleRightMouseUp(S32 x, S32 y, MASK mask); |
618 | 620 | ||