summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/Tooltip.h
blob: 9e47040bf6143329d06edfffa44aea1db8a3bab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Tooltip.h: interface for the CTooltip class.
//
//////////////////////////////////////////////////////////////////////

class CTooltipNotify;

class CTooltip
{
public:

	CTooltip(CTooltipNotify *pTooltipNotify);
	virtual ~CTooltip();

	HWND GetHandle() const { return m_hWnd; }
	void Hide();
	void Show();	
	void Validate();
	void set_Position(INT x, INT y);
	void get_Rect(RECT *Rect) const;
	void set_TransparentInput(BOOL bOnOff);
	void set_Translucency(BYTE bAlpha);
	void set_Text(const wchar_t* szText);
	void set_Font(const LOGFONT& Font) { m_lfFont = Font; }
	void set_TextColor(DWORD TextColor) { m_dwTextColor = TextColor; }
	void set_BgColor(DWORD BgColor) { m_dwBgColor = BgColor; }

	static void Initialize();
	static void Deinitialize();

private:
	// prohibit copying
	CTooltip(const CTooltip& rhs);
	CTooltip& operator= (const CTooltip& rhs);

private:
	static LRESULT CALLBACK WindowProcWrapper(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	HWND m_hWnd;
	HFONT m_hFont;

	// tooltip parameters
	DWORD m_dwTextColor;
	DWORD m_dwBgColor;
	LOGFONT m_lfFont;
	wchar_t *m_szText;
	BYTE m_bAlpha;
	BOOL m_bTranspInput;
	BYTE m_bLDblClick;
	
	CTooltipNotify *m_pTooltipNotify;	
	static const wchar_t *s_szTooltipClass;
};