mirror of
https://github.com/reactos/reactos.git
synced 2025-05-24 03:24:45 +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:
parent
e88de75145
commit
73e04c0cd1
1 changed files with 23 additions and 1 deletions
|
@ -97,6 +97,7 @@ class CDefView :
|
||||||
DWORD m_dwAdvf;
|
DWORD m_dwAdvf;
|
||||||
CComPtr<IAdviseSink> m_pAdvSink;
|
CComPtr<IAdviseSink> m_pAdvSink;
|
||||||
// for drag and drop
|
// for drag and drop
|
||||||
|
CComPtr<IDataObject> m_pSourceDataObject;
|
||||||
CComPtr<IDropTarget> m_pCurDropTarget; /* The sub-item, which is currently dragged over */
|
CComPtr<IDropTarget> m_pCurDropTarget; /* The sub-item, which is currently dragged over */
|
||||||
CComPtr<IDataObject> m_pCurDataObject; /* The dragged data-object */
|
CComPtr<IDataObject> m_pCurDataObject; /* The dragged data-object */
|
||||||
LONG m_iDragOverItem; /* Dragged over item's index, iff m_pCurDropTarget != NULL */
|
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;
|
DWORD dwEffect2;
|
||||||
|
|
||||||
|
m_pSourceDataObject = pda;
|
||||||
|
|
||||||
DoDragDrop(pda, this, dwEffect, &dwEffect2);
|
DoDragDrop(pda, this, dwEffect, &dwEffect2);
|
||||||
|
|
||||||
|
m_pSourceDataObject.Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2937,7 +2943,23 @@ HRESULT WINAPI CDefView::DragLeave()
|
||||||
|
|
||||||
HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
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->Drop(pDataObject, grfKeyState, pt, pdwEffect);
|
||||||
m_pCurDropTarget.Release();
|
m_pCurDropTarget.Release();
|
||||||
|
|
Loading…
Reference in a new issue