void CTreeViewEx::DragEnd() 
{
 	eTYPE_DROPPING eDropping;
	HTREEITEM hDroppingItem = GetDropItem(eDropping);
    
    if (hDroppingItem == NULL)
    {
        return;
    }
    CTreeCtrl& omTempTreeCtrl = GetTreeCtrl();
    UINT unFirstIndex = unGetIndex(m_hDraggingItemgedItem);
    HTREEITEM hInsertAfter = DragMoveItem(m_hDraggingItemgedItem, hDroppingItem, eDropping);
    if(hInsertAfter == NULL)
    {
        return;
    }
    DWORD_PTR dwRepositionItemID = omTempTreeCtrl.GetItemData(m_hDraggingItemgedItem);
    DWORD_PTR dwInsertAfterItemID;
    if(hInsertAfter == TVI_FIRST)
    {
        dwInsertAfterItemID = (DWORD)-1;
    }
    else
    {
        dwInsertAfterItemID = omTempTreeCtrl.GetItemData(hInsertAfter);
    }
    
    UINT unNewID = GetExecutorWindow()->unRepisitonEntry((DWORD)dwRepositionItemID, (DWORD)dwInsertAfterItemID);
    //omTempTreeCtrl.SetItemData(m_hDraggingItemgedItem, unNewID);

}
Exemple #2
0
/******************************************************************************
Function Name  :  DragEnd
Input(s)       :
Output         :  void
Functionality  :
Member of      :  CTreeViewEx
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  30/03/2011
Modifications  :
******************************************************************************/
void CTreeViewEx::DragEnd(VOID)
{
    eTYPE_DROPPING eDropping;
    HTREEITEM hDroppingItem = GetDropItem(eDropping);

    if (hDroppingItem == NULL)
    {
        return;
    }
    CTreeCtrl& omTempTreeCtrl = GetTreeCtrl();
    //UINT unFirstIndex = unGetIndex(m_hDraggingItemgedItem);
    HTREEITEM hInsertAfter = DragMoveItem(m_hDraggingItemgedItem, hDroppingItem, eDropping);
    if(hInsertAfter == NULL)
    {
        return;
    }
    //W4 Removal
    DWORD dwRepositionItemID = (DWORD)omTempTreeCtrl.GetItemData(m_hDraggingItemgedItem);
    DWORD dwInsertAfterItemID;
    if(hInsertAfter == TVI_FIRST)
    {
        //W4 Removal
        dwInsertAfterItemID = (DWORD)-1;
    }
    else
    {
        //W4 Removal
        dwInsertAfterItemID = (DWORD)omTempTreeCtrl.GetItemData(hInsertAfter);
    }
    HTREEITEM hParent = omTempTreeCtrl.GetParentItem(m_hDraggingItemgedItem);
    //W4 Removal
    UINT unNewID = GetEditorWindow()->unRepisitonEntry((DWORD)dwRepositionItemID, (DWORD)dwInsertAfterItemID, (DWORD)omTempTreeCtrl.GetItemData(hParent));
    omTempTreeCtrl.SetItemData(m_hDraggingItemgedItem, unNewID);
    GetEditorWindow()->vSetFileSavedFlag(FALSE);
}
void CTreeViewEx::DragMove(CPoint /*point*/)
{
	eTYPE_DROPPING eDropping;
	HTREEITEM hDroppingItem = GetDropItem(eDropping);
    GetTreeCtrl().SetInsertMark(0, 0);
    if(eDropping == DROPPING_ABOVE)
    {
        GetTreeCtrl().SetInsertMark(hDroppingItem, FALSE);
    }
    if(eDropping == DROPPING_BELOW)
    {
        GetTreeCtrl().SetInsertMark(hDroppingItem);
    }
	SetDraggingCursor(eDropping);
}