00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CTRLCOOLTIP_H__9F287EE6_069E_4FBB_8657_533279376816__INCLUDED_)
00023 #define AFX_CTRLCOOLTIP_H__9F287EE6_069E_4FBB_8657_533279376816__INCLUDED_
00024
00025 #pragma once
00026
00027 class CLineGraph;
00028
00029
00030 class CCoolTipCtrl : public CWnd
00031 {
00032
00033 public:
00034 CCoolTipCtrl();
00035 virtual ~CCoolTipCtrl();
00036
00037 DECLARE_DYNAMIC(CCoolTipCtrl)
00038
00039
00040 protected:
00041 BOOL* m_pbEnable;
00042 LPVOID m_pContext;
00043 HWND m_hAltWnd;
00044 BOOL m_bTimer;
00045 BOOL m_bVisible;
00046 CPoint m_pOpen;
00047 DWORD m_tOpen;
00048 CSize m_sz;
00049 protected:
00050 static LPCTSTR m_hClass;
00051
00052
00053 public:
00054 virtual void Show(LPVOID pContext, HWND hAltWnd = NULL);
00055 virtual void Hide();
00056 protected:
00057 virtual void ShowImpl();
00058 void CalcSizeHelper();
00059 void AddSize(CDC* pDC, LPCTSTR pszText, int nBase = 0);
00060 void GetPaintRect(RECT* pRect);
00061 void DrawText(CDC* pDC, POINT* pPoint, LPCTSTR pszText, int nBase = 0);
00062 void DrawRule(CDC* pDC, POINT* pPoint, BOOL bPos = FALSE);
00063 BOOL WindowFromPointBelongsToOwner(const CPoint& point);
00064 protected:
00065 CLineGraph* CreateLineGraph();
00066 protected:
00067 virtual BOOL OnPrepare();
00068 virtual void OnCalcSize(CDC* pDC);
00069 virtual void OnShow();
00070 virtual void OnHide();
00071 virtual void OnPaint(CDC* pDC);
00072
00073
00074 public:
00075
00076 virtual BOOL Create(CWnd* pParentWnd, BOOL* pbEnable = NULL);
00077
00078
00079
00080 protected:
00081
00082 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00083 afx_msg void OnDestroy();
00084 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00085 afx_msg void OnPaint();
00086 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00087 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00088 afx_msg void OnTimer(UINT nIDEvent);
00089
00090
00091 DECLARE_MESSAGE_MAP()
00092
00093 };
00094
00095
00096
00097 #ifndef WS_EX_LAYERED
00098 #define WS_EX_LAYERED 0x80000
00099 #define LWA_ALPHA 0x02
00100 #endif
00101
00102 #define TIP_TEXTHEIGHT 14
00103 #define TIP_RULE 11
00104 #define TIP_GAP 5
00105
00106 #endif // !defined(AFX_CTRLCOOLTIP_H__9F287EE6_069E_4FBB_8657_533279376816__INCLUDED_)