don't call OnData() if OnEnter() rejected the drag (#9634)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-28 01:40:42 +00:00
parent 5b7668004b
commit 4095fb14c4

View File

@@ -244,15 +244,20 @@ STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState,
result = wxDragNone; result = wxDragNone;
} }
// we need client coordinates to pass to wxWin functions if ( result != wxDragNone ) {
if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) // we need client coordinates to pass to wxWin functions
{ if ( !ScreenToClient(m_hwnd, (POINT *)&pt) )
wxLogLastError(wxT("ScreenToClient")); {
} wxLogLastError(wxT("ScreenToClient"));
}
*pdwEffect = ConvertDragResultToEffect( *pdwEffect = ConvertDragResultToEffect(
m_pTarget->OnDragOver(pt.x, pt.y, result) m_pTarget->OnDragOver(pt.x, pt.y, result)
); );
}
else {
*pdwEffect = DROPEFFECT_NONE;
}
return S_OK; return S_OK;
} }