?? unit4.pas
字號:
unit Unit4;
interface
uses
Classes, SysUtils, Graphics, Dialogs;
type
Tstop = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
end;
implementation
uses main, Unit1, Unit2;
{ Tstop }
procedure Tstop.Execute;
var
fl, ff: boolean;
begin
fl := false;
ff := false;
while not terminated do
begin
{卡車停車限制}
if Form1.shape1.Brush.Color = clRed then
if ((Form1.Image3.Top >= 110) and (Form1.Image3.Top <= 180)) then
begin
thread.Free;
thread := Tthread1.Create(true);
fl := true;
end;
if (Form1.shape1.Brush.Color = clLime) and (fl = true) then
begin
thread.Resume;
fl := false;
end;
{小車停車限制}
if Form1.Shape2.Brush.Color = clRed then
if ((Form1.image2.Left > 307) and (Form1.image2.Left <= 355)) then
begin
thread2.Free;
thread2 := Tthread2.Create(true);
ff := true;
end;
if (Form1.Shape2.Brush.Color = clLime) and (ff = true) then
begin
thread2.Resume;
ff := false;
end;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -