aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-03-09 20:37:53 -0700
committerMcCabe Maxsted2011-03-09 20:37:53 -0700
commit16ce373d14199b94729caffcb099d8a6bd37f882 (patch)
treebd513a4f6107d57f7f7a5fe1552852f8fccc277f
parentFixed windows compile error (diff)
downloadmeta-impy-16ce373d14199b94729caffcb099d8a6bd37f882.zip
meta-impy-16ce373d14199b94729caffcb099d8a6bd37f882.tar.gz
meta-impy-16ce373d14199b94729caffcb099d8a6bd37f882.tar.bz2
meta-impy-16ce373d14199b94729caffcb099d8a6bd37f882.tar.xz
#787: Horizontal mouse scrolling support, patch by Kakurady Drakenar
-rw-r--r--linden/indra/llui/lllineeditor.cpp5
-rw-r--r--linden/indra/llui/lllineeditor.h1
-rw-r--r--linden/indra/llui/llscrollbar.cpp5
-rw-r--r--linden/indra/llui/llscrollbar.h1
-rw-r--r--linden/indra/llui/llscrollcontainer.cpp17
-rw-r--r--linden/indra/llui/llscrollcontainer.h1
-rw-r--r--linden/indra/llui/llview.cpp41
-rw-r--r--linden/indra/llui/llview.h2
-rw-r--r--linden/indra/llwindow/llmousehandler.cpp6
-rw-r--r--linden/indra/llwindow/llmousehandler.h1
-rw-r--r--linden/indra/llwindow/llwindow.cpp4
-rw-r--r--linden/indra/llwindow/llwindow.h1
-rw-r--r--linden/indra/llwindow/llwindowmacosx.cpp31
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp5
-rw-r--r--linden/indra/llwindow/llwindowwin32.cpp16
-rw-r--r--linden/indra/newview/llagent.cpp6
-rw-r--r--linden/indra/newview/llagent.h1
-rw-r--r--linden/indra/newview/llfloateranimpreview.cpp12
-rw-r--r--linden/indra/newview/llfloateranimpreview.h1
-rw-r--r--linden/indra/newview/llfloaterimagepreview.cpp16
-rw-r--r--linden/indra/newview/llfloaterimagepreview.h1
-rw-r--r--linden/indra/newview/lltool.cpp7
-rw-r--r--linden/indra/newview/lltool.h1
-rw-r--r--linden/indra/newview/llviewerwindow.cpp58
-rw-r--r--linden/indra/newview/llviewerwindow.h2
25 files changed, 234 insertions, 8 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}
1037BOOL 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
1039BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) 1044BOOL 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}
429BOOL LLScrollbar::handleHScrollWheel(S32 x, S32 y, S32 clicks)
430{
431 changeLine( clicks * mStepSize, TRUE );
432 return TRUE;
433}
429 434
430BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, 435BOOL 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
242BOOL 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
242BOOL LLScrollableContainerView::needsToScroll(S32 x, S32 y, LLScrollableContainerView::SCROLL_ORIENTATION axis) const 259BOOL 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
963BOOL 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}
963BOOL LLView::handleRightMouseDown(S32 x, S32 y, MASK mask) 976BOOL 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
1048LLView* 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
1035LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) 1076LLView* 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
diff --git a/linden/indra/llwindow/llmousehandler.cpp b/linden/indra/llwindow/llmousehandler.cpp
index ae2f147..e3ea979 100644
--- a/linden/indra/llwindow/llmousehandler.cpp
+++ b/linden/indra/llwindow/llmousehandler.cpp
@@ -57,3 +57,9 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
57 } 57 }
58 return handled; 58 return handled;
59} 59}
60
61BOOL LLMouseHandler::handleHScrollWheel(S32 x, S32 y, S32 clicks)
62{
63 BOOL handled = FALSE;
64 return handled;
65}
diff --git a/linden/indra/llwindow/llmousehandler.h b/linden/indra/llwindow/llmousehandler.h
index 7bd0f2e..1a4ea65 100644
--- a/linden/indra/llwindow/llmousehandler.h
+++ b/linden/indra/llwindow/llmousehandler.h
@@ -67,6 +67,7 @@ public:
67 67
68 virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0; 68 virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
69 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0; 69 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
70 virtual BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks);
70 virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0; 71 virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0;
71 virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; }; 72 virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; };
72 virtual const std::string& getName() const = 0; 73 virtual const std::string& getName() const = 0;
diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp
index 53ca68d..6ac42b2 100644
--- a/linden/indra/llwindow/llwindow.cpp
+++ b/linden/indra/llwindow/llwindow.cpp
@@ -155,6 +155,10 @@ void LLWindowCallbacks::handleScrollWheel(LLWindow *window, S32 clicks)
155{ 155{
156} 156}
157 157
158void LLWindowCallbacks::handleHScrollWheel(LLWindow *window, S32 clicks)
159{
160}
161
158void LLWindowCallbacks::handleResize(LLWindow *window, const S32 width, const S32 height) 162void LLWindowCallbacks::handleResize(LLWindow *window, const S32 width, const S32 height)
159{ 163{
160} 164}
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h
index 5e93ab3..cbcfc5a 100644
--- a/linden/indra/llwindow/llwindow.h
+++ b/linden/indra/llwindow/llwindow.h
@@ -69,6 +69,7 @@ public:
69 virtual BOOL handleActivateApp(LLWindow *window, BOOL activating); 69 virtual BOOL handleActivateApp(LLWindow *window, BOOL activating);
70 virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); 70 virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask);
71 virtual void handleScrollWheel(LLWindow *window, S32 clicks); 71 virtual void handleScrollWheel(LLWindow *window, S32 clicks);
72 virtual void handleHScrollWheel(LLWindow *window, S32 clicks);
72 virtual void handleResize(LLWindow *window, S32 width, S32 height); 73 virtual void handleResize(LLWindow *window, S32 width, S32 height);
73 virtual void handleFocus(LLWindow *window); 74 virtual void handleFocus(LLWindow *window);
74 virtual void handleFocusLost(LLWindow *window); 75 virtual void handleFocusLost(LLWindow *window);
diff --git a/linden/indra/llwindow/llwindowmacosx.cpp b/linden/indra/llwindow/llwindowmacosx.cpp
index 99daa4d..93bff99 100644
--- a/linden/indra/llwindow/llwindowmacosx.cpp
+++ b/linden/indra/llwindow/llwindowmacosx.cpp
@@ -2384,6 +2384,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
2384 HIPoint location = {0.0f, 0.0f}; 2384 HIPoint location = {0.0f, 0.0f};
2385 UInt32 modifiers = 0; 2385 UInt32 modifiers = 0;
2386 UInt32 clickCount = 1; 2386 UInt32 clickCount = 1;
2387 EventMouseWheelAxis wheelAxis = kEventMouseWheelAxisX;
2387 long wheelDelta = 0; 2388 long wheelDelta = 0;
2388 LLCoordScreen inCoords; 2389 LLCoordScreen inCoords;
2389 LLCoordGL outCoords; 2390 LLCoordGL outCoords;
@@ -2393,6 +2394,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
2393 GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(location), NULL, &location); 2394 GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(location), NULL, &location);
2394 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(modifiers), NULL, &modifiers); 2395 GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(modifiers), NULL, &modifiers);
2395 GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(wheelDelta), NULL, &wheelDelta); 2396 GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(wheelDelta), NULL, &wheelDelta);
2397 GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, NULL, sizeof(wheelAxis), NULL, &wheelAxis);
2396 GetEventParameter(event, kEventParamClickCount, typeUInt32, NULL, sizeof(clickCount), NULL, &clickCount); 2398 GetEventParameter(event, kEventParamClickCount, typeUInt32, NULL, sizeof(clickCount), NULL, &clickCount);
2397 2399
2398 inCoords.mX = llround(location.x); 2400 inCoords.mX = llround(location.x);
@@ -2501,14 +2503,31 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e
2501 2503
2502 case kEventMouseWheelMoved: 2504 case kEventMouseWheelMoved:
2503 { 2505 {
2504 static S32 z_delta = 0; 2506 switch (wheelAxis){
2507 case kEventMouseWheelAxisX:
2505 2508
2506 z_delta += wheelDelta; 2509 static S32 wheel_x_delta = 0;
2507 2510
2508 if (z_delta <= -WHEEL_DELTA || WHEEL_DELTA <= z_delta) 2511 wheel_x_delta += wheelDelta;
2509 { 2512
2510 mCallbacks->handleScrollWheel(this, -z_delta / WHEEL_DELTA); 2513 if (wheel_x_delta <= -WHEEL_DELTA || WHEEL_DELTA <= wheel_x_delta)
2511 z_delta = 0; 2514 {
2515 mCallbacks->handleHScrollWheel(this, wheel_x_delta / WHEEL_DELTA);
2516 wheel_x_delta = 0;
2517 }
2518 break;
2519 case kEventMouseWheelAxisY:
2520
2521 static S32 wheel_y_delta = 0;
2522
2523 wheel_y_delta += wheelDelta;
2524
2525 if (wheel_y_delta <= -WHEEL_DELTA || WHEEL_DELTA <= wheel_y_delta)
2526 {
2527 mCallbacks->handleScrollWheel(this, -wheel_y_delta / WHEEL_DELTA);
2528 wheel_y_delta = 0;
2529 }
2530 break;
2512 } 2531 }
2513 } 2532 }
2514 result = noErr; 2533 result = noErr;
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp
index f7d7587..edfe33b 100644
--- a/linden/indra/llwindow/llwindowsdl.cpp
+++ b/linden/indra/llwindow/llwindowsdl.cpp
@@ -1731,7 +1731,10 @@ void LLWindowSDL::gatherInput()
1731 mCallbacks->handleScrollWheel(this, -1); 1731 mCallbacks->handleScrollWheel(this, -1);
1732 else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons". 1732 else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons".
1733 mCallbacks->handleScrollWheel(this, 1); 1733 mCallbacks->handleScrollWheel(this, 1);
1734 1734 else if (event.button.button == 6)
1735 mCallbacks->handleHScrollWheel(this, -1);
1736 else if (event.button.button == 7)
1737 mCallbacks->handleHScrollWheel(this, 1);
1735 break; 1738 break;
1736 } 1739 }
1737 1740
diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp
index 7bc9a3b..dacee34 100644
--- a/linden/indra/llwindow/llwindowwin32.cpp
+++ b/linden/indra/llwindow/llwindowwin32.cpp
@@ -2259,6 +2259,22 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
2259 } 2259 }
2260 return 0; 2260 return 0;
2261 } 2261 }
2262#ifdef WM_MOUSEHWHEEL
2263 case WM_MOUSEHWHEEL:
2264 {
2265 window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MOUSEHWHEEL");
2266 static short z_delta = 0;
2267
2268 z_delta += HIWORD(w_param);
2269
2270 if (z_delta <= -WHEEL_DELTA || WHEEL_DELTA <= z_delta)
2271 {
2272 window_imp->mCallbacks->handleHScrollWheel(window_imp, z_delta / WHEEL_DELTA);
2273 z_delta = 0;
2274 }
2275 return 0;
2276 }
2277#endif //WM_MOUSEHWHEEL
2262 /* 2278 /*
2263 // TODO: add this after resolving _WIN32_WINNT issue 2279 // TODO: add this after resolving _WIN32_WINNT issue
2264 case WM_MOUSELEAVE: 2280 case WM_MOUSELEAVE:
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 515d588..871c90d 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -4043,7 +4043,11 @@ void LLAgent::handleScrollWheel(S32 clicks)
4043 } 4043 }
4044 } 4044 }
4045} 4045}
4046 4046void LLAgent::handleHScrollWheel(S32 clicks)
4047{
4048 const F32 RAD_PER_CLICK = -F_PI / 16.0f;
4049 cameraOrbitAround(RAD_PER_CLICK * clicks);
4050}
4047 4051
4048//----------------------------------------------------------------------------- 4052//-----------------------------------------------------------------------------
4049// getCameraMinOffGround() 4053// getCameraMinOffGround()
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index fe50bf5..cea55fb 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -163,6 +163,7 @@ public:
163 void endAnimationUpdateUI(); 163 void endAnimationUpdateUI();
164 void setKey(const S32 direction, S32 &key); // sets key to +1 for +direction, -1 for -direction 164 void setKey(const S32 direction, S32 &key); // sets key to +1 for +direction, -1 for -direction
165 void handleScrollWheel(S32 clicks); // mousewheel driven zoom 165 void handleScrollWheel(S32 clicks); // mousewheel driven zoom
166 void handleHScrollWheel(S32 clicks);
166 167
167 void setAvatarObject(LLVOAvatar *avatar); 168 void setAvatarObject(LLVOAvatar *avatar);
168 169
diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp
index 232530c..6d7f350 100644
--- a/linden/indra/newview/llfloateranimpreview.cpp
+++ b/linden/indra/newview/llfloateranimpreview.cpp
@@ -617,6 +617,18 @@ BOOL LLFloaterAnimPreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
617} 617}
618 618
619//----------------------------------------------------------------------------- 619//-----------------------------------------------------------------------------
620// handleHScrollWheel()
621//-----------------------------------------------------------------------------
622BOOL LLFloaterAnimPreview::handleHScrollWheel(S32 x, S32 y, S32 clicks)
623{
624 const F32 RAD_PER_CLICK = -F_PI / 16.0f;
625 mAnimPreview->rotate(RAD_PER_CLICK * clicks, 0);
626 mAnimPreview->requestUpdate();
627
628 return TRUE;
629}
630
631//-----------------------------------------------------------------------------
620// onMouseCaptureLost() 632// onMouseCaptureLost()
621//----------------------------------------------------------------------------- 633//-----------------------------------------------------------------------------
622void LLFloaterAnimPreview::onMouseCaptureLost() 634void LLFloaterAnimPreview::onMouseCaptureLost()
diff --git a/linden/indra/newview/llfloateranimpreview.h b/linden/indra/newview/llfloateranimpreview.h
index e8f79e2..0107165 100644
--- a/linden/indra/newview/llfloateranimpreview.h
+++ b/linden/indra/newview/llfloateranimpreview.h
@@ -80,6 +80,7 @@ public:
80 BOOL handleMouseUp(S32 x, S32 y, MASK mask); 80 BOOL handleMouseUp(S32 x, S32 y, MASK mask);
81 BOOL handleHover(S32 x, S32 y, MASK mask); 81 BOOL handleHover(S32 x, S32 y, MASK mask);
82 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 82 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
83 BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks);
83 void onMouseCaptureLost(); 84 void onMouseCaptureLost();
84 85
85 void refresh(); 86 void refresh();
diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp
index aa8a94f..e792f8c 100644
--- a/linden/indra/newview/llfloaterimagepreview.cpp
+++ b/linden/indra/newview/llfloaterimagepreview.cpp
@@ -616,6 +616,22 @@ BOOL LLFloaterImagePreview::handleScrollWheel(S32 x, S32 y, S32 clicks)
616 return TRUE; 616 return TRUE;
617} 617}
618 618
619BOOL LLFloaterImagePreview::handleHScrollWheel(S32 x, S32 y, S32 clicks)
620{
621 const F32 RAD_PER_CLICK = -F_PI / 16.0f;
622
623 if (mPreviewRect.pointInRect(x, y) && mAvatarPreview)
624 {
625 mAvatarPreview->rotate(RAD_PER_CLICK * clicks, 0);
626 mAvatarPreview->refresh();
627
628 mSculptedPreview->rotate(RAD_PER_CLICK * clicks, 0);
629 mSculptedPreview->refresh();
630 }
631
632 return TRUE;
633}
634
619//----------------------------------------------------------------------------- 635//-----------------------------------------------------------------------------
620// onMouseCaptureLost() 636// onMouseCaptureLost()
621//----------------------------------------------------------------------------- 637//-----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llfloaterimagepreview.h b/linden/indra/newview/llfloaterimagepreview.h
index 6a4de3d..1ccfeb4 100644
--- a/linden/indra/newview/llfloaterimagepreview.h
+++ b/linden/indra/newview/llfloaterimagepreview.h
@@ -115,6 +115,7 @@ public:
115 BOOL handleMouseUp(S32 x, S32 y, MASK mask); 115 BOOL handleMouseUp(S32 x, S32 y, MASK mask);
116 BOOL handleHover(S32 x, S32 y, MASK mask); 116 BOOL handleHover(S32 x, S32 y, MASK mask);
117 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 117 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
118 BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks);
118 119
119 static void onMouseCaptureLostImagePreview(LLMouseHandler*); 120 static void onMouseCaptureLostImagePreview(LLMouseHandler*);
120 static void setUploadAmount(S32 amount) { sUploadAmount = amount; } 121 static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
diff --git a/linden/indra/newview/lltool.cpp b/linden/indra/newview/lltool.cpp
index 6a3ada0..df2191b 100644
--- a/linden/indra/newview/lltool.cpp
+++ b/linden/indra/newview/lltool.cpp
@@ -104,6 +104,13 @@ BOOL LLTool::handleScrollWheel(S32 x, S32 y, S32 clicks)
104 return FALSE; 104 return FALSE;
105} 105}
106 106
107BOOL LLTool::handleHScrollWheel(S32 x, S32 y, S32 clicks)
108{
109 // by default, didn't handle it
110 // llinfos << "LLTool::handleScrollWheel" << llendl;
111 return FALSE;
112}
113
107BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask) 114BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask)
108{ 115{
109 // llinfos << "LLTool::handleDoubleClick" << llendl; 116 // llinfos << "LLTool::handleDoubleClick" << llendl;
diff --git a/linden/indra/newview/lltool.h b/linden/indra/newview/lltool.h
index f954a8c..26e6623 100644
--- a/linden/indra/newview/lltool.h
+++ b/linden/indra/newview/lltool.h
@@ -62,6 +62,7 @@ public:
62 62
63 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 63 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
64 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 64 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
65 virtual BOOL handleHScrollWheel(S32 x, S32 y, S32 clicks);
65 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); 66 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
66 virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); 67 virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
67 virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); 68 virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 920d42e..b4ef3ff 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -1134,6 +1134,10 @@ void LLViewerWindow::handleScrollWheel(LLWindow *window, S32 clicks)
1134{ 1134{
1135 handleScrollWheel( clicks ); 1135 handleScrollWheel( clicks );
1136} 1136}
1137void LLViewerWindow::handleHScrollWheel(LLWindow *window, S32 clicks)
1138{
1139 handleHScrollWheel( clicks );
1140}
1137 1141
1138void LLViewerWindow::handleWindowBlock(LLWindow *window) 1142void LLViewerWindow::handleWindowBlock(LLWindow *window)
1139{ 1143{
@@ -2486,6 +2490,60 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
2486 return; 2490 return;
2487} 2491}
2488 2492
2493void LLViewerWindow::handleHScrollWheel(S32 clicks)
2494{
2495 LLView::sMouseHandlerMessage.clear();
2496
2497 gMouseIdleTimer.reset();
2498
2499 // Hide tooltips
2500 if( mToolTip )
2501 {
2502 mToolTip->setVisible( FALSE );
2503 }
2504
2505 LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture();
2506 if( mouse_captor )
2507 {
2508 S32 local_x;
2509 S32 local_y;
2510 mouse_captor->screenPointToLocal( mCurrentMousePoint.mX, mCurrentMousePoint.mY, &local_x, &local_y );
2511 mouse_captor->handleHScrollWheel(local_x, local_y, clicks);
2512 if (LLView::sDebugMouseHandling)
2513 {
2514 llinfos << "Tilt Wheel handled by captor " << mouse_captor->getName() << llendl;
2515 }
2516 return;
2517 }
2518
2519 LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
2520 if (top_ctrl)
2521 {
2522 S32 local_x;
2523 S32 local_y;
2524 top_ctrl->screenPointToLocal( mCurrentMousePoint.mX, mCurrentMousePoint.mY, &local_x, &local_y );
2525 if (top_ctrl->handleHScrollWheel(local_x, local_y, clicks)) return;
2526 }
2527
2528 if (mRootView->handleHScrollWheel(mCurrentMousePoint.mX, mCurrentMousePoint.mY, clicks) )
2529 {
2530 if (LLView::sDebugMouseHandling)
2531 {
2532 llinfos << "Tilt Wheel" << LLView::sMouseHandlerMessage << llendl;
2533 }
2534 return;
2535 }
2536 else if (LLView::sDebugMouseHandling)
2537 {
2538 llinfos << "Tilt Wheel not handled by view" << llendl;
2539 }
2540
2541
2542 gAgent.handleHScrollWheel(clicks);
2543
2544 return;
2545}
2546
2489void LLViewerWindow::moveCursorToCenter() 2547void LLViewerWindow::moveCursorToCenter()
2490{ 2548{
2491 S32 x = mVirtualWindowRect.getWidth() / 2; 2549 S32 x = mVirtualWindowRect.getWidth() / 2;
diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h
index d26d820..fd159e1 100644
--- a/linden/indra/newview/llviewerwindow.h
+++ b/linden/indra/newview/llviewerwindow.h
@@ -172,6 +172,7 @@ public:
172 /*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item); 172 /*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item);
173 /*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height); 173 /*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height);
174 /*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks); 174 /*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks);
175 /*virtual*/ void handleHScrollWheel(LLWindow *window, S32 clicks);
175 /*virtual*/ BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask); 176 /*virtual*/ BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask);
176 /*virtual*/ void handleWindowBlock(LLWindow *window); 177 /*virtual*/ void handleWindowBlock(LLWindow *window);
177 /*virtual*/ void handleWindowUnblock(LLWindow *window); 178 /*virtual*/ void handleWindowUnblock(LLWindow *window);
@@ -266,6 +267,7 @@ public:
266 267
267 BOOL handleKey(KEY key, MASK mask); 268 BOOL handleKey(KEY key, MASK mask);
268 void handleScrollWheel (S32 clicks); 269 void handleScrollWheel (S32 clicks);
270 void handleHScrollWheel (S32 clicks);
269 271
270 // Hide normal UI when a logon fails, re-show everything when logon is attempted again 272 // Hide normal UI when a logon fails, re-show everything when logon is attempted again
271 void setNormalControlsVisible( BOOL visible ); 273 void setNormalControlsVisible( BOOL visible );