⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gameview.h

📁 这是一个连连看的游戏源程序
💻 H
字号:
// GameView.h : interface of the CGameView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_GAMEVIEW_H__AF786412_25B4_494B_94DC_C2E620E52CEF__INCLUDED_)
#define AFX_GAMEVIEW_H__AF786412_25B4_494B_94DC_C2E620E52CEF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "MyGame.h"

enum {DRAW,EDIT,BACK,LINE,AUTO} ;		//绘图,编辑,背景,画线,提示
enum {GAME,TEST} ;						//游戏,测试

class CGameView : public CView
{
protected: // create from serialization only
	CGameView();
	DECLARE_DYNCREATE(CGameView)

// Attributes
public:
	CGameDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGameView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	//变量定义
	COLORREF GameColor[4] ;			//各种绘图色(绘图色,编辑色,背景色,连线色)
	CMyGame *MyGame;				//游戏类
	CBitmap GameBmp[36];			//36种图标
	BOOL TestGame;					//游戏与测试开关
	int GameMode;					//绘制方式(绘图,编辑,背景,连线)	
	//函数定义
	void DrawBackground(CDC *pDC, UINT nIDResource);//绘制图像
	void DrawGraph();								//绘图总控
	void DispProgress(CDC *pDC);					//显示时间进度
	void DispPrompt();								//显示游戏提示
	void GameLine(COLORREF color);					//绘制连线
	void DrawFrame(int Mode, int xw, int yw);		//绘制小方格
	void InitScreen(CDC *pDC);						//绘制初始化图形
	void DrawGameBlock(CDC *pDC, CMyGame *MyGame);	//绘制界面图形
	virtual ~CGameView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

private:
	void DrawGraphY(int xw);							//绘制一列图标
	void DrawGraphX(int yw);							//绘制一行图标
	void DrawData(CDC *pDC,int xw,int yw);				//绘制代码
	void DrawBlock(CDC *pDC, int Mode, int xw, int yw);	//绘制外框
	void DrawBack(CDC *pDC, int Mode, int xw, int yw);	//绘制背景
	void DrawBmp(CDC *pDC, int x, int y);				//绘制图象
	void DrawBack0(CDC *pDC, int Mode, int x, int y, int x1, int y1);
														//绘制方框
protected:
							
// Generated message map functions
protected:
	//{{AFX_MSG(CGameView)
	afx_msg void OnEasy();
	afx_msg void OnNormal();
	afx_msg void OnHard();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnPrompt();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnTest();
	afx_msg void OnGame();
	afx_msg void OnMode();
	afx_msg void OnNo();
	afx_msg void OnUpdown();
	afx_msg void OnUpdown1();
	afx_msg void OnUpdown2();
	afx_msg void OnLeft();
	afx_msg void OnLeftright();
	afx_msg void OnLeftright1();
	afx_msg void OnLeftright2();
	afx_msg void OnDown();
	afx_msg void OnPrevLayer();
	afx_msg void OnNextLayer();
	afx_msg void OnRestart();
	afx_msg void OnPause();
	afx_msg void OnQuit();
	afx_msg void OnUpdateQuit(CCmdUI* pCmdUI);
	afx_msg void OnUpdatePrompt(CCmdUI* pCmdUI);
	afx_msg void OnUpdateRestart(CCmdUI* pCmdUI);
	afx_msg void OnUpdatePause(CCmdUI* pCmdUI);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnUpdateNo(CCmdUI* pCmdUI);
	afx_msg void OnUpdateLeftright(CCmdUI* pCmdUI);
	afx_msg void OnUpdateLeftright1(CCmdUI* pCmdUI);
	afx_msg void OnUpdateLeftright2(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMode(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNextLayer(CCmdUI* pCmdUI);
	afx_msg void OnUpdatePrevLayer(CCmdUI* pCmdUI);
	afx_msg void OnUpdateTest(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUpdown(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUpdown1(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUpdown2(CCmdUI* pCmdUI);
	afx_msg void OnUpdateLeft(CCmdUI* pCmdUI);
	afx_msg void OnUpdateGame(CCmdUI* pCmdUI);
	afx_msg void OnUpdateDown(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in GameView.cpp
inline CGameDoc* CGameView::GetDocument()
   { return (CGameDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GAMEVIEW_H__AF786412_25B4_494B_94DC_C2E620E52CEF__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -