adding translation of NSDragOperationGeneric to wxDragCopy fixes #14059

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-03-02 07:17:45 +00:00
parent 990952304c
commit 9f24a90e2b

View File

@@ -36,6 +36,8 @@ wxDragResult NSDragOperationToWxDragResult(NSDragOperation code)
{
switch (code)
{
case NSDragOperationGeneric:
return wxDragCopy;
case NSDragOperationCopy:
return wxDragCopy;
case NSDragOperationMove:
@@ -250,6 +252,23 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags))
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;
}