//给的注释已经够详尽了,我就不再写多余的分析了。
//July、2010/10月。
Dlg.h文件。
#if !defined(AFX_OPTIONDLG_H__570435A5_9237_4DE0_8215_48D075E106AD__INCLUDED_) #define AFX_OPTIONDLG_H__570435A5_9237_4DE0_8215_48D075E106AD__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // OptionDlg.h : header file // / // COptionDlg dialog class COptionDlg : public CDialog { // Construction public: int m_iBlockStyle; int m_iLevel; int m_iArea; COptionDlg(int m_iArea, int m_iLevel,int m_iBlockStyle, BOOL m_bMusic,BOOL m_bDrawGrid, CWnd* pParent = NULL); // Dialog Data //{{AFX_DATA(COptionDlg) enum { IDD = IDD_DLG_OPTION }; BOOL m_bDrawGrid; BOOL m_bMusic; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(COptionDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: int m_oldArea; int m_oldLevel; int m_oldBlockSytle; BOOL m_oldMusic; BOOL m_oldDrawGrid; // Generated message map functions //{{AFX_MSG(COptionDlg) afx_msg void OnCheckGrid(); virtual void OnOK(); virtual BOOL OnInitDialog(); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnGameOption(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_OPTIONDLG_H__570435A5_9237_4DE0_8215_48D075E106AD__INCLUDED_)
Dlg.cpp文件。
// OptionDlg.cpp : implementation file // #include "stdafx.h" #include "skyjuly_RecTT.h" #include "OptionDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif / // COptionDlg dialog COptionDlg::COptionDlg(int m_iArea, int m_iLevel, int m_iBlockStyle,BOOL m_bMusic, BOOL m_bDrawGrid, CWnd* pParent /*=NULL*/) : CDialog(COptionDlg::IDD, pParent) { //{{AFX_DATA_INIT(COptionDlg) m_bDrawGrid = FALSE; m_bMusic = FALSE; //}}AFX_DATA_INIT } void COptionDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(COptionDlg) DDX_Check(pDX, IDC_CHECK_GRID, m_bDrawGrid); DDX_Check(pDX, IDC_CHECK_MUSIC, m_bMusic); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COptionDlg, CDialog) //{{AFX_MSG_MAP(COptionDlg) ON_BN_CLICKED(IDC_CHECK_GRID, OnCheckGrid) ON_WM_CREATE() ON_COMMAND(ID_GAME_OPTION, OnGameOption) //}}AFX_MSG_MAP END_MESSAGE_MAP() / // COptionDlg message handlers void COptionDlg::OnCheckGrid() { // TODO: Add your control notification handler code here } void COptionDlg::OnOK() { // TODO: Add extra validation here CDialog::OnOK(); } BOOL COptionDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } int COptionDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here return 0; } void COptionDlg::OnGameOption() { // TODO: Add your command handler code here }
//至此,大部分源码,已经贴出,欢迎各位 就俄罗斯方块算法交流指正。
//曾经 单单玩这个游戏,便 玩了好几个月。;-)。