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.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
8KB
|
197 lines
{..a drawing program for the televideo.
see Pudd.doc for full info }
program pudd(input,output);
type pointlist = array[1..126] of integer;
{..........an array of max 63 (x,y) pairs for the polyline function }
screenline = string[80];
{............a string passed to chargraph for writing on the screen }
DefTypes = string[13];
ScanLine = array[1..80] of byte; {....this is for GetLine }
filename = string[8] ; {--------------------------}
filetype = string[3] ; { these are for file io }
fullname = string[14] ; {--------------------------}
Blist = string[8] ; {.....used in *byte procedures }
HexString= string[4] ; {....used in drawrow }
typicalstring = string[15];
textfile = text;
var xpoz,ypoz,counter :integer; {.....xPoz,yPoz are crosshair position }
speed :integer; {.... of crosshair movement }
size :integer; {..... of crosshair }
direction :integer; {..... of crosshair movement }
title :screenline; {....enter text on the graphic screen }
message :screenline; {....as above }
response :char; {..........generally useful }
x1,y1,x2,y2 :integer; {....x1,y1 are graphic curser position }
vLineStyle,vLineColor :DefTypes; {----------------------------------}
vFillStyle :DefTypes; { watch out, most of these are }
vFillIndex :integer; { used in a global fashion }
vFillColor,vWriteMode :DefTypes; {----------------------------------}
i,j,k :integer; {........generally useful }
name :filename ; {-------------------------}
ftype :filetype ; { for file io / -}
UseFile :fullname ; { / -}
drive :char ; { / -}
X,Y :integer ; { / -}
DiskFile :file ; { / -}
ByteList :scanline ; { / -}
TransBuff :array[1..640] of byte; {_____/ -}
{$I tools1.pas} { ...basic graphic tools: }
{ charcolor
CharGraph
initgraph
cleargraph
setline
linecolor
writemode}
{$I tools2.pas} {....basic graphic tools: }
{ moveto
drawto
alphamode
polyline
getline}
{$I tools3.pas} {....curser movement tools }
{ xhair
movXhair
initXhair
reInitXhair
offXhair}
{$I tools4.pas} {....fill & bar tools }
{ fillbar
filltypes}
{$I GenTools.pas} {....general bit and byte manipulations }
{ clrbitB
setbitB
ReadByte
Fliplist}
{$I filetool.pas} {....file handling tools }
{ Exist
CurrDrive
NewDrive
GetDrive
Checkstring
UpCaseString
GetType
FetchName
BackFile
NewFileName
OldFileName}
{$I Pudd-01.pas} {....drawing procedures and global initalization }
{ PointSet
MoveCross
DrawNext
LineNext
InitDefault
SetTypes}
{$I Pudd-02.pas} {....arrows, text, menus etc }
{ HeadLine
SpeedSet
ClrSomeScr
Extensive
Set1, Set2, .... SetN
Status
CleanUp
text
Arrow}
{$I Pudd-03.pas} {....disk to screen io }
{ DrawRow
Save
Load
Files}
{$I Pudd-04.pas} {....screen to printer io and help }
{ Print
Display
Help}
{$I Pudd-05.pas} {....fills an area, creates or erases a rectangle }
{ RightMost
LeftMost
fillone
fillArea
MoveBox
Block}
{$I Pudd-06.pas} {.....write stuff }
{$I Pudd-07.pas} {.....InBounds }
{vectorPoint
angle
arc}
{*****************************************************************************
** Graphics is a pretty central procedure. It is called by the main **
** and it calls all the drawing procedures. Most of the drawing **
** procedures are in PUDD-nn.PAS. These drawing procedures, in turn **
** will call drawing primitives from TOOLSn.PAS. **
*****************************************************************************}
procedure Graphics;
begin
Initgraph;
while not((response = 'R') or (response = #$1B)) do
begin
read(kbd,response);
response := UpCase(response);
case response of
'P':PointSet(size,x1,y1,Xpoz,Ypoz);
'W':CleanUp;
'U':Arc(xPoz,yPoz);
'X':Extensive(size,x1,y1,xPoz,yPoz);
'D':DrawNext(size,x1,y1,xPoz,yPoz);
'L':LineNext(size,x1,y1,xPoz,yPoz);
'A':Arrow(size,x1,y1,xPoz,yPoz);
'T':Text(xPoz,yPoz);
'F':FillArea;
'B':Block(false);
'E':Block(true);
'C':begin
Status;
HeadLine;
initgraph;
end;
'S':SetSpeed(speed);
'5':SetSpeed(speed);
'1'..'9':begin
reInitXhair(size,xpoz,ypoz);
MoveCross(size,speed,response,xPoz,yPoz);
end;
end; {......case }
end; {.....while }
alphamode;
HeadLine;
end; {................Graphics }
begin {***************************************** M A I N *************}
InitDefault;
SetTypes;
initXhair(size,xpoz,ypoz);
HeadLine;
response := '?';
while not(response = 'Q') do
begin
if KeyPressed then {.....clear misc kbd stuff }
read(kbd,response);
read(kbd,response);
response := UpCase(response);
case response of
'G': graphics;
'P': print;
'F': files;
'W': begin
writeletter;
Headline;
end;
'H': begin
help;
Headline;
end;
'C': begin
status;
HeadLine;
end;
end; {.........case }
end; {.........while }
offXhair(size,xPoz,yPoz);
end.