📄 linecolorview.h
字号:
// LineColorView.h : interface of the CLineColorView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_LINECOLORVIEW_H__FEDD394D_6FD0_11D6_9B6C_BFA0FD215847__INCLUDED_)
#define AFX_LINECOLORVIEW_H__FEDD394D_6FD0_11D6_9B6C_BFA0FD215847__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "CBall.h"
#include "DlgRecorder.h"
#include "DlgInput.h"
#include "uMyStruct.h"
#include "MyGdiObject.h"
class CLineColorView : public CView
{
protected: // create from serialization only
CLineColorView();
DECLARE_DYNCREATE(CLineColorView)
// Attributes
public:
CLineColorDoc* GetDocument();
CCBall m_ball;
CBitmap m_bmpSrc;
CBitmap m_bmpTop;
CBitmap m_bmpGrid;
CBitmap m_bmpLeft;
CBitmap m_bmpRight;
CDC m_virDCSrc;
CDC m_virDCTop;
CDC m_virDCGrid;
CDC m_virDCLeft;
CDC m_virDCRight;
CRect m_rectWindow;
CRect m_rectGrid;
CRect m_rectTop;
CRect m_rectHigher;
CRect m_rectPlayer;
CRect m_rectLeft;
CRect m_rectRight;
int m_nSrcWidth;
int m_nSrcHeight;
int m_nSorce;
CString m_strPlayer;
CString m_strHigher;
int m_nClearX[MAX_GRIDX][MAX_GRIDY];//要清掉的球的数据,
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLineColorView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
// Implementation
public:
BOOL CreateMemDC();
virtual ~CLineColorView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CLineColorView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnFileNew();
afx_msg void OnDestroy();
afx_msg void OnFileHistroy();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
afx_msg void OnMessageJumpBall(WPARAM wparam, LPARAM lparam);
DECLARE_MESSAGE_MAP()
private:
void DrawGrid();
void InitSrc();
void InitData();
void InitPage();
void DrawFirst();
bool GrowBall(int nNum);
void DrawPreBall();
void DrawOneBall(int x, int y, int color);
void DrawTopInfo();
int GetGridPos(int x, int y);
void SetActiveBall(int x, int y);
void SwapActiveBall(int x, int y, int old_x, int old_y);
void ClearBall(int nX, int nY);
void MoveBall(int x, int y, int old_x, int old_y);
void UpdateSorce();
void UpdatePage();
CRect GetCellRect(int x, int y);
void DrawLeftInfo();
void DrawRightInfo();
int m_nWidth;
int m_nHeight;
CBrush m_Brush; //Brush
CPen m_Pen; //Pen
CDlgRecorder m_dlgRecorder;
RECORDER_INFO m_Recorder[10];
CDlgInput m_dlgInput;
void WriteFile();
void ReadFile();
void GameOver();
CMyGdiObject m_gdi;
//图标
void InitIcon();
HICON GetIcon(int nType);
HICON m_iconLevel1;
HICON m_iconLevel2;
HICON m_iconLevel3;
HICON m_iconRed;
HICON m_iconGreen;
HICON m_iconDarkBlue;
HICON m_iconBrown;
HICON m_iconBrightBlue;
HICON m_iconPink;
HICON m_iconYellow;
};
#ifndef _DEBUG // debug version in LineColorView.cpp
inline CLineColorDoc* CLineColorView::GetDocument()
{ return (CLineColorDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LINECOLORVIEW_H__FEDD394D_6FD0_11D6_9B6C_BFA0FD215847__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -