66 lines
2.4 KiB
C++
66 lines
2.4 KiB
C++
//////////////////////////////////////////////////////////////////////////
|
|
// 在文件视图中实现拖动的类
|
|
// 创建人: 黄荣平
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// (C) Copyright 1996,1998 by Autodesk, Inc.
|
|
//
|
|
// Permission to use, copy, modify, and distribute this software in
|
|
// object code form for any purpose and without fee is hereby granted,
|
|
// provided that the above copyright notice appears in all copies and
|
|
// that both that copyright notice and the limited warranty and
|
|
// restricted rights notice below appear in all supporting
|
|
// documentation.
|
|
//
|
|
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
|
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
|
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
|
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
|
// UNINTERRUPTED OR ERROR FREE.
|
|
//
|
|
// Use, duplication, or disclosure by the U.S. Government is subject to
|
|
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
|
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
|
// (Rights in Technical Data and Computer Software), as applicable.
|
|
//
|
|
|
|
#ifndef __DRAWDROPTARGET_H__
|
|
#define __DRAWDROPTARGET_H__
|
|
class CMyOverrideDropTarget : public COleDropTarget
|
|
{
|
|
public:
|
|
CMyOverrideDropTarget(int nType,AcDbObjectId BlockId,int nColor,CString sPattern,double dScale,BOOL bExplode);
|
|
~CMyOverrideDropTarget();
|
|
|
|
virtual DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject,
|
|
DWORD dwKeyState, CPoint point);
|
|
virtual DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject,
|
|
DWORD dwKeyState, CPoint point);
|
|
virtual BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject,
|
|
DROPEFFECT dropEffect, CPoint point);
|
|
virtual void OnDragLeave(CWnd* pWnd);
|
|
virtual DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject,
|
|
DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point);
|
|
public:
|
|
void patternHatch(CString sPattern,ads_point pt);
|
|
void ColorHatch(int nIndex,ads_point pt);
|
|
int m_nType ;//操作类型:0表示图块插入,1表示颜色填充,2表示图案填充
|
|
AcDbObjectId m_BlockId;
|
|
private:
|
|
BOOL m_bExplode;
|
|
double m_dScale;
|
|
CString m_sPattern;
|
|
int m_nColor;
|
|
BOOL m_bDrag;
|
|
CPoint m_lastDragPt;
|
|
DROPEFFECT m_prevDropEffect;
|
|
CSize m_trackerSize;
|
|
int m_rad;
|
|
int m_nIndex;
|
|
AcDbObjectId m_BlfId;
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // __DRAWDROPTARGET_H__
|