ToolTipEx.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. #include "Accels.h"
  9. #include "SnapWindow.h"
  10. #include "SimpleBrowser.h"
  11. class CToolTipEx : public CWnd
  12. {
  13. // Construction
  14. public:
  15. CToolTipEx();
  16. // Attributes
  17. public:
  18. // Operations
  19. public:
  20. BOOL OnMsg(MSG* pMsg);
  21. BOOL Create(CWnd* pParentWnd);
  22. BOOL Show(CPoint point);
  23. BOOL Hide();
  24. void SetToolTipText(const CString &csText);
  25. void SetRTFText(const char *pRTF);
  26. void SetHtmlText(const CString &html);
  27. void SetGdiplusBitmap(Gdiplus::Bitmap *gdiplusBitmap);
  28. void SetNotifyWnd(CWnd *pNotify) { m_pNotifyWnd = pNotify; }
  29. void HideWindowInXMilliSeconds(long lms);
  30. CRect GetBoundsRect();
  31. void SetClipId(int clipId) { m_clipId = clipId; }
  32. int GetClipId() { return m_clipId; }
  33. void SetClipRow(int clipRow) { m_clipRow = clipRow; }
  34. int GetClipRow() { return m_clipRow; }
  35. void SetSearchText(CString text) { m_searchText = text; }
  36. void SetClipData(CString data) { m_clipData = data; }
  37. void SetFolderPath(CString path) { m_folderPath = path; }
  38. bool GetShowPersistant() { return m_showPersistant; }
  39. void ToggleShowPersistant() { OnFirstAlwaysontop(); }
  40. bool ToggleWordWrap();
  41. void SetTooltipActions(CAccels *pToolTipActions) { m_pToolTipActions = pToolTipActions; }
  42. void GetWindowRectEx(LPRECT lpRect);
  43. void UpdateMenuShortCut(CMenu *subMenu, int id, DWORD action);
  44. void DoSearch();
  45. void MoveControls();
  46. BOOL SetLogFont(LPLOGFONT lpLogFont, BOOL bRedraw /*=TRUE*/);
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(CToolTipEx)
  50. protected:
  51. virtual void PostNcDestroy();
  52. virtual BOOL PreTranslateMessage(MSG* pMsg);
  53. //}}AFX_VIRTUAL
  54. // Implementation
  55. public:
  56. virtual ~CToolTipEx();
  57. protected:
  58. DWORD m_dwTextStyle;
  59. CRect m_rectMargin;
  60. CString m_csText;
  61. CFont m_Font;
  62. int m_fontHeight;
  63. CString m_csRTF;
  64. CString m_html;
  65. CRichEditCtrlEx m_RichEdit;
  66. SimpleBrowser m_browser;
  67. CWnd *m_pNotifyWnd;
  68. CGdipButton m_optionsButton;
  69. int m_clipId;
  70. CString m_searchText;
  71. CScrollBar m_vScroll;
  72. CScrollBar m_hScroll;
  73. CDittoWindow m_DittoWindow;
  74. CImageViewer m_imageViewer;
  75. CGroupStatic m_clipDataStatic;
  76. CGroupStatic m_folderPathStatic;
  77. CString m_clipData;
  78. CFont m_clipDataFont;
  79. bool m_saveWindowLockout;
  80. int m_clipRow;
  81. bool m_showPersistant;
  82. CAccels *m_pToolTipActions;
  83. bool m_bMaxSetTimer;
  84. int m_lDelayMaxSeconds;
  85. SnapWindow m_snap;
  86. CString m_folderPath;
  87. protected:
  88. CString GetFieldFromString(CString ref, int nIndex, TCHAR ch);
  89. BOOL IsCursorInToolTip();
  90. void HighlightSearchText();
  91. void ApplyWordWrap();
  92. void SaveWindowSize();
  93. CString m_mouseDownOnLink;
  94. // Generated message map functions
  95. protected:
  96. //{{AFX_MSG(CToolTipEx)
  97. afx_msg void OnSize(UINT nType, int cx, int cy);
  98. afx_msg HITTEST_RET OnNcHitTest(CPoint point);
  99. afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
  100. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  101. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  102. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  103. afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  104. afx_msg void OnNcPaint();
  105. afx_msg void OnOptions();
  106. afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
  107. //}}AFX_MSG
  108. DECLARE_MESSAGE_MAP()
  109. public:
  110. afx_msg void OnTimer(UINT_PTR nIDEvent);
  111. afx_msg void OnRememberwindowposition();
  112. afx_msg void OnSizewindowtocontent();
  113. afx_msg void OnScaleimagestofitwindow();
  114. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  115. afx_msg void OnSetFocus(CWnd* pOldWnd);
  116. afx_msg void OnPaint();
  117. afx_msg void OnFirstHidedescriptionwindowonm();
  118. afx_msg void OnFirstWraptext();
  119. afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
  120. afx_msg void OnFirstAlwaysontop();
  121. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  122. void OnEnMsgfilterRichedit21(NMHDR *pNMHDR, LRESULT *pResult);
  123. afx_msg LRESULT OnDpiChanged(WPARAM wParam, LPARAM lParam);
  124. afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
  125. afx_msg void OnEnterSizeMove();
  126. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  127. };