Correct cursor handling during dragging

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@12095 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-01-14 04:19:01 +00:00
parent d16c24d42c
commit 57e7b4ccc5
4 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2002-01-13 Adam Fedor <fedor@gnu.org>
* GormDocument.m ([GormDocument -init]): Autorelease objectsView.
* GormWindowEditor.m ([GormWindowEditor -mouseDown:]): Set the
arrowCursor for dragging, etc. push back the mouseUp event to
make cursor tracking work correctly.
2001-12-18 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: loadClass method added to call the method in GormDocument
* GormDocument.m: loadClass method and parseClass method added

View file

@ -1130,6 +1130,7 @@ static NSImage *classesImage = nil;
mainRect.origin = NSMakePoint(0,0);
objectsView = [[GormObjectEditor alloc] initWithObject: nil
inDocument: self];
AUTORELEASE(objectsView);
[objectsView setFrame: mainRect];
[objectsView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable];
[scrollView setDocumentView: objectsView];

View file

@ -85,6 +85,7 @@ _constrainPointToBounds(NSPoint point, NSRect bounds)
}
return image;
}
@end
/*
@ -900,6 +901,9 @@ static BOOL done_editing;
}
}
/* Set the arrows cursor in case it might be something else */
[[NSCursor arrowCursor] push];
/*
* Track mouse movements until left mouse up.
* While we keep track of all mouse movements, we only act on a
@ -1067,6 +1071,14 @@ static BOOL done_editing;
eType = [e type];
}
[NSEvent stopPeriodicEvents];
[NSCursor pop];
/* Typically after a view has been dragged in a window, NSWindow
sends a spurious moustEntered event. Sending the mouseUp
event back to the NSWindow resets the NSWindow's idea of the
last mouse point so it doesn't think that the mouse has
entered the view (since it was always there, it's just that
the view moved). */
[[self window] postEvent: e atStart: NO];
/*
* Perform any necessary cleanup.

View file

@ -118,7 +118,7 @@
{
NSPoint loc = [theEvent locationInWindow];
NSView *hit = [super hitTest: loc];
if (hit == rep)
{
int pos = [rep indexOfItemAtPoint: loc];