📄 testview.h
字号:
// testView.h : CtestView 类的接口
//
#pragma once
class CtestView : public CView
{
protected: // 仅从序列化创建
CtestView();
DECLARE_DYNCREATE(CtestView)
// 属性
public:
CtestDoc* GetDocument() const;
int ss;
// 操作
public:
CRect clien;
CPen gray;
int map[22][35]; // 主盘的记录
int tod[4][2]; // 记录要画的方块的 坐标 对应于 主盘上的 i,j
int next[4][2];
int lentd; // 数组 tod的长度
bool first;
bool start;
bool circle;
bool end; // 结束的bool 变量
int shp; // 方快的形状
int loop; // 同一形状的方快的 第几个模式 在方块变换时发挥作用
int colour; // 颜色
int nshp;
int nloop;
int lentdn;
int ncolour;
int score;
public:
void mydraw(); // 画图的主要函数
void reflash(int mode); // 画空格 (画完方块后要画一个空的)
void drawone(int i,int j,int colour,CDC *pDC);
void result(); // 计算积分的函数 还未添加
void shownext(CDC *pDC);
void showscore(CDC *pDC);
bool m_nbegin;
int m_nSpeed;
int m_nBGM;
// 重写
public:
virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
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);
// 实现
public:
virtual ~CtestView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
public:
int gcd(int a,int b);
// 生成的消息映射函数
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnTimer(UINT_PTR nIDEvent);
public:
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
public:
virtual void OnInitialUpdate();
public:
afx_msg void OnStart();
public:
afx_msg void OnStop();
public:
afx_msg void OnRestart();
public:
afx_msg void OnPause();
public:
afx_msg void OnSet();
};
#ifndef _DEBUG // testView.cpp 中的调试版本
inline CtestDoc* CtestView::GetDocument() const
{ return reinterpret_cast<CtestDoc*>(m_pDocument); }
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -