Changeset 142 for MicroThreading/Demo/UMainForm.pas
- Timestamp:
- Jan 24, 2011, 4:02:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/UMainForm.pas
r141 r142 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ExtCtrls, UMicroThreading, Coroutine, DateUtils;9 ComCtrls, ExtCtrls, Spin, UMicroThreading, Coroutine, DateUtils; 10 10 11 11 type … … 23 23 Button2: TButton; 24 24 Button3: TButton; 25 Button4: TButton; 25 26 Label1: TLabel; 26 27 Label2: TLabel; 27 28 ListView1: TListView; 28 29 Memo1: TMemo; 30 SpinEdit1: TSpinEdit; 29 31 Timer1: TTimer; 30 32 procedure Button1Click(Sender: TObject); 31 33 procedure Button2Click(Sender: TObject); 32 34 procedure Button3Click(Sender: TObject); 35 procedure Button4Click(Sender: TObject); 33 36 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 34 37 procedure FormCreate(Sender: TObject); … … 70 73 begin 71 74 Scheduler := TMicroThreadScheduler.Create; 72 Scheduler.FreeMicroThreadOnFinish := False;73 75 Test := TTest.Create; 74 76 DoubleBuffered := True; … … 84 86 Scheduler.MicroThreads.Clear; 85 87 Memo1.Clear; 86 for I := 0 to 20 do87 Scheduler.Add('Worker', Worker);88 88 Scheduler.Start; 89 89 end else begin … … 149 149 begin 150 150 Test.Invoke; 151 end; 152 153 procedure TForm1.Button4Click(Sender: TObject); 154 var 155 I: Integer; 156 begin 157 for I := 0 to SpinEdit1.Value do 158 Scheduler.AddMethod(Worker); 151 159 end; 152 160
Note:
See TracChangeset
for help on using the changeset viewer.