home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 8090 / ModelEdit.7z / DragList.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-03-08  |  2.2 KB  |  73 lines

  1. #if !defined(AFX_DRAGLIST_H__EF24D841_9B4E_11D3_B959_00609709830E__INCLUDED_)
  2. #define AFX_DRAGLIST_H__EF24D841_9B4E_11D3_B959_00609709830E__INCLUDED_
  3.  
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7. // DragList.h : header file
  8. //
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // Drop notification callback
  12. typedef void (CObject::*FDragListCallback)(int iDropIndex);
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CDragList window
  16.  
  17. class CDragList : public CListCtrl
  18. {
  19. // Construction
  20. public:
  21.     CDragList();
  22.  
  23. // Attributes
  24. protected:
  25.     BOOL m_bDragging;
  26.     CImageList *m_pDragImage;
  27.     int m_iDragIndex, m_iDropIndex;
  28.     FDragListCallback m_fDropNotify;
  29.     CObject *m_pDropNotifyObject;
  30.  
  31.     virtual void ShowDropTarget(int iItem);
  32.     virtual void ClearDropTarget();
  33. public:
  34.     virtual BOOL GetDragging() const { return m_bDragging; };
  35.     virtual CImageList *GetDragImage() const { return m_pDragImage; };
  36.  
  37.     virtual int GetDragIndex() const { return m_iDragIndex; };
  38.     virtual int GetDropIndex() const { return m_iDropIndex; };
  39.  
  40.     virtual void SetDropNotify(CObject *pObject, FDragListCallback fNotify) { m_pDropNotifyObject = pObject; m_fDropNotify = fNotify; };
  41.     virtual FDragListCallback GetDropNotify() const { return m_fDropNotify; };
  42.     virtual CObject *GetDropNotifyObject() const { return m_pDropNotifyObject; };
  43.  
  44. // Operations
  45. public:
  46.  
  47. // Overrides
  48.     // ClassWizard generated virtual function overrides
  49.     //{{AFX_VIRTUAL(CDragList)
  50.     //}}AFX_VIRTUAL
  51.  
  52. // Implementation
  53. public:
  54.     virtual ~CDragList();
  55.  
  56.     // Generated message map functions
  57. protected:
  58.     //{{AFX_MSG(CDragList)
  59.     afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
  60.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  61.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  62.     //}}AFX_MSG
  63.  
  64.     DECLARE_MESSAGE_MAP()
  65. };
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68.  
  69. //{{AFX_INSERT_LOCATION}}
  70. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  71.  
  72. #endif // !defined(AFX_DRAGLIST_H__EF24D841_9B4E_11D3_B959_00609709830E__INCLUDED_)
  73.