TitleTip.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /************************************************************************/
  2. /* Copyright (C), 2016-2020, [Home], 保留所有权利;
  3. /* 模 块 名:;
  4. /* 描 述:;
  5. /*
  6. /* 版 本:[V];
  7. /* 作 者:[Home];
  8. /* 日 期:[1/29/2017];
  9. /*
  10. /*
  11. /* 注 意:;
  12. /*
  13. /* 修改记录:[Home];
  14. /* 修改日期:;
  15. /* 修改版本:;
  16. /* 修改内容:;
  17. /************************************************************************/
  18. #ifndef __TITLE_TIP__
  19. #define __TITLE_TIP__
  20. #define TITLETIP_CLASSNAME _T("ZTitleTip")
  21. class CTitleTip : public CWnd
  22. {
  23. // Construction
  24. public:
  25. CTitleTip();
  26. virtual ~CTitleTip();
  27. virtual BOOL Create(CWnd *pParentWnd);
  28. // Attributes
  29. public:
  30. void SetParentWnd(CWnd* pParentWnd) { m_pParentWnd = pParentWnd; }
  31. CWnd* GetParentWnd() { return m_pParentWnd; }
  32. // Operations
  33. public:
  34. void Show(CRect rectTitle, LPCTSTR lpszTitleText,
  35. int xoffset = 0, LPRECT lpHoverRect = NULL,
  36. const LOGFONT* lpLogFont = NULL,
  37. COLORREF crTextClr = CLR_DEFAULT, COLORREF crBackClr = CLR_DEFAULT);
  38. void Hide();
  39. // Overrides
  40. // ClassWizard generated virtual function overrides
  41. //{{AFX_VIRTUAL(CTitleTip)
  42. public:
  43. virtual BOOL PreTranslateMessage(MSG* pMsg);
  44. virtual BOOL DestroyWindow();
  45. //}}AFX_VIRTUAL
  46. // Implementation
  47. protected:
  48. CWnd *m_pParentWnd;
  49. CRect m_rectTitle;
  50. CRect m_rectHover;
  51. DWORD m_dwLastLButtonDown;
  52. DWORD m_dwDblClickMsecs;
  53. BOOL m_bCreated;
  54. // Generated message map functions
  55. protected:
  56. //{{AFX_MSG(CTitleTip)
  57. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  58. //}}AFX_MSG
  59. DECLARE_MESSAGE_MAP()
  60. };
  61. #endif // __TITLE_TIP__