home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
PUDD.ARC
/
PUDD-01.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
4KB
|
150 lines
procedure PointSet( size :integer; {.....set and draw a point }
var x1,y1 :integer;
Xpoz,Ypoz :integer);
begin
moveto(xpoz,ypoz);
offxhair(size,xpoz,ypoz);
x1 := xpoz;
y1 := ypoz;
drawto(xpoz,ypoz);
initxhair(size,xpoz,ypoz);
end;
procedure MoveCross(size,speed :integer;
direction :char;
var Xpoz,Ypoz :integer );
var multi :integer;
begin
if speed = 1 then
multi := 1
else
multi := 2;
case direction of
'4':begin
xpoz := xpoz - speed*multi;
end;
'7':begin
xpoz := xpoz - speed*multi;
ypoz := ypoz + speed;
end;
'8':begin
ypoz := ypoz + speed;
end;
'9':begin
xpoz := xpoz + speed*multi;
ypoz := ypoz + speed;
end;
'6':begin
xpoz := xpoz + speed*multi;
end;
'3':begin
xpoz := xpoz + speed*multi;
ypoz := ypoz - speed;
end;
'2':begin
ypoz := ypoz - speed;
end;
'1':begin
xpoz := xpoz - speed*multi;
ypoz := ypoz - speed;
end;
end; {....................................case }
if Xpoz < 0 then Xpoz := 0;
if XPoz > 639 then Xpoz := 639;
if Ypoz < 0 then Ypoz := 0;
if Ypoz > 239 then Ypoz := 239;
movXhair(size,xpoz,ypoz);
end;
{----------------- Notes on cross hair use ----------------------------------
The first time the crosshair is used in a program it must be called by
the procedure 'initXhair'. Each following reference to the crosshair can
be done by 'movXhair'. The exception is when any other reference is made to
any of the graphics calls. Once another call has been made the crosshair
must be re-initalized. This is done by calling 'reInitXhair'. The cross-
hair is turned off by 'offXhair'. The size is set by a constant in the
toolbox. It can be any size.
----------------------------------------------------------------------------}
procedure DrawNext( size :integer; {...Draws line from last point }
var x1,y1 :integer;
Xpoz,Ypoz :integer); { and updates point }
begin
moveto(x1,y1);
offxhair(size,xpoz,ypoz);
drawto(xpoz,ypoz);
initxhair(size,xpoz,ypoz);
x1 := xpoz;
y1 := ypoz;
end;
procedure LineNext( size :integer; {...Draws line from last point }
x1,y1 :integer;
Xpoz,Ypoz :integer);
begin
moveto(x1,y1);
offxhair(size,xpoz,ypoz);
drawto(xpoz,ypoz);
initxhair(size,xpoz,ypoz);
end;
procedure InitDefault; {......... all var's are global }
begin
clrscr;
gotoXY(20,20);
write('Your Num-Lock must be on !!!');
delay(2000);
clrscr;
vLineStyle := 'Solid';
vLineColor := 'White';
vFillStyle := 'Solid';
vFillIndex := 1;
vFillColor := 'White';
vWriteMode := 'Replace';
Size := 5;
speed := 1;
Xpoz := 0;
Ypoz := 0;
x1 := 0;
y1 := 0;
MoveTo(Xpoz,Ypoz);
end;
procedure SetTypes; {.......sorry, everything is global }
var i,j,k :integer;
begin
if vLineStyle = 'Solid' then SetLine(1);
if vLineStyle = 'Dashed' then SetLine(2);
if vLineStyle = 'Dotted' then SetLine(3);
if vLineStyle = 'Dash-Dot' then SetLine(4);
if vLineStyle = 'Long-Dash' then SetLine(5);
if vLineStyle = 'Short-Dash' then SetLine(6);
if vLineStyle = 'Dot-Dot-Dash' then SetLine(7);
if vLineStyle = 'Long-Dot' then SetLine(8);
if vLineColor = 'White' then LineColor(1)
else LineColor(0);
if vFillColor = 'White' then i := 1
else i := 0;
if vFillStyle = 'Hollow' then FillTypes(0,vFillIndex,i);
if vFillStyle = 'Solid' then FillTypes(1,vFillIndex,i);
if vFillStyle = 'Pattern' then FillTypes(2,vFillIndex,i);
if vFillStyle = 'Hatched' then FillTypes(3,vFillIndex,i);
if vWriteMode = 'Replace' then WriteMode(1);
if vWriteMode = 'Fill' then WriteMode(2);
if vWriteMode = 'OverWrite' then WriteMode(3);
if vWriteMode = 'Reverse' then WriteMode(4);
end;