Use mouse down event for drag

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@8814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2001-01-26 18:19:12 +00:00
parent 4822b3f236
commit 21f4065d20

View file

@ -37,6 +37,7 @@
@interface GormPaletteView : NSView
{
NSPoint mouseDownPoint;
NSEvent *mouseDownEvent;
BOOL shouldBeginDrag;
NSPasteboard *dragPb;
}
@ -69,6 +70,13 @@ static NSImage *dragImage = nil;
return self;
}
- (void) dealloc
{
DESTROY(dragPb);
DESTROY(mouseDownEvent);
[super dealloc];
}
/*
* Dragging source protocol implementation
*/
@ -138,7 +146,8 @@ static NSImage *dragImage = nil;
{
NSView *view;
mouseDownPoint = [theEvent locationInWindow];
ASSIGN(mouseDownEvent, theEvent);
mouseDownPoint = [mouseDownEvent locationInWindow];
view = [super hitTest: mouseDownPoint];
if (view == self)
{
@ -183,7 +192,7 @@ static NSImage *dragImage = nil;
[self dragImage: dragImage
at: rect.origin
offset: offset
event: theEvent
event: mouseDownEvent
pasteboard: pb
source: self
slideBack: [type isEqual: IBWindowPboardType] ? NO : YES];