sortwnd.h

来自「包含八种排序算法的界面演示多线程程序,以线段形式表示数据大小,排序一清二楚」· C头文件 代码 · 共 105 行

H
105
字号
#if !defined(AFX_SORTWND_H__6FB6DA06_215B_4BB4_8412_A99A0BB28627__INCLUDED_)
#define AFX_SORTWND_H__6FB6DA06_215B_4BB4_8412_A99A0BB28627__INCLUDED_
#define IDB_START 100
#define IDB_PAUSE 200
#define IDB_ASC 300
#define IDB_DSC 400
#define IDB_RAND 500
#define IDB_SETTING 600
#define IDB_BIGGER 700
#define IDB_SMALLER 800
#include "bubblesort.h"
#include "selectionsort.h"
#include "quicksort.h"
#include "insertsort.h"
#include "shellsort.h"
#include "mergesort.h"
#include "heapsort.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SortWnd.h : header file
//
#include "settingdlg.h"
/////////////////////////////////////////////////////////////////////////////
// SortWnd frame

class SortWnd : public CFrameWnd
{
	DECLARE_DYNCREATE(SortWnd)
public:
	SortWnd();           // protected constructor used by dynamic creation

// Attributes
public:

// Operations
public:
	void DeleteThread();
	void DrawFull();
	void Draw();
	void RandData();
	int SleepTime;
	void EnableButtons(BOOL b);
	void SetButtonPos();
	void SetRect(RECT * r,int count);
	void Set();
	CButton* StartButton;
	CButton * PauseButton;
	CButton * ASCButton;
	CButton * DSCButton;
	CButton * RandButton;
	CButton * SettingButton;
	CButton * BiggerButton;
	CButton * SmallerButton;
	CSettingDlg * dlg;
	RECT DeskRect;
	CSort  * sort[MAX];
	DWORD ThreadId[MAX];
	HANDLE ThreadHandle[MAX];
	int Num_Sort;
	BOOL IsStarted;
	BOOL IsPaused;
	int Num_Data;
	int BaseData;
	int DataWidth;
	int HZ;
	int Per_SC;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(SortWnd)
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~SortWnd();
	afx_msg void OnStartButton();
	afx_msg void OnPauseButton();
	afx_msg void OnASCButton();
	afx_msg void OnDSCButton();
	afx_msg void OnRandButton();
	afx_msg void OnSettingButton();
	afx_msg void OnBiggerButton();
	afx_msg void OnSmallerButton();
	// Generated message map functions
	//{{AFX_MSG(SortWnd)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnClose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	DWORD LastTime;
	DWORD UsedTime;
};

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

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

#endif // !defined(AFX_SORTWND_H__6FB6DA06_215B_4BB4_8412_A99A0BB28627__INCLUDED_)

⌨️ 快捷键说明

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