ToolTipEx.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. #include "GdipButton.h"
  12. #include "ImageViewer.h"
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CToolTipEx window
  15. class CToolTipEx : public CWnd
  16. {
  17. // Construction
  18. public:
  19. CToolTipEx();
  20. // Attributes
  21. public:
  22. // Operations
  23. public:
  24. BOOL OnMsg(MSG* pMsg);
  25. BOOL Create(CWnd* pParentWnd);
  26. BOOL Show(CPoint point);
  27. BOOL Hide();
  28. void SetToolTipText(const CString &csText);
  29. // void SetRTFText(const CString &csRTF);
  30. void SetRTFText(const char *pRTF);
  31. void SetBitmap(CBitmap *pBitmap);
  32. void SetNotifyWnd(CWnd *pNotify) { m_pNotifyWnd = pNotify; }
  33. void HideWindowInXMilliSeconds(long lms);
  34. CRect GetBoundsRect();
  35. void SetClipId(int clipId) { m_clipId = clipId; }
  36. int GetClipId() { return m_clipId; }
  37. void SetSearchText(CString text) { m_searchText = text; }
  38. // Overrides
  39. // ClassWizard generated virtual function overrides
  40. //{{AFX_VIRTUAL(CToolTipEx)
  41. protected:
  42. virtual void PostNcDestroy();
  43. virtual BOOL PreTranslateMessage(MSG* pMsg);
  44. //}}AFX_VIRTUAL
  45. // Implementation
  46. public:
  47. virtual ~CToolTipEx();
  48. protected:
  49. DWORD m_dwTextStyle;
  50. CRect m_rectMargin;
  51. CString m_csText;
  52. CFont m_Font;
  53. CString m_csRTF;
  54. CRichEditCtrlEx m_RichEdit;
  55. CWnd *m_pNotifyWnd;
  56. bool m_reducedWindowSize;
  57. CGdipButton m_optionsButton;
  58. int m_clipId;
  59. CString m_searchText;
  60. CScrollBar m_vScroll;
  61. CScrollBar m_hScroll;
  62. CDittoWindow m_DittoWindow;
  63. CImageViewer m_imageViewer;
  64. bool m_saveWindowLockout;
  65. protected:
  66. CString GetFieldFromString(CString ref, int nIndex, TCHAR ch);
  67. BOOL SetLogFont(LPLOGFONT lpLogFont, BOOL bRedraw /*=TRUE*/);
  68. LPLOGFONT GetSystemToolTipFont();
  69. BOOL IsCursorInToolTip();
  70. void HighlightSearchText();
  71. void DoSearch();
  72. void ApplyWordWrap();
  73. void SaveWindowSize();
  74. // Generated message map functions
  75. protected:
  76. //{{AFX_MSG(CToolTipEx)
  77. afx_msg void OnSize(UINT nType, int cx, int cy);
  78. afx_msg HITTEST_RET OnNcHitTest(CPoint point);
  79. afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
  80. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  81. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  82. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  83. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  84. afx_msg void OnNcPaint();
  85. afx_msg void OnOptions();
  86. afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
  87. //}}AFX_MSG
  88. DECLARE_MESSAGE_MAP()
  89. public:
  90. afx_msg void OnTimer(UINT_PTR nIDEvent);
  91. afx_msg void OnRememberwindowposition();
  92. afx_msg void OnSizewindowtocontent();
  93. afx_msg void OnScaleimagestofitwindow();
  94. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  95. afx_msg void OnSetFocus(CWnd* pOldWnd);
  96. afx_msg void OnPaint();
  97. afx_msg void OnFirstHidedescriptionwindowonm();
  98. afx_msg void OnFirstWraptext();
  99. };
  100. /////////////////////////////////////////////////////////////////////////////
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  103. #endif // !defined(AFX_ToolTipEx_H__5796127D_8817_493F_ACA7_8741A6759DD3__INCLUDED_)