-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMineSweeperDlg.h
More file actions
55 lines (49 loc) · 1.28 KB
/
MineSweeperDlg.h
File metadata and controls
55 lines (49 loc) · 1.28 KB
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
#pragma once
#include <memory>
#include "Mine.h"
#include <map>
class CMineSweeperDlg : public CDialogEx
{
template<class T>
using shared_ptr = std::shared_ptr<T>;
template<class T>
using unique_ptr = std::unique_ptr<T>;
using PicMap = std::map<Mine::BlockState,shared_ptr<CBitmap>>;
// 构造
public:
CMineSweeperDlg(CWnd* pParent = nullptr); // 标准构造函数
~CMineSweeperDlg();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MINESWEEPER_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
private:
void UpdateThread();
void AutoChangeControlSize();
unique_ptr<Mine> m_Mine;
public:
afx_msg void OnSettingCustom();
afx_msg void OnSettingEasy();
afx_msg void OnSettingHard();
afx_msg void OnSettingMid();
private:
CButton m_MainButton;
PicMap m_PicMap;
BOOL PreTranslateMessage(MSG* pMsg);
void SetPicMap();
public:
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
};