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


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

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


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

示例1: OnDragOver

DROPEFFECT FileScrapDropDlg::OnDragOver(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))
        {
            CPoint sDragPoint(aPoint);
            ClientToScreen(&sDragPoint);
            sMyDragImage->DragMove(sDragPoint);
        }
    }
    else
    {
        if (mDropTarget.isUseDropHelper() == XPR_TRUE)
        {
            CPoint sDragPoint(aPoint);
            mDropTarget.getDropHelper()->DragOver(&sDragPoint, sDropEffect);
        }
    }

    return sDropEffect;
}
开发者ID:3rdexp,项目名称:fxfile,代码行数:27,代码来源:file_scrap_drop_dlg.cpp

示例2:

	void		OnDragging( CPoint& point ){
		if( m_bDragging )
		{
			CPoint	pt(point);
			ClientToScreen( &pt );
			m_pDragImage->DragMove( pt );
			m_pDragImage->DragShowNolock( FALSE );

			CWnd* pDropWnd	= CWnd::WindowFromPoint( pt );
			ASSERT(pDropWnd);

			if( pDropWnd != m_pDropWnd )
			{
				if( m_hDropItem )
				{
					((CTreeCtrl*)m_pDropWnd)->SelectDropTarget( NULL );
					m_hDropItem = NULL;
				}

				if( m_nDropIndex != -1 )
				{
					CListCtrl* pList	= (CListCtrl*)m_pDropWnd;
					pList->SetItemState( m_nDropIndex, 0, LVIS_DROPHILITED );
					pList->RedrawItems( m_nDropIndex, m_nDropIndex );
					pList->UpdateWindow();
					m_nDropIndex = -1;
				}
			}

			m_pDropWnd	= pDropWnd;
			pDropWnd->ScreenToClient( &pt );

			if( pDropWnd->IsKindOf(RUNTIME_CLASS(CTreeCtrl)) )
			{			
				UINT uFlags;
				m_hDropItem		= ((CTreeCtrl*)pDropWnd)->HitTest( pt, &uFlags );
				((CTreeCtrl*)pDropWnd)->SelectDropTarget( m_hDropItem );
			}
			else
			if( pDropWnd->IsKindOf(RUNTIME_CLASS(CListCtrl)) )
			{			
				UINT uFlags;
				CListCtrl* pList	= (CListCtrl*)pDropWnd;

				pList->SetItemState( m_nDropIndex, 0, LVIS_DROPHILITED );
				pList->RedrawItems( m_nDropIndex, m_nDropIndex );

				m_nDropIndex	= ((CListCtrl*)pDropWnd)->HitTest( pt, &uFlags );

				pList->SetItemState( m_nDropIndex, LVIS_DROPHILITED, LVIS_DROPHILITED );
				pList->RedrawItems( m_nDropIndex, m_nDropIndex );
				pList->UpdateWindow();
			}

			m_pDragImage->DragShowNolock( TRUE );
		}
	}
开发者ID:H2-T23,项目名称:garage,代码行数:57,代码来源:DragAndDropList.cpp

示例3: 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

示例4: OnDragOver

DROPEFFECT BookmarkToolBar::OnDragOver(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))
        {
            CPoint sDragPoint(aPoint);
            ClientToScreen(&sDragPoint);
            sMyDragImage->DragMove(sDragPoint);
        }
    }
    else
    {
        if (mDropTarget.isUseDropHelper() == XPR_TRUE)
        {
            CPoint sDragPoint(aPoint);
            mDropTarget.getDropHelper()->DragOver(&sDragPoint, sDropEffect);
        }
    }

    CToolBarCtrl &sToolBarCtrl = GetToolBarCtrl();

    TBBUTTON sTbButton = {0};
    TBINSERTMARK sTbInsertMark = {0};
    xpr_sint_t sHitTest = GetToolBarCtrl().HitTest(&aPoint);
    xpr_sint_t sInsertHitTest = -1;
    if (sToolBarCtrl.InsertMarkHitTest(&aPoint, &sTbInsertMark) && sTbInsertMark.iButton >= 0)
        sInsertHitTest = sTbInsertMark.iButton;

    xpr_sint_t sBookmark, sInsert;
    if (XPR_TEST_BITS(aKeyState, MK_SHIFT) && XPR_TEST_BITS(aKeyState, MK_CONTROL))
    {
        sInsert = -1;
        sBookmark = -1;
    }
    else
    {
        if (sHitTest < 0 || sInsertHitTest >= 0)
        {
            if (sTbInsertMark.dwFlags == TBIMHT_AFTER)
            {
                sTbInsertMark.dwFlags = 0;
                sInsertHitTest++;
            }

            if (sHitTest == -1)
                sInsertHitTest = -1;

            sInsert = sInsertHitTest;
            sBookmark = -1;
        }
        else
        {
            sInsert = -1;
            sBookmark = sHitTest;
        }
    }

    BookmarkMgr &sBookmarkMgr = BookmarkMgr::instance();

    if (sBookmark >= sBookmarkMgr.getCount())
        sBookmark = -1;

    if (sBookmark != -1)
    {
        sDropEffect = DROPEFFECT_LINK;

        BookmarkItem *sBookmarkItem = sBookmarkMgr.getBookmark(sBookmark);
        if (sBookmarkItem != XPR_NULL)
        {
            xpr_bool_t sGetPidl = XPR_TRUE;
            LPITEMIDLIST sFullPidl = XPR_NULL;

            if (IsNetItem(sBookmarkItem->mPath.c_str()))
                sGetPidl = WnetMgr::instance().isConnectedServer(sBookmarkItem->mPath);

            if (sGetPidl == XPR_TRUE)
                sFullPidl = Path2Pidl(sBookmarkItem->mPath);

            if (sFullPidl != XPR_NULL && IsFileSystemFolder(sFullPidl))
            {
                sDropEffect = DROPEFFECT_MOVE;

                if (aKeyState & MK_ALT)          sDropEffect = DROPEFFECT_LINK;
                else if (aKeyState & MK_CONTROL) sDropEffect = DROPEFFECT_COPY;
                else if (aKeyState & MK_SHIFT)   sDropEffect = DROPEFFECT_MOVE;
                else
                {
                    switch (gOpt->mConfig.mDragDefaultFileOp)
                    {
                    case DRAG_FILE_OP_DEFAULT:  sDropEffect = DROPEFFECT_MOVE; break;
                    case DRAG_FILE_OP_COPY:     sDropEffect = DROPEFFECT_COPY; break;
                    case DRAG_FILE_OP_LINK:     sDropEffect = DROPEFFECT_LINK; break;
                    default:                    sDropEffect = DROPEFFECT_MOVE; break;
                    }
//.........这里部分代码省略.........
开发者ID:fxfile,项目名称:fxfile,代码行数:101,代码来源:bookmark_toolbar.cpp


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