D
dyxhy2003
Unregistered / Unconfirmed
GUEST, unregistred user!
Const
ClassHeight=20;
ClassWidth =13;
var
ClassWorkSheet:Array [1..ClassHeight,1..ClassWidth] of byte;
LassWorkSheet:Array [1..ClassHeight,1..ClassWidth] of byte;
procedure TForm1.FormPaint(Sender: TObject);
var
i,j:integer;
x1,y1,x2,y2:integer;
newrect:Trect;
begin
for j:=1 to Classheight do
for i:=1 to Classwidth do
ClassWorkSheet[j,i]:=255;
for j:=1 to Classheight do
for i:=1 to Classwidth do
begin
if ClassWorkSheet[j,i]=LassWorkSheet[j,i] then continue
else
begin
x1:=(i-1)*20;
y1:=(j-1)*20;
x2:=i*20;
y2:=j*20;
newrect:=rect(x1,y1,x2,y2);
case ClassWorkSheet[j,i] of
0:canvas.Brush.Color:=clteal;
1:canvas.Brush.Color:=clsilver;
2:canvas.Brush.Color:=clred;
3:canvas.Brush.Color:=cllime;
4:canvas.Brush.Color:=clBlue;
5:canvas.Brush.Color:=clfuchsia;
6:canvas.Brush.Color:=claqua;
7:canvas.Brush.Color:=clyellow;
end;
if ClassWorkSheet[j,i]>0 then
begin
canvas.FillRect(newrect);
canvas.pen.Color:=clgray;
canvas.MoveTo(x1,y1);
canvas.LineTo(x1,y1+19);
canvas.LineTo(x1+19,y1+19);
canvas.pen.Color:=clwhite;
canvas.LineTo(x1+19,y1);
canvas.LineTo(x1,y1);
end
else
begin
canvas.FillRect(newrect);
end;
end;
end;
end;
ClassHeight=20;
ClassWidth =13;
var
ClassWorkSheet:Array [1..ClassHeight,1..ClassWidth] of byte;
LassWorkSheet:Array [1..ClassHeight,1..ClassWidth] of byte;
procedure TForm1.FormPaint(Sender: TObject);
var
i,j:integer;
x1,y1,x2,y2:integer;
newrect:Trect;
begin
for j:=1 to Classheight do
for i:=1 to Classwidth do
ClassWorkSheet[j,i]:=255;
for j:=1 to Classheight do
for i:=1 to Classwidth do
begin
if ClassWorkSheet[j,i]=LassWorkSheet[j,i] then continue
else
begin
x1:=(i-1)*20;
y1:=(j-1)*20;
x2:=i*20;
y2:=j*20;
newrect:=rect(x1,y1,x2,y2);
case ClassWorkSheet[j,i] of
0:canvas.Brush.Color:=clteal;
1:canvas.Brush.Color:=clsilver;
2:canvas.Brush.Color:=clred;
3:canvas.Brush.Color:=cllime;
4:canvas.Brush.Color:=clBlue;
5:canvas.Brush.Color:=clfuchsia;
6:canvas.Brush.Color:=claqua;
7:canvas.Brush.Color:=clyellow;
end;
if ClassWorkSheet[j,i]>0 then
begin
canvas.FillRect(newrect);
canvas.pen.Color:=clgray;
canvas.MoveTo(x1,y1);
canvas.LineTo(x1,y1+19);
canvas.LineTo(x1+19,y1+19);
canvas.pen.Color:=clwhite;
canvas.LineTo(x1+19,y1);
canvas.LineTo(x1,y1);
end
else
begin
canvas.FillRect(newrect);
end;
end;
end;
end;