#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+#include "wx/object.h"
+#endif
+
#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
{
switch (code)
{
+ case NSDragOperationGeneric:
+ return wxDragCopy;
case NSDragOperationCopy:
return wxDragCopy;
case NSDragOperationMove:
- (id)init
{
- [super init];
+ self = [super init];
dragFinished = NO;
resultCode = NSDragOperationNone;
impl = 0;
wxASSERT_MSG(theEvent, "DoDragDrop must be called in response to a mouse down or drag event.");
NSPoint down = [theEvent locationInWindow];
- NSPoint p = [view convertPoint:down toView:nil];
+ NSPoint p = [view convertPoint:down fromView:nil];
gCurrentSource = this;
result = NSDragOperationToWxDragResult([delegate code]);
[delegate release];
[image release];
+
+ wxWindow* mouseUpTarget = wxWindow::GetCapture();
+
+ if ( mouseUpTarget == NULL )
+ {
+ mouseUpTarget = m_window;
+ }
+
+ if ( mouseUpTarget != NULL )
+ {
+ wxMouseEvent wxevent(wxEVT_LEFT_DOWN);
+ ((wxWidgetCocoaImpl*)mouseUpTarget->GetPeer())->SetupMouseEvent(wxevent , theEvent) ;
+ wxevent.SetEventType(wxEVT_LEFT_UP);
+
+ mouseUpTarget->HandleWindowEvent(wxevent);
+ }
+
gCurrentSource = NULL;
}