当前位置: 首页>>代码示例>>C++>>正文


C++ CImageList::DragEnter方法代码示例

本文整理汇总了C++中CImageList::DragEnter方法的典型用法代码示例。如果您正苦于以下问题:C++ CImageList::DragEnter方法的具体用法?C++ CImageList::DragEnter怎么用?C++ CImageList::DragEnter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CImageList的用法示例。


在下文中一共展示了CImageList::DragEnter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnDragEnter

DROPEFFECT BookmarkToolBar::OnDragEnter(COleDataObject *aOleDataObject, DWORD aKeyState, CPoint aPoint)
{
    DROPEFFECT sDropEffect = DROPEFFECT_LINK;

    DragImage &sDragImage = DragImage::instance();

    if (sDragImage.isMyDragging() == XPR_TRUE)
    {
        CImageList *sMyDragImage = sDragImage.getMyDragImage();
        if (XPR_IS_NOT_NULL(sMyDragImage))
        {
            sMyDragImage->DragEnter(GetDesktopWindow(), aPoint);
            sMyDragImage->DragShowNolock(XPR_TRUE);
        }
    }
    else
    {
        if (mDropTarget.isUseDropHelper() == XPR_TRUE)
        {
            CPoint sDragPoint(aPoint);
            IDataObject *sDataObject = aOleDataObject->GetIDataObject(XPR_FALSE);
            mDropTarget.getDropHelper()->DragEnter(GetSafeHwnd(), sDataObject, &sDragPoint, sDropEffect);
        }
    }

    mOldInsert = -1;
    mOldBookmark = -1;

    return sDropEffect;
}
开发者ID:fxfile,项目名称:fxfile,代码行数:30,代码来源:bookmark_toolbar.cpp

示例2: OnLvnBegindrag

void CSharedDirsTreeCtrl::OnLvnBegindrag(NMHDR* pNMHDR, LRESULT* pResult) 
{
	LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)pNMHDR;
	*pResult = 0;

	CDirectoryItem* pToDrag = (CDirectoryItem*)lpnmtv->itemNew.lParam;
	if (pToDrag == NULL || pToDrag->m_eItemType != SDI_UNSHAREDDIRECTORY || FileSystemTreeIsShared(pToDrag->m_strFullPath))
		return;

	ASSERT( m_pDraggingItem == NULL );
	delete m_pDraggingItem;
	m_pDraggingItem = pToDrag->CloneContent(); // to be safe we store a copy, as items can be deleted when collapsing the tree etc

	CImageList* piml = NULL;
	POINT ptOffset;
	RECT rcItem;
	if ((piml = CreateDragImage(lpnmtv->itemNew.hItem)) == NULL)
		return;

	/* get the bounding rectangle of the item being dragged (rel to top-left of control) */
	if (GetItemRect(lpnmtv->itemNew.hItem, &rcItem, TRUE))
	{
		CPoint ptDragBegin;
		int nX, nY;
		/* get offset into image that the mouse is at */
		/* item rect doesn't include the image */
		ptDragBegin = lpnmtv->ptDrag;
		ImageList_GetIconSize(piml->GetSafeHandle(), &nX, &nY);
		ptOffset.x = (ptDragBegin.x - rcItem.left) + (nX - (rcItem.right - rcItem.left));
		ptOffset.y = (ptDragBegin.y - rcItem.top) + (nY - (rcItem.bottom - rcItem.top));
		/* convert the item rect to screen co-ords, for use later */
		MapWindowPoints(NULL, &rcItem);
	}
	else
	{
		GetWindowRect(&rcItem);
		ptOffset.x = ptOffset.y = 8;
	}

	if (piml->BeginDrag(0, ptOffset))
	{
		CPoint ptDragEnter = lpnmtv->ptDrag;
		ClientToScreen(&ptDragEnter);
		piml->DragEnter(NULL, ptDragEnter);
	}
	delete piml;

	/* set the focus here, so we get a WM_CANCELMODE if needed */
	SetFocus();

	/* redraw item being dragged, otherwise it remains (looking) selected */
	InvalidateRect(&rcItem, TRUE);
	UpdateWindow();

	/* Hide the mouse cursor, and direct mouse input to this window */
	SetCapture(); 
}
开发者ID:machado2,项目名称:emule,代码行数:57,代码来源:SharedDirsTreeCtrl.cpp

示例3: CPoint

	void		OnDragEnter( CPoint& pointp ){
		if( m_pDragImage ){
			delete m_pDragImage;
		}
	
		m_pDragImage	= m_List.CreateDragImage( m_nDragIndex, &pt );
		ASSERT(m_pDragImage);

		m_pDragImage->BeginDrag( 0, CPoint(8, 8) );
		m_pDragImage->DragEnter( GetDesktopWindow(), ((NM_LISTVIEW *)pnmhdr)->ptAction );

		m_bDragging		= TRUE;
		m_hDropItem		= NULL;
		m_nDropIndex	= -1;
		m_pDropWnd		= &m_List;

		SetCapture();
	}
开发者ID:H2-T23,项目名称:garage,代码行数:18,代码来源:DragAndDropList.cpp

示例4: OnBegindragMylist

void hdCLibDlg::OnBegindragMylist(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
	m_dragItem = pNMTreeView->itemNew.hItem;

	if(m_dragItem!=ModelParent)
	{
		CImageList* pDragImage;
		pDragImage = m_mylist.CreateDragImage( m_dragItem );
		m_mylist.SelectItem( m_dragItem );
		pDragImage->BeginDrag( 0, CPoint(0,-14) );
		pDragImage->DragEnter(this, pNMTreeView->ptDrag);
		SetCapture();
		m_bIsDragging = TRUE;
		delete pDragImage;
		bDragFromLibrary=FALSE;
		SetTimer ( 1, 75, NULL ) ;
	}

	*pResult = 0;
}
开发者ID:philm001,项目名称:Omni-FEM,代码行数:21,代码来源:hd_libdlg.cpp

示例5: OnMouseMove

void CSpiroView::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (m_bMovingPencil || m_pFigureDrag != NULL)  // the user is dragging the pencil location
	{
		CPoint ptWindow(point);
		ClientToScreen(&ptWindow);
		CRect	rectWindow;
		GetWindowRect(&rectWindow);
		ptWindow.Offset(-rectWindow.left, -rectWindow.top);

		CImageList* pImList = m_bMovingPencil? &GetApp()->m_imageList : m_pILDragFigure;

		ENSURE(pImList != NULL);
		if (m_bStartDrag)
		{
			ENSURE(m_pFigureDrag != NULL);
			m_bStartDrag = false;
			CSpiroRect rect;
			m_pFigureDrag->GetBoundingRect(&rect);
			rect.Scale(m_nZoomNumer, m_nZoomDenom);
			CDC* pDC = GetDC();
			ENSURE(pDC != NULL);
			OnPrepareDC(pDC);
			pDC->LPtoDP(&rect);
			ReleaseDC(pDC);
			rect.InflateRect(4, 4);
			InvalidateRect(&rect);
			pImList->DragLeave(this);
			UpdateWindow();
			pImList->DragEnter(this, ptWindow);
		}
		else
			pImList->DragMove(ptWindow);

		return;
	}

	CScrollView::OnMouseMove(nFlags, point);
}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:39,代码来源:spiroView.cpp


注:本文中的CImageList::DragEnter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。