summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/Tooltip.h
blob: ed79eefcd0e8c5a41f65db83c6ff17fe2c914f62 (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 TCHAR* 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(HMODULE hInstance);
	static void Deinitialize(HMODULE hInstance);

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;
	TCHAR *m_szText;
	BYTE m_bAlpha;
	BOOL m_bTranspInput;
	BYTE m_bLDblClick;
	
	CTooltipNotify *m_pTooltipNotify;	
	static const TCHAR *s_szTooltipClass;
};