?? gameview.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 + -