?? minewnd.h
字號:
/*++
Copyright (c) 2004-2005 Micro-soft
Module Name:
MineWnd.h
Abstract:
the mian Frame of the Mine-Game, we should do the most draw-work here,
surely,the size and style of the window should set here too.
Author:
Microsoft's Engineer - Unknown Name
improved by Weijian Luo (Arthur Luo) 15-Jun-2005
E-mail: skybluehacker@yahoo.com.cn
Revision History: 1.0
--*/
#if !defined(AFX_MAINWND_H__FB2594FD_B845_48A9_A9D0_FADC86BCE950__INCLUDED_)
#define AFX_MAINWND_H__FB2594FD_B845_48A9_A9D0_FADC86BCE950__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct
{
UINT uRow; //所在雷區(qū)二維數(shù)組的行
UINT uCol; //所在雷區(qū)二位數(shù)組的列
UINT uState; //當(dāng)前狀態(tài)
UINT uAttrib; //方塊屬性
UINT uOldState; //歷史狀態(tài)
} MINEWND; // 雷方塊結(jié)構(gòu)體
/////////////////////////////////////////////////////////////////////////////
class CMineWnd : public CWnd
{
public:
CMineWnd();
virtual ~CMineWnd();
void ResetRecord();
void SetCustom(UINT xNum, UINT yNum, UINT mNum);
//{{AFX_VIRTUAL(CMineWnd)
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CMineWnd)
afx_msg void OnPaint();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnMemuStart();
afx_msg void OnMemuPrimary();
afx_msg void OnMemuSecond();
afx_msg void OnMemuAdvance();
afx_msg void OnMemuCustom();
afx_msg void OnMemuMark();
afx_msg void OnMemuColor();
afx_msg void OnMemuSound();
afx_msg void OnMemuExit();
afx_msg void OnMemuHelpList();
afx_msg void OnMemuHelpFind();
afx_msg void OnMemuHelpUse();
afx_msg void OnMemuAbout();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnInitMenu(CMenu* pMenu);
afx_msg void OnMemuClose();
afx_msg void OnMemuHero();
afx_msg void OnMemuCheat();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
// init and save functions
void LoadConfig();
void SaveConfig();
void LoadWaveSrc();
void FreeWaveSrc();
void InitGame();
void LoadBitmap();
void FreeMines();
void SizeWindow();
void LayMines(UINT row, UINT col);
// draw functions
void DrawShell(CPaintDC &dc);
void DrawButton(CPaintDC &dc);
void DrawNumber(CPaintDC &dc);
void DrawMineArea(CPaintDC &dc);
void DrawDownNum(MINEWND* mine, UINT num);
void DrawSpecialMine(UINT row, UINT col);
// change menu check state funtions
void SetCheckedSound();
void SetCheckedColor();
void SetCheckedMark();
void SetCheckedLevel();
void SetCheckedCheat();
// other functions
void ExpandMines(UINT row, UINT col);
BOOL IsInMineArea(UINT row, UINT col);
BOOL IsMine(UINT row, UINT col);
UINT GetAroundNum(UINT row, UINT col);
UINT GetAroundFlags(UINT row, UINT col);
void Dead(UINT row, UINT col);
BOOL Victory();
// both button click fuctions
void OnLRBtnDown(UINT row, UINT col);
void OnLRBtnUp(UINT row, UINT col);
void OpenAround(UINT row, UINT col);
BOOL ErrorAroundFlag(UINT row, UINT col/*, UINT &errorRow, UINT &errorCol*/);
void OpenByCheat();
MINEWND* GetMine(long x, long y);
protected :
UINT m_uXNum; // X方向小方塊個數(shù)
UINT m_uYNum; // Y方向小方塊個數(shù)
UINT m_uMineNum; // 總的雷個數(shù)
int m_nLeaveNum; // 剩余的雷個數(shù)
UINT m_uSpendTime; // 游戲開始擊到目前所花費的時間
UINT m_uGameState; // 游戲狀態(tài)
UINT m_uTimer; // 定時器標(biāo)識
UINT m_uNewState; // 當(dāng)前選中的小方塊的狀態(tài)
UINT m_uLevel; // 當(dāng)前游戲等級
UINT m_uPrimary; // 初級記錄
UINT m_uSecond; // 中級記錄
UINT m_uAdvance; // 高級記錄
CString m_szPrimary; // 初級記錄保持者
CString m_szSecond; // 中級記錄保持者
CString m_szAdvance; // 高級記錄保持者
BOOL m_bLRBtnDown; // 是否為左右鍵同時按下
BOOL m_bClickBtn; // 左鍵按下的時候鼠標(biāo)是否位于按鈕區(qū)域內(nèi)
BOOL m_bMarkful; // 是否能顯示標(biāo)記
BOOL m_bColorful; // 是否彩色顯示
BOOL m_bSoundful; // 是否有聲音
CMenu* m_pSubMenu; // 子菜單
CBitmap m_bmpMine; // 雷區(qū)背景圖像
CBitmap m_bmpNumber; // 數(shù)字背景圖像
CBitmap m_bmpButton; // 笑臉按鈕背景圖像
CBrush m_brsBG; // 背景畫刷對象
COLORREF m_clrDark; // 各按鈕的深色調(diào)
RECT m_rcClient; // 客戶區(qū)域
UINT m_uBtnRect[3]; // 按鈕框區(qū)域坐標(biāo)數(shù)組
UINT m_uBtnState; // 按鈕狀態(tài)
UINT m_uNumRect[3]; // 數(shù)字框區(qū)域坐標(biāo)數(shù)組(包括時間和雷個數(shù))
UINT m_uShellRcX[2]; // 內(nèi)框以及邊界的坐標(biāo)X方向
UINT m_uShellRcY[2]; // 內(nèi)框以及邊界的坐標(biāo)Y方向
MINEWND m_pMines[100][100]; // 表示雷區(qū)內(nèi)的所有小方塊的二維數(shù)組
MINEWND* m_pNewMine; // 當(dāng)前選中的小方塊
MINEWND* m_pOldMine; // 上次選中的小方塊
void* m_pSndDead; // 失敗提示音
void* m_pSndVictory; // 勝利提示音
void* m_pSndClock; // 時鐘提示音
};
//{{AFX_INSERT_LOCATION}}
#endif // !defined(AFX_MAINWND_H__FB2594FD_B845_48A9_A9D0_FADC86BCE950__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -