GridDropTarget.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //////////////////////////////////////////////////////////////////////
  2. // GridDropTarget.h : header file
  3. //
  4. // MFC Grid Control - Drag/Drop target implementation
  5. //
  6. // Written by Chris Maunder <cmaunder@mail.com>
  7. // Copyright (c) 1998-2001. All Rights Reserved.
  8. //
  9. // This code may be used in compiled form in any way you desire. This
  10. // file may be redistributed unmodified by any means PROVIDING it is
  11. // not sold for profit without the authors written consent, and
  12. // providing that this notice and the authors name and all copyright
  13. // notices remains intact.
  14. //
  15. // An email letting me know how you are using it would be nice as well.
  16. //
  17. // This file is provided "as is" with no expressed or implied warranty.
  18. // The author accepts no liability for any damage/loss of business that
  19. // this product may cause.
  20. //
  21. // For use with CGridCtrl v2.10+
  22. //
  23. //////////////////////////////////////////////////////////////////////
  24. #if !defined(AFX_GRIDDROPTARGET_H__5C610981_BD36_11D1_97CD_00A0243D1382__INCLUDED_)
  25. #define AFX_GRIDDROPTARGET_H__5C610981_BD36_11D1_97CD_00A0243D1382__INCLUDED_
  26. #if _MSC_VER >= 1000
  27. #pragma once
  28. #endif // _MSC_VER >= 1000
  29. #include <afxole.h>
  30. class CGridCtrl;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CGridDropTarget command target
  33. class CGridDropTarget : public COleDropTarget
  34. {
  35. public:
  36. CGridDropTarget();
  37. virtual ~CGridDropTarget();
  38. // Attributes
  39. public:
  40. CGridCtrl* m_pGridCtrl;
  41. BOOL m_bRegistered;
  42. // Operations
  43. public:
  44. BOOL Register(CGridCtrl *pGridCtrl);
  45. virtual void Revoke();
  46. BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
  47. DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
  48. void OnDragLeave(CWnd* pWnd);
  49. DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
  50. DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point);
  51. // Overrides
  52. // ClassWizard generated virtual function overrides
  53. //{{AFX_VIRTUAL(CGridDropTarget)
  54. //}}AFX_VIRTUAL
  55. // Implementation
  56. protected:
  57. // Generated message map functions
  58. //{{AFX_MSG(CGridDropTarget)
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. };
  62. /////////////////////////////////////////////////////////////////////////////
  63. //{{AFX_INSERT_LOCATION}}
  64. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  65. #endif // !defined(AFX_GRIDDROPTARGET_H__5C610981_BD36_11D1_97CD_00A0243D1382__INCLUDED_)