ToolTipEx.h 3.3 KB

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