Mercurial > dwindows
changeset 886:d94a4fa0359e
Implemented the motion notify event on Mac. Most of it was there except the event handler.
Also removed the stub for dw_window_track() this appears to be an unused function only implemented on OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 07 Apr 2011 18:20:04 +0000 |
parents | 21ed1421399c |
children | 29d8ae25a78c |
files | mac/dw.m |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Thu Apr 07 09:04:48 2011 +0000 +++ b/mac/dw.m Thu Apr 07 18:20:04 2011 +0000 @@ -228,6 +228,15 @@ return buttonfunc(object, (int)x, (int)y, button, handler->data); } + /* Motion notify event */ + case 5: + { + int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; + int buttonmask = (int)[NSEvent pressedMouseButtons]; + NSPoint point = [NSEvent mouseLocation]; + + return motionfunc(object, (int)point.x, (int)point.y, buttonmask, handler->data); + } /* Window close event */ case 6: { @@ -580,6 +589,7 @@ -(void)windowDidBecomeMain:(id)sender; -(void)menuHandler:(id)sender; -(void)keyDown:(NSEvent *)theEvent; +-(void)mouseMoved:(NSEvent *)theEvent; @end @implementation DWView @@ -624,6 +634,7 @@ -(void)setMenu:(NSMenu *)input { windowmenu = input; [windowmenu retain]; } -(void)menuHandler:(id)sender { _event_handler(sender, nil, 8); } -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); _event_handler([self window], theEvent, 2); } +-(void)mouseMoved:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } @end /* Subclass for a button type */ @@ -6694,16 +6705,6 @@ } /* - * Tracks this window movement. - * Parameters: - * handle: Handle to frame to be tracked. - */ -void API dw_window_track(HWND handle) -{ - NSLog(@"dw_window_track() unimplemented\n"); -} - -/* * Changes a window's parent to newparent. * Parameters: * handle: The window handle to destroy.