TitleTip.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #define TITLETIP_CLASSNAME _T("ZTitleTip")
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CTitleTip window
  5. class CTitleTip : public CWnd
  6. {
  7. // Construction
  8. public:
  9. CTitleTip();
  10. virtual ~CTitleTip();
  11. virtual BOOL Create(CWnd *pParentWnd);
  12. // Attributes
  13. public:
  14. void SetParentWnd(CWnd* pParentWnd) { m_pParentWnd = pParentWnd; }
  15. CWnd* GetParentWnd() { return m_pParentWnd; }
  16. // Operations
  17. public:
  18. void Show(CRect rectTitle, LPCTSTR lpszTitleText,
  19. int xoffset = 0, LPRECT lpHoverRect = NULL,
  20. const LOGFONT* lpLogFont = NULL,
  21. COLORREF crTextClr = CLR_DEFAULT, COLORREF crBackClr = CLR_DEFAULT);
  22. void Hide();
  23. // Overrides
  24. // ClassWizard generated virtual function overrides
  25. //{{AFX_VIRTUAL(CTitleTip)
  26. public:
  27. virtual BOOL PreTranslateMessage(MSG* pMsg);
  28. virtual BOOL DestroyWindow();
  29. //}}AFX_VIRTUAL
  30. // Implementation
  31. protected:
  32. CWnd *m_pParentWnd;
  33. CRect m_rectTitle;
  34. CRect m_rectHover;
  35. DWORD m_dwLastLButtonDown;
  36. DWORD m_dwDblClickMsecs;
  37. BOOL m_bCreated;
  38. // Generated message map functions
  39. protected:
  40. //{{AFX_MSG(CTitleTip)
  41. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  42. //}}AFX_MSG
  43. DECLARE_MESSAGE_MAP()
  44. };