unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, JvComponentBase, JvMTComponents, StdCtrls, JvProgressBar,
JvXPProgressBar;
type
TForm1 =
class(TForm)
Button1: TButton;
JvMTManager1: TJvMTManager;
JvMTThread1: TJvMTThread;
Label1: TLabel;
JvXPProgressBar1: TJvXPProgressBar;
JvXPProgressBar2: TJvXPProgressBar;
Button2: TButton;
JvMTThread2: TJvMTThread;
Label2: TLabel;
procedure JvMTThread1Execute(Sender: TJvMTThread;
MTThread: TJvMTSingleThread);
procedure Button2Click(Sender: TObject);
procedure JvMTThread2Execute(Sender: TJvMTThread;
MTThread: TJvMTSingleThread);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.JvMTManager1.WaitThreads;
Form1.JvMTThread1.RunCopy;
Form1.JvMTThread2.RunCopy;
end;
procedure TForm1.JvMTThread2Execute(Sender: TJvMTThread;
MTThread: TJvMTSingleThread);
var x,i:Integer;
begin
Label2.Caption:='
Hallo';
Form1.JvXPProgressBar2.Max:=1000000;
x:=1;
for i:=0
to 1000000
do
begin
Form1.JvXPProgressBar2.Position:=i;
x:=x*3+1;
x:=x
div 2+1;
end;
Label2.Caption:='
Fertig';
end;
procedure TForm1.Button2Click(Sender: TObject);
var x,i:Integer;
begin
Label1.Caption:='
Hallo';
Form1.JvXPProgressBar1.Max:=1000000;
x:=1;
for i:=0
to 1000000
do
begin
Form1.JvXPProgressBar1.Position:=i;
x:=x*3+1;
x:=x
div 2+1;
end;
Label1.Caption:='
Fertig';
Label2.Caption:='
Hallo';
Form1.JvXPProgressBar2.Max:=1000000;
x:=1;
for i:=0
to 1000000
do
begin
Form1.JvXPProgressBar2.Position:=i;
x:=x*3+1;
x:=x
div 2+1;
end;
Label2.Caption:='
Fertig';
end;
procedure TForm1.JvMTThread1Execute(Sender: TJvMTThread;
MTThread: TJvMTSingleThread);
var x,i:Integer;
begin
Label1.Caption:='
Hallo';
Form1.JvXPProgressBar1.Max:=1000000;
x:=1;
for i:=0
to 1000000
do
begin
Form1.JvXPProgressBar1.Position:=i;
x:=x*3+1;
x:=x
div 2+1;
end;
Label1.Caption:='
Fertig';
end;
end.