fixed the mouse enter and exit routines

This commit is contained in:
dcone%netscape.com 1998-08-31 22:42:44 +00:00
Родитель 7d7df75cf2
Коммит 7fdc9a0806
1 изменённых файлов: 78 добавлений и 16 удалений

Просмотреть файл

@ -332,6 +332,23 @@ nsMouseEvent mouseevent;
partcode = FindWindow(aTheEvent->where,&whichwindow);
if(FALSE && gGrabWindow)
{
mouseevent.message = NS_MOUSE_LEFT_BUTTON_UP;
mouseevent.widget = (nsWindow *) gGrabWindow;
windowcoord = aTheEvent->where;
GlobalToLocal(&windowcoord);
mouseevent.point.x = windowcoord.h;
mouseevent.point.y = windowcoord.v;
mouseevent.time = 0;
mouseevent.isShift = FALSE;
mouseevent.isControl = FALSE;
mouseevent.isAlt = FALSE;
mouseevent.clickCount = 1;
mouseevent.eventStructType = NS_MOUSE_EVENT;
gGrabWindow->DispatchMouseEvent(mouseevent);
}
if(whichwindow!=0)
{
SelectWindow(whichwindow);
@ -392,25 +409,9 @@ nsMouseEvent mouseevent;
lastwindow = this->GetCurrentWindow();
mMousePoint = aTheEvent->where;
if(gGrabWindow)
{
mouseevent.message = NS_MOUSE_MOVE;
mouseevent.widget = (nsWindow *) gGrabWindow;
windowcoord = aTheEvent->where;
GlobalToLocal(&windowcoord);
mouseevent.point.x = windowcoord.h;
mouseevent.point.y = windowcoord.v;
gGrabWindow->DispatchMouseEvent(mouseevent);
return;
}
partcode = FindWindow(aTheEvent->where,&whichwindow);
switch(partcode)
{
case inContent:
thewindow = nsnull;
if(whichwindow!=nsnull)
{
SetPort(whichwindow);
@ -419,6 +420,67 @@ nsMouseEvent mouseevent;
if( (thewindow != nsnull))
thewindow = thewindow->FindWidgetHit(aTheEvent->where);
if(gGrabWindow)
{
if( /*(gGrabWindow==thewindow) ||*/ thewindow==lastwindow)
{
// JUST A MOUSE MOVE
mouseevent.message = NS_MOUSE_MOVE;
mouseevent.widget = (nsWindow *) gGrabWindow;
windowcoord = aTheEvent->where;
GlobalToLocal(&windowcoord);
mouseevent.point.x = windowcoord.h;
mouseevent.point.y = windowcoord.v;
gGrabWindow->DispatchMouseEvent(mouseevent);
this->SetCurrentWindow(thewindow);
}
else
{
// EXIT or ENTER?
if(lastwindow == nsnull || thewindow != lastwindow)
{
if(lastwindow == gGrabWindow)
{
mouseevent.message = NS_MOUSE_EXIT;
mouseevent.widget = (nsWindow *) gGrabWindow;
windowcoord = aTheEvent->where;
GlobalToLocal(&windowcoord);
mouseevent.point.x = windowcoord.h;
mouseevent.point.y = windowcoord.v;
gGrabWindow->DispatchMouseEvent(mouseevent);
this->SetCurrentWindow(thewindow);
}
else
{
mouseevent.message = NS_MOUSE_ENTER;
mouseevent.widget = (nsWindow *) gGrabWindow;
windowcoord = aTheEvent->where;
GlobalToLocal(&windowcoord);
mouseevent.point.x = windowcoord.h;
mouseevent.point.y = windowcoord.v;
gGrabWindow->DispatchMouseEvent(mouseevent);
this->SetCurrentWindow(thewindow);
}
}
}
return;
}
//partcode = FindWindow(aTheEvent->where,&whichwindow);
switch(partcode)
{
case inContent:
//thewindow = nsnull;
//if(whichwindow!=nsnull)
//{
//SetPort(whichwindow);
//thewindow = (nsWindow*)(((WindowPeek)whichwindow)->refCon);
//}
//if( (thewindow != nsnull))
//thewindow = thewindow->FindWidgetHit(aTheEvent->where);
if(thewindow)
{
if(lastwindow == nsnull || thewindow != lastwindow)