ToolTipEx.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /////////////////////////////////////////////////////////////////////////////
  11. // CToolTipEx window
  12. class CToolTipEx : public CWnd
  13. {
  14. // Construction
  15. public:
  16. CToolTipEx();
  17. // Attributes
  18. public:
  19. // Operations
  20. public:
  21. BOOL OnMsg(MSG* pMsg);
  22. BOOL Create(CWnd* pParentWnd);
  23. BOOL Show(CPoint point);
  24. BOOL Hide();
  25. void SetToolTipText(const CString &csText);
  26. void SetRTFText(const CString &csRTF);
  27. void SetBitmap(CBitmap *pBitmap);
  28. void SetNotifyWnd(CWnd *pNotify) { m_pNotifyWnd = pNotify; }
  29. // Overrides
  30. // ClassWizard generated virtual function overrides
  31. //{{AFX_VIRTUAL(CToolTipEx)
  32. protected:
  33. virtual void PostNcDestroy();
  34. virtual BOOL PreTranslateMessage(MSG* pMsg);
  35. //}}AFX_VIRTUAL
  36. // Implementation
  37. public:
  38. virtual ~CToolTipEx();
  39. protected:
  40. DWORD m_dwTextStyle;
  41. CRect m_rectMargin;
  42. CString m_csText;
  43. CFont m_Font;
  44. CBitmap *m_pBitmap;
  45. CString m_csRTF;
  46. CRichEditCtrlEx m_RichEdit;
  47. CWnd *m_pNotifyWnd;
  48. protected:
  49. CString GetFieldFromString(CString ref, int nIndex, TCHAR ch);
  50. CRect GetBoundsRect();
  51. BOOL SetLogFont(LPLOGFONT lpLogFont, BOOL bRedraw /*=TRUE*/);
  52. LPLOGFONT GetSystemToolTipFont();
  53. BOOL IsCursorInToolTip();
  54. // Generated message map functions
  55. protected:
  56. //{{AFX_MSG(CToolTipEx)
  57. afx_msg void OnPaint();
  58. afx_msg void OnSize(UINT nType, int cx, int cy);
  59. afx_msg UINT OnNcHitTest(CPoint point);
  60. afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. };
  64. /////////////////////////////////////////////////////////////////////////////
  65. //{{AFX_INSERT_LOCATION}}
  66. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  67. #endif // !defined(AFX_ToolTipEx_H__5796127D_8817_493F_ACA7_8741A6759DD3__INCLUDED_)