-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcomp.pas
68 lines (57 loc) · 1.36 KB
/
comp.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
unit comp;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm2 = class(TForm)
PB: TPaintBox;
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
uses main;
{$R *.DFM}
procedure TForm2.Button1Click(Sender: TObject);
begin
listbox1.Items:=form1.listbox1.items;
end;
procedure TForm2.Button2Click(Sender: TObject);
var
z,mx,my,temp:Byte;
begin
For z:=1 to 4 Do
Begin
for mx:=0 to compx do
for my:=0 to compy do
Begin
temp:=comp[Listbox1.ItemIndex+1,z,mx,my];
If temp=0 then temp:=32;
PB.Canvas.TextOut(mx*extentx,my*extenty+(compy*extenty*(z-1)),chr(temp));
End;
End;
pb.canvas.pen.Color:=clyellow;
for mx:=0 to compx do
Begin
pb.Canvas.MoveTo(mx*extentx,0);
pb.Canvas.LineTo(mx*extentx,compy*4*extenty);
End;
for z:=1 to 4 Do
for my:=0 to compy do
Begin
If my=0 Then pb.canvas.pen.color:=clred
Else pb.canvas.pen.color:=clyellow;
pb.Canvas.MoveTo(0,my*extenty+(compy*extenty*(z-1)));
pb.Canvas.LineTo(compx*extentx,my*extenty+(compy*extenty*(z-1)));
End;
end;
end.