www.pudn.com > 医学图像处理示例源代码.rar > MapPin.h


// ------------------------------------------------------------------------// 
//  Module : MAPPIN.H 
//  Purpose: Interface for an MFC class to draw map pins ala AutoRoute Express 
//  Created: PJN / 12-08-1998 
//  History: None 
// 
//  Copyright (c) 1998 by PJ Naughter.   
//  All rights reserved. 
// ------------------------------------------------------------------------// 
 
/////////////////////////////// Defines /////////////////////////////////////// 
#ifndef __MAPPIN_H__ 
#define __MAPPIN_H__ 
 
class CMapPin : public CWnd 
{ 
public:      
	CMapPin();                // Constructors 
	virtual ~CMapPin();       // Destructors 
public: 
	HICON        m_hIcon; 
	int          m_nIconHeight; 
	int          m_nIconWidth; 
	LPCTSTR      m_lpszMenuResourceName; 
	BOOL         m_bCaptured; 
	CPoint       m_nDragOffset; 
	CToolTipCtrl m_ctrlToolTip; 
	BOOL         m_bAllowDrag; 
	CString      m_sToolTipText; 
	UINT         m_nTimerID; 
	CString      m_sToolTip; 
 
	CPoint		 m_PinPos; 
	int			 m_NO; 
 
public: 
    //Creation 
    BOOL Create(LPCTSTR lpszTooltipText, DWORD dwStyle, const CPoint& p, CWnd* pParentWnd, UINT nID); 
 
    //Icon support 
    BOOL SetIcon(HINSTANCE hModule, LPCTSTR lpszResourceName, BOOL bSmallIcon); 
    BOOL SetIcon(HINSTANCE hModule, UINT nIDResource, BOOL bSmallIcon); 
    HICON GetIcon() const; 
 
    //context menu support 
    void SetPopupMenu(LPCTSTR lpszResourceName); 
    void SetPopupMenu(UINT nIDResource); 
 
    //Dragging support 
    void SetAllowDrag(BOOL bAllowDrag); 
    BOOL GetAllowDrag() const; 
	void MoveToPt(CPoint p); 
 
protected: 
	//{{AFX_VIRTUAL(CMapPin) 
	public: 
	virtual BOOL PreTranslateMessage(MSG* pMsg); 
	//}}AFX_VIRTUAL 
 
	//{{AFX_MSG(CMapPin) 
	afx_msg void OnPaint(); 
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnTimer(UINT nIDEvent); 
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); 
	//}}AFX_MSG 
	afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); 
    afx_msg void OnNeedTooltipText(NMHDR* pNMHDR, LRESULT* pResult); 
	DECLARE_MESSAGE_MAP() 
}; 
 
#endif //__MAPPIN_H__