?? minedlg.h
字號(hào):
// MineDlg.h : header file
//
#if !defined(AFX_MINEDLG_H__FC953A4E_A83A_47EF_960E_8E61B7117341__INCLUDED_)
#define AFX_MINEDLG_H__FC953A4E_A83A_47EF_960E_8E61B7117341__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "LED.h" //必須包含了LED類(lèi)的頭函數(shù),以下才能識(shí)別CLED m_MineCounter
/////////////////////////////////////////////////////////////////////////////
// CMineDlg dialog
#define MINE 111 //雷
#define EMPTY 100 //空格
#define UNOPENED 10 //未揭示
#define OPENED 11 //已揭示
#define WRONG 111 //出錯(cuò)
#define FLAG 112 //紅旗標(biāo)志
#define QUESTION 113 //問(wèn)號(hào)標(biāo)志
////////////////////////////////////////////////////////////////
#define BARHEIGHT 30 //固定的顯示欄高度
#define DEFAULT_WIDTH 9 //默認(rèn)寬度
#define DEFAULT_HEIGHT 9 //默認(rèn)高度
#define DEFAULT_MINENUM 10 //默認(rèn)雷數(shù)
#define BUTTONWIDE 24 //主控件寬
#define BUTTONHEIGHT 24 //主控件高
/*class STATE
{
public:
BOOL IsMine;//是否為雷
BOOL IsNull;//是否為空
int Number;//數(shù)字(周?chē)讛?shù))
BOOL IsOpened;//是否揭示
BOOL IsWrong;//是否出錯(cuò)
BOOL IsQuestion;//是否為問(wèn)號(hào)
BOOL IsFlag;//是否為紅旗
//構(gòu)造函數(shù)
STATE()
{
IsMine = FALSE;
IsNull = FALSE;
Number = 0;
IsOpened = FALSE;
IsWrong = FALSE;
IsQuestion = FALSE;
IsFlag = FALSE;
}
};*/
////////////////////////////////////////////////////////////////////////
class CMineDlg : public CDialog
{
// Construction
public:
BOOL AutoFinish();
void PaintControlBar();
void InitControlBar();
void ChainReaction(int,int);
void SetMine();
void PaintClient();
void InitWindow();
void InitVariables();
CMineDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMineDlg)
enum { IDD = IDD_MINE_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMineDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMineDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnAbout();
afx_msg void OnFileLow();
afx_msg void OnFileMid();
afx_msg void OnFileHigh();
afx_msg void OnFileExit();
afx_msg void OnClose();
afx_msg void OnFileBegin();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
int m_ClientWidth; //客戶(hù)區(qū)寬度
int m_ClientHeight; //客戶(hù)區(qū)高度
int m_BarHeight; //顯示區(qū)高度
int m_iFrameWidth; //非客戶(hù)區(qū)寬度
int m_iFrameHeight; //非客戶(hù)區(qū)高度
CRect m_MineRect; //雷區(qū)
int m_WideNum; //行數(shù)
int m_HighNum; //列數(shù)
int m_MineNum; //雷數(shù)
int m_MineLeft; //剩余雷數(shù)
CArray<int,int> m_SetState; //設(shè)置狀態(tài)
CArray<int,int> m_OpenState; //揭示狀態(tài)
BOOL IsGameFinished;//游戲結(jié)束標(biāo)志
BOOL m_FirstBlick;
CBitmapButton* m_MainButton; //主控件指針
CLED* m_MineCounter;
CLED* m_Timer;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MINEDLG_H__FC953A4E_A83A_47EF_960E_8E61B7117341__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -