| Class TSortThread (unit SortThds) |
TObject
| Constructors |
constructor Create(Box: TPaintBox; var SortArray: array of Integer);| Functions |
procedure Execute;
procedure Sort(var A: array of Integer);
procedure VisualSwap(A, B, I, J: Integer);
procedure DoVisualSwap;| Properties |
| Events |
| Variables |
FA : Integer;
FB : Integer;
FBox : TPaintBox;
FI : Integer;
FJ : Integer;
FSize : Integer;
FSortArray : PSortArray;| Constructors |
constructor Create(Box: TPaintBox; var SortArray: array of Integer);TSortThread
| Functions |
procedure Execute;The Execute method is called when the thread starts
procedure Sort(var A: array of Integer);
procedure VisualSwap(A, B, I, J: Integer);VisusalSwap is a wrapper on DoVisualSwap making it easier to use. The parameters are copied to instance variables so they are accessable by the main VCL thread when it executes DoVisualSwap
procedure DoVisualSwap;Since DoVisualSwap uses a VCL component (i.e., the TPaintBox) it should never be called directly by this thread. DoVisualSwap should be called by passing it to the Synchronize method which causes DoVisualSwap to be executed by the main VCL thread, avoiding multi-thread conflicts. See VisualSwap for an example of calling Synchronize.
| Properties |
| Events |
| Variables |
FA : Integer;
FB : Integer;
FBox : TPaintBox;
FI : Integer;
FJ : Integer;
FSize : Integer;
FSortArray : PSortArray;