-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInfoPanel.h
executable file
·57 lines (50 loc) · 1.71 KB
/
InfoPanel.h
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
54
55
56
57
#pragma once
#include "afxwin.h"
#include ".\prettybutton.h"
namespace Gdiplus { class Graphics; }
#define INFOCOMMAND_BUTTON1 (NM_FIRST-2)
#define INFOCOMMAND_BUTTON2 (NM_FIRST-3)
class CInfoPanel :
public CWnd
{
public:
CInfoPanel(void);
~CInfoPanel(void);
/////////////////////////////////////////////////////////////////////////////
// Message handlers
protected:
DECLARE_MESSAGE_MAP()
afx_msg void OnPaint();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnDestroy();
afx_msg void OnButton1Clicked();
afx_msg void OnButton2Clicked();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
/////////////////////////////////////////////////////////////////////////////
// Private methods
private:
void DoPaint(Gdiplus::Graphics* g);
void ShowModal(CWnd* parent);
static bool RegisterRuntimeClass();
/////////////////////////////////////////////////////////////////////////////
// Private members
private:
CStatic staticIcon;
CString title;
CString text;
bool immuneMouseDown;
bool volatileMode;
CPrettyButton button;
/////////////////////////////////////////////////////////////////////////////
// Public methods
public:
enum DirectionMode { Top, Bottom };
virtual BOOL Create(CWnd* pParentWnd, UINT nID=0);
void Show(const CPoint& position,DirectionMode positionMode=DirectionMode::Bottom, bool volatileMode=true);
void Hide();
void SetText(const CString& title, const CString& text);
void SetButtonText(const CString& button1Text, const CString& button2Text);
};