mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 14:10:44 +00:00
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:
parent
4822b3f236
commit
21f4065d20
1 changed files with 11 additions and 2 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue