mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
[SHELL32]
- CDefView: Add the skeleton check that should be used to implement moving items in the CDefView. Nothing more is implemented because GetKeyState is completely unreliable. svn path=/trunk/; revision=71979
This commit is contained in:
@@ -97,6 +97,7 @@ class CDefView :
|
||||
DWORD m_dwAdvf;
|
||||
CComPtr<IAdviseSink> m_pAdvSink;
|
||||
// for drag and drop
|
||||
CComPtr<IDataObject> m_pSourceDataObject;
|
||||
CComPtr<IDropTarget> m_pCurDropTarget; /* The sub-item, which is currently dragged over */
|
||||
CComPtr<IDataObject> m_pCurDataObject; /* The dragged data-object */
|
||||
LONG m_iDragOverItem; /* Dragged over item's index, iff m_pCurDropTarget != NULL */
|
||||
@@ -1786,7 +1787,12 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||
}
|
||||
|
||||
DWORD dwEffect2;
|
||||
|
||||
m_pSourceDataObject = pda;
|
||||
|
||||
DoDragDrop(pda, this, dwEffect, &dwEffect2);
|
||||
|
||||
m_pSourceDataObject.Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2937,7 +2943,23 @@ HRESULT WINAPI CDefView::DragLeave()
|
||||
|
||||
HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
if (m_pCurDropTarget)
|
||||
ERR("GetKeyState(VK_LBUTTON): %d\n", GetKeyState(VK_LBUTTON));
|
||||
|
||||
if ((m_iDragOverItem == -1) &&
|
||||
(*pdwEffect & DROPEFFECT_MOVE) &&
|
||||
(GetKeyState(VK_LBUTTON) != 0) &&
|
||||
(m_pSourceDataObject.p) &&
|
||||
(SHIsSameObject(pDataObject, m_pSourceDataObject)))
|
||||
{
|
||||
ERR("Should implement moving items here!\n");
|
||||
|
||||
if (m_pCurDropTarget)
|
||||
{
|
||||
m_pCurDropTarget->DragLeave();
|
||||
m_pCurDropTarget.Release();
|
||||
}
|
||||
}
|
||||
else if (m_pCurDropTarget)
|
||||
{
|
||||
m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect);
|
||||
m_pCurDropTarget.Release();
|
||||
|
||||
Reference in New Issue
Block a user