Added some changes for the new mouse wheel support

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9813 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2004-11-06 19:45:49 +00:00
parent 2418b1a07b
commit e09fd76fe6

View File

@ -59,7 +59,7 @@
// Local Includes -------------------------------------------------------------- // Local Includes --------------------------------------------------------------
// Local Defines --------------------------------------------------------------- // Local Defines ---------------------------------------------------------------
#define DEBUG_WIN //#define DEBUG_WIN
#ifdef DEBUG_WIN #ifdef DEBUG_WIN
# include <stdio.h> # include <stdio.h>
# define STRACE(x) printf x # define STRACE(x) printf x
@ -828,8 +828,9 @@ void BWindow::DispatchMessage(BMessage *msg, BHandler *target)
} }
case B_MOUSE_WHEEL_CHANGED: case B_MOUSE_WHEEL_CHANGED:
{ {
if (fFocus) BView *wheelView=LastMouseMovedView();
fFocus->MessageReceived( msg ); if(wheelView)
wheelView->MessageReceived( msg );
break; break;
} }
case B_MOUSE_DOWN: case B_MOUSE_DOWN:
@ -865,7 +866,6 @@ void BWindow::DispatchMessage(BMessage *msg, BHandler *target)
msg->FindPoint( "where", &where ); msg->FindPoint( "where", &where );
msg->FindInt32( "buttons", (int32*)&buttons ); msg->FindInt32( "buttons", (int32*)&buttons );
sendMessageUsingEventMask( B_MOUSE_MOVED, where ); sendMessageUsingEventMask( B_MOUSE_MOVED, where );
break; break;
} }
@ -2799,13 +2799,16 @@ void BWindow::sendMessageUsingEventMask( int32 message, BPoint where )
if (destView != fLastMouseMovedView) if (destView != fLastMouseMovedView)
{ {
fLastMouseMovedView->MouseMoved( destView->ConvertFromScreen( where ), B_EXITED_VIEW , dragMessage); if(fLastMouseMovedView)
fLastMouseMovedView->MouseMoved( destView->ConvertFromScreen( where ), B_EXITED_VIEW , dragMessage);
destView->MouseMoved( ConvertFromScreen( where ), B_ENTERED_VIEW, dragMessage); destView->MouseMoved( ConvertFromScreen( where ), B_ENTERED_VIEW, dragMessage);
fLastMouseMovedView = destView; fLastMouseMovedView = destView;
break;
} }
else else
{ {
destView->MouseMoved( ConvertFromScreen( where ), B_INSIDE_VIEW , dragMessage); destView->MouseMoved( ConvertFromScreen( where ), B_INSIDE_VIEW , dragMessage);
break;
} }
// I'm guessing that B_OUTSIDE_VIEW is given to the view that has focus, // I'm guessing that B_OUTSIDE_VIEW is given to the view that has focus,