ToolTipEx.h 3.6 KB

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