let mouse events flow...

git-svn-id: svn://10.0.0.236/trunk@35106 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blizzard%redhat.com
1999-06-14 01:53:52 +00:00
parent 96b698384d
commit 5826a92dd7
5 changed files with 107 additions and 2 deletions

View File

@@ -386,7 +386,7 @@ void nsWidget::CreateNative(Window aParent, nsRect aRect)
// be discarded...
attr.bit_gravity = NorthWestGravity;
// make sure that we listen for events
attr.event_mask = StructureNotifyMask | ExposureMask;
attr.event_mask = StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
// set the default background color and border to that awful gray
attr.background_pixel = bg_pixel;
attr.border_pixel = border_pixel;
@@ -492,6 +492,38 @@ nsWidget::OnPaint(nsPaintEvent &event)
return result;
}
PRBool nsWidget::DispatchMouseEvent(nsMouseEvent& aEvent)
{
PRBool result = PR_FALSE;
if (nsnull == mEventCallback && nsnull == mMouseListener) {
return result;
}
if (nsnull != mEventCallback) {
result = DispatchWindowEvent(&aEvent);
return result;
}
if (nsnull != mMouseListener) {
switch (aEvent.message) {
case NS_MOUSE_MOVE:
// XXX this isn't handled in gtk for some reason.
break;
case NS_MOUSE_LEFT_BUTTON_DOWN:
case NS_MOUSE_MIDDLE_BUTTON_DOWN:
case NS_MOUSE_RIGHT_BUTTON_DOWN:
result = ConvertStatus(mMouseListener->MousePressed(aEvent));
break;
case NS_MOUSE_LEFT_BUTTON_UP:
case NS_MOUSE_MIDDLE_BUTTON_UP:
case NS_MOUSE_RIGHT_BUTTON_UP:
result = ConvertStatus(mMouseListener->MouseReleased(aEvent));
result = ConvertStatus(mMouseListener->MouseClicked(aEvent));
break;
}
}
return result;
}
PRBool
nsWidget::OnResize(nsSizeEvent &event)
{