ToolTipEx.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #if !defined(AFX_ToolTipEx_H__5796127D_8817_493F_ACA7_8741A6759DD3__INCLUDED_)
  2. #define AFX_ToolTipEx_H__5796127D_8817_493F_ACA7_8741A6759DD3__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ToolTipEx.h : header file
  7. //
  8. #include "RichEditCtrlEx.h"
  9. #include "WndEx.h"
  10. #include "DittoWindow.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CToolTipEx window
  13. #define HIDE_WINDOW_TIMER 1
  14. class CToolTipEx : public CWnd
  15. {
  16. // Construction
  17. public:
  18. CToolTipEx();
  19. // Attributes
  20. public:
  21. // Operations
  22. public:
  23. BOOL OnMsg(MSG* pMsg);
  24. BOOL Create(CWnd* pParentWnd);
  25. BOOL Show(CPoint point);
  26. BOOL Hide();
  27. void SetToolTipText(const CString &csText);
  28. // void SetRTFText(const CString &csRTF);
  29. void SetRTFText(const char *pRTF);
  30. void SetBitmap(CBitmap *pBitmap);
  31. void SetNotifyWnd(CWnd *pNotify) { m_pNotifyWnd = pNotify; }
  32. void HideWindowInXMilliSeconds(long lms) { SetTimer(HIDE_WINDOW_TIMER, lms, NULL); }
  33. CRect GetBoundsRect();
  34. // Overrides
  35. // ClassWizard generated virtual function overrides
  36. //{{AFX_VIRTUAL(CToolTipEx)
  37. protected:
  38. virtual void PostNcDestroy();
  39. virtual BOOL PreTranslateMessage(MSG* pMsg);
  40. //}}AFX_VIRTUAL
  41. // Implementation
  42. public:
  43. virtual ~CToolTipEx();
  44. protected:
  45. DWORD m_dwTextStyle;
  46. CRect m_rectMargin;
  47. CString m_csText;
  48. CFont m_Font;
  49. CBitmap *m_pBitmap;
  50. CString m_csRTF;
  51. CRichEditCtrlEx m_RichEdit;
  52. CWnd *m_pNotifyWnd;
  53. bool m_reducedWindowSize;
  54. CDittoWindow m_DittoWindow;
  55. protected:
  56. CString GetFieldFromString(CString ref, int nIndex, TCHAR ch);
  57. BOOL SetLogFont(LPLOGFONT lpLogFont, BOOL bRedraw /*=TRUE*/);
  58. LPLOGFONT GetSystemToolTipFont();
  59. BOOL IsCursorInToolTip();
  60. // Generated message map functions
  61. protected:
  62. //{{AFX_MSG(CToolTipEx)
  63. afx_msg void OnPaint();
  64. afx_msg void OnSize(UINT nType, int cx, int cy);
  65. afx_msg HITTEST_RET OnNcHitTest(CPoint point);
  66. afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
  67. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  68. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  69. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  70. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  71. afx_msg void OnNcPaint();
  72. //}}AFX_MSG
  73. DECLARE_MESSAGE_MAP()
  74. public:
  75. afx_msg void OnTimer(UINT_PTR nIDEvent);
  76. };
  77. /////////////////////////////////////////////////////////////////////////////
  78. //{{AFX_INSERT_LOCATION}}
  79. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  80. #endif // !defined(AFX_ToolTipEx_H__5796127D_8817_493F_ACA7_8741A6759DD3__INCLUDED_)