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

📄 sortandlifeview.h

📁 Conway s Game of life 算法程序
💻 H
字号:
// SortAndLifeView.h : interface of the CSortAndLifeView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SORTANDLIFEVIEW_H__B7D3D858_A24A_4E4E_8AC3_337CDCEF3846__INCLUDED_)
#define AFX_SORTANDLIFEVIEW_H__B7D3D858_A24A_4E4E_8AC3_337CDCEF3846__INCLUDED_

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

enum DocType {DOCTYPE_LIFE,DOCTYPE_BUBBLESORT,DOCTYPE_QUICKSORT};

class CSortAndLifeView : public CView
{
protected: // create from serialization only
	CSortAndLifeView();
	DECLARE_DYNCREATE(CSortAndLifeView)
	virtual void OnInitialUpdate();

// Attributes
public:
	CSortAndLifeDoc* GetDocument();
	HANDLE			 hThread;
	int				 m_nTimer;
	CDirectXDraw	 m_directXObj;
	BOOL			 m_bDDrawActive;
	BOOL			 m_bInitial;
	int				 m_bDocumentType ; 
	int				 m_nSleep;
	BOOL			 m_bTermination;
	BOOL			 m_bStart;
	CPoint		     m_prePoint;
// Operations
public:

	void	OnBubbleSort(); 
	void	CreatSortThread();
	static unsigned int __stdcall thread_proc(void* pv);
	void	OnQuickSort() ;
	void	QuickSort(int *vec, int loBound, int hiBound) ;
	void    OnLifeGame() ;
	void    StepGeneration();
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSortAndLifeView)
	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:
	virtual ~CSortAndLifeView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CDC		dcMemory;
	HBITMAP hbmp;
	CRect	rectView;
    CRect	m_rcMemDC;
// Generated message map functions
protected:
	//{{AFX_MSG(CSortAndLifeView)
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd *pWnd,UINT nHitTest,UINT message);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnClear();
	afx_msg void OnGrid();
	afx_msg void OnSeedInit(); 
	afx_msg void OnStart(); 
	afx_msg void OnStop(); 
	afx_msg void OnSpeedUp();
	afx_msg void OnSlowDown();
	afx_msg void OnSetColor();
	afx_msg void OnCancelMode();
	afx_msg void OnPaint();
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy) ;
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg LRESULT OnDisplayChange(WPARAM wParam, LPARAM lParam);
	afx_msg BOOL OnEraseBkgnd(CDC *pDC);
	afx_msg void OnUpdateCommand(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in SortAndLifeView.cpp
inline CSortAndLifeDoc* CSortAndLifeView::GetDocument()
   { return (CSortAndLifeDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_SORTANDLIFEVIEW_H__B7D3D858_A24A_4E4E_8AC3_337CDCEF3846__INCLUDED_)

⌨️ 快捷键说明

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