thsort.h
上传用户:lulishicai
上传日期:2010-03-01
资源大小:13202k
文件大小:2k
源码类别:

Delphi/CppBuilder

开发平台:

C++ Builder

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1998-2002 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //----------------------------------------------------------------------------
  6. #ifndef ThSortH
  7. #define ThSortH
  8. //----------------------------------------------------------------------------
  9. #include <StdCtrls.hpp>
  10. #include <ExtCtrls.hpp>
  11. #include <Dialogs.hpp>
  12. #include <Forms.hpp>
  13. #include <Controls.hpp>
  14. #include <Graphics.hpp>
  15. #include <Classes.hpp>
  16. #include <SysUtils.hpp>
  17. #include <Messages.hpp>
  18. #include <Windows.hpp>
  19. #include <System.hpp>
  20. //----------------------------------------------------------------------------
  21. class TThreadSortForm : public TForm
  22. {
  23. __published:
  24. TButton *StartBtn;
  25. TPaintBox *BubbleSortBox;
  26. TPaintBox *SelectionSortBox;
  27. TPaintBox *QuickSortBox;
  28. TLabel *Label1;
  29. TBevel *Bevel1;
  30. TBevel *Bevel2;
  31. TBevel *Bevel3;
  32. TLabel *Label2;
  33. TLabel *Label3;
  34. void __fastcall BubbleSortBoxPaint(TObject *Sender);
  35. void __fastcall SelectionSortBoxPaint(TObject *Sender);
  36. void __fastcall QuickSortBoxPaint(TObject *Sender);
  37. void __fastcall FormCreate(TObject *Sender);
  38. void __fastcall StartBtnClick(TObject *Sender);
  39. private: 
  40. int ThreadsRunning;
  41. void __fastcall RandomizeArrays(void);
  42. void __fastcall ThreadDone(TObject *Sender);
  43. public:
  44. void __fastcall PaintArray(TPaintBox *Box, const int *A, const int A_Size);
  45.     virtual __fastcall TThreadSortForm(TComponent *Owner);
  46. };
  47. //----------------------------------------------------------------------------
  48. typedef int TSortArray[115];
  49. typedef TSortArray *PSortArray;
  50. //----------------------------------------------------------------------------
  51. extern TThreadSortForm *ThreadSortForm;
  52. extern bool ArraysRandom;
  53. extern int BubbleSortArray[115];
  54. extern int SelectionSortArray[115];
  55. extern int QuickSortArray[115];
  56. //----------------------------------------------------------------------------
  57. #endif