aboutsummaryrefslogtreecommitdiff
path: root/Src/external_dependencies/openmpt-trunk/mptrack/UpdateToolTip.h
blob: d464c9b03e128c2a255cf1753fd129be257bb068 (plain) (blame)
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
/*
 * UpdateToolTip.h
 * ---------------
 * Purpose: Implementation of the update tooltip in the main toolbar.
 * Notes  : (currently none)
 * Authors: OpenMPT Devs
 * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
 */


#pragma once

#include "openmpt/all/BuildSettings.hpp"

OPENMPT_NAMESPACE_BEGIN

class UpdateToolTip : public CToolTipCtrl
{
public:
	enum class PopAction
	{
		Undetermined,
		CloseButton,
		ClickLink,
		ClickBubble,
	};
protected:
	CString m_infoURL;
	PopAction m_popAction = PopAction::Undetermined;

public:
	bool ShowUpdate(CWnd &parent, const CString &newVersion, const CString &infoURL, const CRect rectClient, const CPoint ptScreen, const int buttonID);

protected:
	void SetResult(PopAction action);

	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnPop(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnShow(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLinkClick(NMHDR *pNMHDR, LRESULT *pResult);
	DECLARE_MESSAGE_MAP()
};

OPENMPT_NAMESPACE_END