unit models3; interface uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type {the following lists all components and procedures for components of the form for the program} TForm1 = class(TForm) Panel1: TPanel; Button1: TButton; PaintBox1: TPaintBox; Button3: TButton; Panel2: TPanel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; RadioButton5: TRadioButton; RadioButton6: TRadioButton; RadioButton7: TRadioButton; RadioButton8: TRadioButton; RadioButton9: TRadioButton; Label1: TLabel; Label2: TLabel; RadioButton10: TRadioButton; Panel3: TPanel; RadioButton11: TRadioButton; RadioButton12: TRadioButton; GroupBox1: TGroupBox; RadioButton13: TRadioButton; procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Repressor(Sender: TObject); procedure Notch(Sender: TObject); procedure Dll(Sender: TObject); procedure MarginRepressor(Sender: TObject); procedure En(Sender: TObject); procedure Hh(Sender: TObject); procedure Ci(Sender: TObject); procedure Ptc(Sender: TObject); procedure Ecr(Sender: TObject); procedure Hhdiff(Sender: TObject); procedure model1(Sender: TObject); procedure model2(Sender: TObject); procedure model3(Sender: TObject); public { Public declarations } end; var Form1: TForm1; RepressorClick: Boolean; {these are variables that the program can call up based on what radiobuttons have been sellected} NotchClick: Boolean; DllClick: Boolean; MarginRepressorClick: Boolean; EnClick: Boolean; HhClick: Boolean; CiClick: Boolean; PtcClick: Boolean; EcrClick: Boolean; HhdiffClick: Boolean; Model1click: Boolean; Model2click: Boolean; Model3click: Boolean; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); type holdarray = array[0..40,0..40,0..10] of single; {array type to hold values for re--plotting} var {these are variables to be called up only when the run button has been clicked} iter, x, y, z : integer; t1, t2, t3, t4 : integer; {thresholds for color plotting} minx, maxx, miny, maxy : integer; holdC : single; C, newC : holdarray; Patchdump: boolean; begin minx :=2; {matrix and plotting boundaries} miny := 2; maxx := 36; maxy := 18; t1 := 2; {color thresholds for plotting} t2 := 85; t3 := 200; Patchdump := false; {patched is initially not decreasing (not being affected by diffusing hh)} for x := minx-1 to maxx+1 do {Set matrix to zero} for y := miny-1 to maxy+1 do {This is necessary or all hell breaks loose at boundaries} for z := 0 to 10 do begin {Pascal does not appear to set all elements to zero on declaration} c[x,y,z] := 0; end; for iter := 1 to 30 do {this is how many times the program runs through the calculations built into the program} begin {iteration loop} for y := 2 to 18 do begin c[2,y,0] := 2; {c[19,y,0] := 2;} {this sets the values of the vein repressor being emitted by the wing veins on the left and right side of the display} c[36,y,0] := 2; if (c[2,y,1] > 0) then {this sets the upregulation of the vein repressor by the margin repressor for the left side of the display} begin c[2,y, 0] := 50; end; if (c[36,y,1] > 0) then {this sets the upregulation of the vein repressor by the margin repressor for the right side of the display} begin c[36,y, 0] := 50; end; if (c[19,18,1] > 0) then {this sets the upregulation of the vein repressor by the margin repressor for the right side of the display} begin c[19,18,0] := 50; end; for x := 2 to 36 do begin c[x,2,0] :=3; {this sets the value of the vein repressor being emitted by the top of the display} c[x,18,1] :=10; {this sets the value of the margin repressor being emitted by the bottom of the display} end; end; if (model3click = true) then {this begins program when Model 2 is sellected} begin for x := minx to maxx do {Diffusion Loop, controls gradient diffusion of both repressors, wing vein and margin, as well as the diffusion of hh} for y := miny to maxy do begin holdC := ((c[x-1,y,0]+c[x+1,y,0]+c[x,y-1,0]+c[x,y+1,0]) - 4*c[x,y,0] )*0.25; newC[x,y,0] := c[x,y,0] + holdC; holdC := ((c[x-1,y,1]+c[x+1,y,1]+c[x,y-1,1]+c[x,y+1,1]) - 4*c[x,y,1] )*0.25; newC[x,y,1] := c[x,y,1] + holdC; holdC := ((c[x-1,y,5]+c[x+1,y,5]+c[x,y-1,5]+c[x,y+1,5]) - 4*c[x,y,5] )*0.25; newC[x,y,5] := c[x,y,5] + holdC; {the presence of the wing vein repressor down regulates the production of Notch} if (c[x,y,0]>1) then c[x,y,2] := c[x,y,2] - 40 else (if(c[x,y,0]<1) then c[x,y,2] := c[x,y,2] + 10); {the presence of Notch up regulates the production of Distal-less while the presence of the wing vein repressor down regulates the production of Dll} if (c[x,y,0]>1) then c[x,y,3] := c[x,y,3] - 40 else (if (c[x,y,2]>50) then c[x,y,3] := c[x,y,3] +10); {the presence of the wing margin repressor down regulates the production of Engrailed, the presence of Dll up regulates the production of En while the presence of activating Ci further up regulates the production of En} if (c[x,y,1]>1) then c[x,y,4] := c[x,y,4] + 0 else (if (c[x,y,3]>150) then (if ((c[x,y,5]>c[x,y,7]) and (c[x,y,6]>1)) then c[x,y,4] := c[x,y,4] +40 else c[x,y,4] := c[x,y,4] + 10)); {the presence of En up regulates the production of hedge-hog as long as Notch is in low concentrations} if (c[x,y,0]>3) then c[x,y,9] := c[x,y,9] + (c[x,y,4]); {the absence or near absence of Notch inhibits the formation of Patched} if (c[x,y,2]<5) then c[x,y,7] := 0; if (c[x,y,5]>1) then {in cells recieving hh, this simulates the removal of Ptc} begin c[x,y,7] := c[x,y,7] - 100; Patchdump :=true; {this sets up the removal of Ptc as a variable by which cubitus interruptus is up regulated} end; {cells producing hh do not express Ci, while only cells expressing moderate to high levels of Notch and an absence of the wing margin repressor have an up regulation of Ci} if (((c[x,y,9]=0) and (c[x,y,2]>50) and (c[x,y,1]<1))and Patchdump = true) then c[x,y,6] := c[x,y,6] + 10; {in cells with moderate to high levels of Notch, Ci up regulates the produciton of Ptc} if (c[x,y,2]>50) then c[x,y,7] := c[x,y,6] + c[x,y,7]; newc[x,y,5] := newc[x,y,5] + c[x,y,9]; {this allows for the proper diffusion of hh} {in cells with moderate to high levels of Notch, En up regulates the production of Ecdysone receptor (Ecr)} if (c[x,y,2]>50) then c[x,y,8] := c[x,y,8] + c[x,y,4]; end; {Diffusion Loop} for x:= minx to maxx do {boundaries for diffusion gradients} begin c[x,miny,0]:=c[x,miny-1,0]; c[x,maxy,0]:=c[x,maxy+1,0]; c[x,miny,1]:=c[x,miny-1,1]; c[x,maxy,1]:=c[x,maxy+1,1]; c[x,miny,5]:=c[x,miny-1,5]; c[x,maxy,5]:=c[x,maxy+1,5]; end; for y:= miny to maxy do {boundaries for diffusion gradients} begin c[minx,y,0]:=c[minx-1,y,0]; c[maxx,y,0]:=c[maXX+1,y,0]; c[minx,y,1]:=c[minx-1,y,1]; c[maxx,y,1]:=c[maXX+1,y,1]; c[minx,y,5]:=c[minx-1,y,5]; c[maxx,y,5]:=c[maXX+1,y,5]; end; {the next statement turns on the display only if a radiobutton is selected} if (repressorclick = true) or (NotchClick = true) or (DllClick = true) or (MarginRepressorClick = True) or (Enclick = True) or (HhClick = True) or (CiClick = True) or (PtcClick = True) or (EcrClick = True) or (Hhdiffclick = True) then begin {Z scores: 0= Wing vein repressor 1= Wing margin repressor 2= Notch 3= Distal-less 4= Engrailed 5= Diffusing hh 6= Cubitus interruptus 7= Patched 8= Ecdysone receptor 9= Production of hh} {the following sets the Z score, dependant on the radiobutton selected, to display only those values in the display} if repressorclick = true then z :=0; if marginrepressorclick = true then z :=1; if NotchClick = true then z :=2; if DllClick = true then z := 3; if Enclick = True then z := 4; if HhClick = True then z := 9; if CiClick = True then z :=6; if PtcClick = True then z :=7; if EcrClick = True then z :=8; if Hhdiffclick = True then z :=5; for x := minx to maxx do {matrix swap and plot} for y := miny to maxy do begin c[x,y,0] := newC[x,y,0]; {these allow for the program to calculate the diffusion of the repressors (0 and 1) and hh(5)} newC[x,y,0] := 0; c[x,y,1] := newC[x,y,1]; newC[x,y,1] := 0; c[x,y,5] := newC[x,y,5]; newC[x,y,5] := 0; Patchdump :=false; {the following sets concentrations to a corresponding color in the display} if c[x,y,z] < t1 then PaintBox1.canvas.pen.color := clBlue; if c[x,y,z] < t1 then PaintBox1.canvas.brush.color := clBlue; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.pen.color := clRed; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.brush.color := clRed; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.pen.color := clYellow; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.brush.color := clYellow; if (c[x,y,z] > t3) then PaintBox1.canvas.pen.color := clAqua; if (c[x,y,z] > t3) then PaintBox1.canvas.brush.color := clAqua; if (c[x,y,z] > 350) then PaintBox1.canvas.pen.color := clGreen; if (c[x,y,z] > 350) then PaintBox1.canvas.brush.color := clGreen; if (c[x,y,z] > 700) then PaintBox1.canvas.pen.color := clWhite; if (c[x,y,z] > 700) then PaintBox1.canvas.brush.color := clWhite; PaintBox1.canvas.rectangle(x*6,y*6,x*6+6,y*6+6); {this sets the display and unit size} end; {matrix swap} end; {if then} end; if (model2click = true) then {this begins program when Model 2 is sellected} begin for x := minx to maxx do {Diffusion Loop, controls gradient diffusion of both repressors, wing vein and margin, as well as the diffusion of hh} for y := miny to maxy do begin holdC := ((c[x-1,y,0]+c[x+1,y,0]+c[x,y-1,0]+c[x,y+1,0]) - 4*c[x,y,0] )*0.25; newC[x,y,0] := c[x,y,0] + holdC; holdC := ((c[x-1,y,1]+c[x+1,y,1]+c[x,y-1,1]+c[x,y+1,1]) - 4*c[x,y,1] )*0.25; newC[x,y,1] := c[x,y,1] + holdC; holdC := ((c[x-1,y,5]+c[x+1,y,5]+c[x,y-1,5]+c[x,y+1,5]) - 4*c[x,y,5] )*0.25; newC[x,y,5] := c[x,y,5] + holdC; {the presence of the wing vein repressor down regulates the production of Notch} if (c[x,y,0]>1) then c[x,y,2] := c[x,y,2] - 40 else (if(c[x,y,0]<1) then c[x,y,2] := c[x,y,2] + 10); {the presence of Notch up regulates the production of Distal-less while the presence of the wing vein repressor down regulates the production of Dll} if (c[x,y,0]>1) then c[x,y,3] := c[x,y,3] - 40 else (if (c[x,y,2]>50) then c[x,y,3] := c[x,y,3] +10); {the presence of the wing margin repressor down regulates the production of Engrailed, the presence of Dll up regulates the production of En while the presence of activating Ci further up regulates the production of En} if (c[x,y,1]>1) then c[x,y,4] := c[x,y,4] + 0 else (if (c[x,y,3]>150) then (if ((c[x,y,5]>c[x,y,7]) and (c[x,y,6]>1)) then c[x,y,4] := c[x,y,4] +40 else c[x,y,4] := c[x,y,4] + 10)); {the presence of En up regulates the production of hedge-hog as long as Notch is in low concentrations} if (c[x,y,2]<100) then c[x,y,9] := c[x,y,9] + (c[x,y,4]); {the absence or near absence of Notch inhibits the formation of Patched} if (c[x,y,2]<5) then c[x,y,7] := 0; if (c[x,y,5]>1) then {in cells recieving hh, this simulates the removal of Ptc} begin c[x,y,7] := c[x,y,7] - 100; Patchdump :=true; {this sets up the removal of Ptc as a variable by which cubitus interruptus is up regulated} end; {cells producing hh do not express Ci, while only cells expressing moderate to high levels of Notch and an absence of the wing margin repressor have an up regulation of Ci} if (((c[x,y,9]=0) and (c[x,y,2]>50) and (c[x,y,1]<1))and Patchdump = true) then c[x,y,6] := c[x,y,6] + 10; {in cells with moderate to high levels of Notch, Ci up regulates the produciton of Ptc} if (c[x,y,2]>50) then c[x,y,7] := c[x,y,6] + c[x,y,7]; newc[x,y,5] := newc[x,y,5] + c[x,y,9]; {this allows for the proper diffusion of hh} {in cells with moderate to high levels of Notch, En up regulates the production of Ecdysone receptor (Ecr)} if (c[x,y,2]>50) then c[x,y,8] := c[x,y,8] + c[x,y,4]; end; {Diffusion Loop} for x:= minx to maxx do {boundaries for diffusion gradients} begin c[x,miny,0]:=c[x,miny-1,0]; c[x,maxy,0]:=c[x,maxy+1,0]; c[x,miny,1]:=c[x,miny-1,1]; c[x,maxy,1]:=c[x,maxy+1,1]; c[x,miny,5]:=c[x,miny-1,5]; c[x,maxy,5]:=c[x,maxy+1,5]; end; for y:= miny to maxy do {boundaries for diffusion gradients} begin c[minx,y,0]:=c[minx-1,y,0]; c[maxx,y,0]:=c[maXX+1,y,0]; c[minx,y,1]:=c[minx-1,y,1]; c[maxx,y,1]:=c[maXX+1,y,1]; c[minx,y,5]:=c[minx-1,y,5]; c[maxx,y,5]:=c[maXX+1,y,5]; end; {the next statement turns on the display only if a radiobutton is selected} if (repressorclick = true) or (NotchClick = true) or (DllClick = true) or (MarginRepressorClick = True) or (Enclick = True) or (HhClick = True) or (CiClick = True) or (PtcClick = True) or (EcrClick = True) or (Hhdiffclick = True) then begin {Z scores: 0= Wing vein repressor 1= Wing margin repressor 2= Notch 3= Distal-less 4= Engrailed 5= Diffusing hh 6= Cubitus interruptus 7= Patched 8= Ecdysone receptor 9= Production of hh} {the following sets the Z score, dependant on the radiobutton selected, to display only those values in the display} if repressorclick = true then z :=0; if marginrepressorclick = true then z :=1; if NotchClick = true then z :=2; if DllClick = true then z := 3; if Enclick = True then z := 4; if HhClick = True then z := 9; if CiClick = True then z :=6; if PtcClick = True then z :=7; if EcrClick = True then z :=8; if Hhdiffclick = True then z :=5; for x := minx to maxx do {matrix swap and plot} for y := miny to maxy do begin c[x,y,0] := newC[x,y,0]; {these allow for the program to calculate the diffusion of the repressors (0 and 1) and hh(5)} newC[x,y,0] := 0; c[x,y,1] := newC[x,y,1]; newC[x,y,1] := 0; c[x,y,5] := newC[x,y,5]; newC[x,y,5] := 0; Patchdump :=false; {the following sets concentrations to a corresponding color in the display} if c[x,y,z] < t1 then PaintBox1.canvas.pen.color := clBlue; if c[x,y,z] < t1 then PaintBox1.canvas.brush.color := clBlue; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.pen.color := clRed; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.brush.color := clRed; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.pen.color := clYellow; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.brush.color := clYellow; if (c[x,y,z] > t3) then PaintBox1.canvas.pen.color := clAqua; if (c[x,y,z] > t3) then PaintBox1.canvas.brush.color := clAqua; if (c[x,y,z] > 350) then PaintBox1.canvas.pen.color := clGreen; if (c[x,y,z] > 350) then PaintBox1.canvas.brush.color := clGreen; if (c[x,y,z] > 700) then PaintBox1.canvas.pen.color := clWhite; if (c[x,y,z] > 700) then PaintBox1.canvas.brush.color := clWhite; PaintBox1.canvas.rectangle(x*6,y*6,x*6+6,y*6+6); {this sets the display and unit size} end; {matrix swap} end; {if then} end; if (model1click = true) then begin for x := minx to maxx do for y := miny to maxy do begin holdC := ((c[x-1,y,0]+c[x+1,y,0]+c[x,y-1,0]+c[x,y+1,0]) - 4*c[x,y,0] )*0.25; newC[x,y,0] := c[x,y,0] + holdC; holdC := ((c[x-1,y,1]+c[x+1,y,1]+c[x,y-1,1]+c[x,y+1,1]) - 4*c[x,y,1] )*0.25; newC[x,y,1] := c[x,y,1] + holdC; holdC := ((c[x-1,y,5]+c[x+1,y,5]+c[x,y-1,5]+c[x,y+1,5]) - 4*c[x,y,5] )*0.25; newC[x,y,5] := c[x,y,5] + holdC; {the presence of the wing vein repressor down regulates the production of Notch} if (c[x,y,0]>1) then c[x,y,2] := c[x,y,2] - 40 else (if(c[x,y,0]<1) then c[x,y,2] := c[x,y,2] + 10); {the presence of Notch up regulates the production of Distal-less while the presence of the wing vein repressor down regulates the production of Dll} if (c[x,y,0]>1) then c[x,y,3] := c[x,y,3] - 40 else (if (c[x,y,2]>300) then c[x,y,3] := c[x,y,3] +40); {the presence of the wing margin repressor down regulates the production of Engrailed, the presence of Dll up regulates the production of En while the presence of activating Ci further up regulates the production of En} if (c[x,y,1]>1) then c[x,y,4] := c[x,y,4] + 0 else (if (c[x,y,3]>350) then (if (c[x,y,6]>1)then c[x,y,4] := c[x,y,4] +40 else c[x,y,4] := c[x,y,4] + 10)); {the presence of En up regulates the production of hedge-hog as long as Notch is in low concentrations} if (c[x,y,2]<100) then c[x,y,9] := c[x,y,9] + (c[x,y,4]); {the absence or near absence of Notch inhibits the formation of Patched} if (c[x,y,2]<5) then c[x,y,7] := 0; {the presence of diffusing hh upregulates the production of Ptc} if (c[x,y,5]>0) then c[x,y,7] := c[x,y,7] + c[x,y,5]; {the presence of Ptc coupled with moderate to high levels of Notch up regulates the production of Ci} if (c[x,y,7]>0) then c[x,y,6] := c[x,y,6] + c[x,y,7]; newc[x,y,5] := newc[x,y,5] + c[x,y,9]; {this allows for the proper diffusion of hh} {in cells with moderate to high levels of Notch, En up regulates the production of Ecdysone receptor (Ecr)} if (c[x,y,2]>350) then c[x,y,8] := c[x,y,8] + c[x,y,4] + c[x,y,3]; end; {Diffusion Loop} for x:= minx to maxx do {boundaries for diffusion gradients} begin c[x,miny,0]:=c[x,miny-1,0]; c[x,maxy,0]:=c[x,maxy+1,0]; c[x,miny,1]:=c[x,miny-1,1]; c[x,maxy,1]:=c[x,maxy+1,1]; c[x,miny,5]:=c[x,miny-1,5]; c[x,maxy,5]:=c[x,maxy+1,5]; end; for y:= miny to maxy do {boundaries for diffusion gradients} begin c[minx,y,0]:=c[minx-1,y,0]; c[maxx,y,0]:=c[maXX+1,y,0]; c[minx,y,1]:=c[minx-1,y,1]; c[maxx,y,1]:=c[maXX+1,y,1]; c[minx,y,5]:=c[minx-1,y,5]; c[maxx,y,5]:=c[maXX+1,y,5]; end; {the next statement turns on the display only if a radiobutton is selected} if (repressorclick = true) or (NotchClick = true) or (DllClick = true) or (MarginRepressorClick = True) or (Enclick = True) or (HhClick = True) or (CiClick = True) or (PtcClick = True) or (EcrClick = True) or (Hhdiffclick = True) then begin {Z scores: 0= Wing vein repressor 1= Wing margin repressor 2= Notch 3= Distal-less 4= Engrailed 5= Diffusing hh 6= Cubitus interruptus 7= Patched 8= Ecdysone receptor 9= Production of hh} {the following sets the Z score, dependant on the radiobutton selected, to display only those values in the display} if repressorclick = true then z :=0; if marginrepressorclick = true then z :=1; if NotchClick = true then z :=2; if DllClick = true then z := 3; if Enclick = True then z := 4; if HhClick = True then z := 9; if CiClick = True then z :=6; if PtcClick = True then z :=7; if EcrClick = True then z :=8; if Hhdiffclick = True then z :=5; for x := minx to maxx do {matrix swap and plot} for y := miny to maxy do begin c[x,y,0] := newC[x,y,0]; {these allow for the program to calculate the diffusion of the repressors (0 and 1) and hh(5)} newC[x,y,0] := 0; c[x,y,1] := newC[x,y,1]; newC[x,y,1] := 0; c[x,y,5] := newC[x,y,5]; newC[x,y,5] := 0; Patchdump :=false; {the following sets concentrations to a corresponding color in the display} if c[x,y,z] < t1 then PaintBox1.canvas.pen.color := clBlue; if c[x,y,z] < t1 then PaintBox1.canvas.brush.color := clBlue; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.pen.color := clRed; if (c[x,y,z] > t1) and (c[x,y,z] < t2) then PaintBox1.canvas.brush.color := clRed; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.pen.color := clYellow; if (c[x,y,z] > t2) and (c[x,y,z] < t3) then PaintBox1.canvas.brush.color := clYellow; if (c[x,y,z] > t3) then PaintBox1.canvas.pen.color := clAqua; if (c[x,y,z] > t3) then PaintBox1.canvas.brush.color := clAqua; if (c[x,y,z] > 350) then PaintBox1.canvas.pen.color := clGreen; if (c[x,y,z] > 350) then PaintBox1.canvas.brush.color := clGreen; if (c[x,y,z] > 700) then PaintBox1.canvas.pen.color := clWhite; if (c[x,y,z] > 700) then PaintBox1.canvas.brush.color := clWhite; PaintBox1.canvas.rectangle(x*6,y*6,x*6+6,y*6+6); {this sets the display and unit size} end; {matrix swap} end; end; end; end; {from here down are procedures telling program what to do when an individual radio button is sellected} procedure TForm1.Button3Click(Sender: TObject); begin close; end; procedure TForm1.Repressor(Sender: TObject); begin RepressorClick := True; NotchClick := False; DllClick := False; MarginRepressorClick := False; Enclick := False; HhClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Notch(Sender: TObject); begin NotchClick := True; RepressorClick := False; DllClick := False; MarginRepressorClick := False; Enclick := False; HhClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Dll(Sender: TObject); begin RepressorClick := False; NotchClick := False; DllClick := True; MarginRepressorClick := False; Enclick := False; HhClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.MarginRepressor(Sender: TObject); begin MarginRepressorClick := True; RepressorClick := False; NotchClick := False; DllClick := False; Enclick := False; HhClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.En(Sender: TObject); begin Enclick := True; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; HhClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Hh(Sender: TObject); begin HhClick := True; Enclick := False; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; CiClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Ci(Sender: TObject); begin CiClick := True; HhClick := False; Enclick := False; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; PtcClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Ptc(Sender: TObject); begin PtcClick := True; CiClick := False; HhClick := False; Enclick := False; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; EcrClick := False; Hhdiffclick := False; end; procedure TForm1.Ecr(Sender: TObject); begin EcrClick := True; PtcClick := False; CiClick := False; HhClick := False; Enclick := False; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; Hhdiffclick := False; end; procedure TForm1.Hhdiff(Sender: TObject); begin Hhdiffclick := True; EcrClick := False; PtcClick := False; CiClick := False; HhClick := False; Enclick := False; MarginRepressorClick := False; RepressorClick := False; NotchClick := False; DllClick := False; end; procedure TForm1.model1(Sender: TObject); begin model1click := True; model2click := False; model3click := False; end; procedure TForm1.model2(Sender: TObject); begin model1click := False; model2click := True; model3click := False; end; procedure TForm1.model3(Sender: TObject); begin model1click := False; model2click := False; model3click := True; end; end.