ToolTipEx.h 3.0 KB

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