changeset 944:cdb7a53e5515

Some motion notify changes... so it can handle events without the mouse button pressed on Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 30 Apr 2011 18:43:07 +0000
parents 675c12b1b90e
children 254b50be1bc1
files mac/dw.m
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Thu Apr 28 15:01:59 2011 +0000
+++ b/mac/dw.m	Sat Apr 30 18:43:07 2011 +0000
@@ -764,6 +764,15 @@
 -(void)setMenu:(NSMenu *)input { windowmenu = input; [windowmenu retain]; }
 -(void)menuHandler:(id)sender { _event_handler(sender, nil, 8); }
 -(void)mouseDragged:(NSEvent *)theEvent { if(_DWCapture == self) { _event_handler(self, theEvent, 5); } }
+-(void)mouseMoved:(NSEvent *)theEvent 
+{ 
+    id hit = [self hitTest:[theEvent locationInWindow]];
+    
+    if(_DWCapture == hit) 
+    { 
+        _event_handler(hit, theEvent, 5); 
+    } 
+}
 @end
 
 /* Subclass for a button type */
@@ -6732,6 +6741,7 @@
     [window setContentView:view];
     [window setDelegate:view];
     [window setAutorecalculatesKeyViewLoop:YES];
+    [window setAcceptsMouseMovedEvents:YES];
     [view release];
 
     /* If it isn't a toplevel window... */
@@ -7050,16 +7060,8 @@
 void API dw_window_capture(HWND handle)
 {
     id object = handle;
-    id window = handle;
-
-    if(![object isMemberOfClass:[DWWindow class]])
-    {
-        window = [object window];
-    }
-    if(window)
-    {
-        _DWCapture = object;
-    }
+    
+    _DWCapture = object;
 }
 
 /*