From 6eb283e3496f94b1577a8a1ae9550134fe0e5fd9 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sat, 19 Jun 2004 15:36:58 +0000 Subject: [PATCH] Made drag and drop work on windows. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19554 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/win32/WIN32Server.m | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b2f1ea..cccdc3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-19 Fred Kiefer + + * Source/win32/WIN32Server.m (-findWindowAt:windowRef:excluding:) + New method for D&D. (-dragInfo), (-slideImage:from:to:) Removed. + 2004-06-11 Adam Fedor * Version 0.9.3 diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index 4df7406..18367a7 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -143,18 +143,27 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, [super dealloc]; } -/** Returns an instance of a class which implements the NSDraggingInfo - protocol. */ -- (id ) dragInfo +- (void) restrictWindow: (int)win toImage: (NSImage*)image { - [self subclassResponsibility: _cmd]; - return nil; + //[self subclassResponsibility: _cmd]; } -- (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to +- (int) findWindowAt: (NSPoint)screenLocation + windowRef: (int*)windowRef + excluding: (int)win { - [self subclassResponsibility: _cmd]; - return NO; + HWND hwnd; + POINT p; + + p = GSScreenPointToMS(screenLocation); + hwnd = WindowFromPoint(p); + if ((int)hwnd == win) + { + hwnd = GetWindow(hwnd, GW_HWNDNEXT); + } + + *windowRef = (int)hwnd; + return (int)hwnd; } // FIXME: The following methods wont work for multiple screens