EasyManua.ls Logo

Radio Shack TRS-80 X-PAD GT-116 - Appendix E; Template;Menu Demonstration Program

Radio Shack TRS-80 X-PAD GT-116
65 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix
E/
Template/Menu
Demonstration
Program
The
X-Pad
Menu
Demonstration
Program will
illustrate
some
more of
the possibilities
of
your
X-pad and
must
be
used with the
X-Pad
Menu
Template. The
following
program
and the
Template
will
allow
you
to:
Use
the graphics
capabilites
of
your Color
Computer
without touching
the
keyboard.
Simulate
PRINT
@
with
the TEXT
Command for
labeling
charts.
Copy
graphics
from
one screen
location
to
another.
Draw freehand
in High
Resolution
Graphics
and
more!
The
entire program
requires
a 32K Color
Computer,
but
we'll show
you
how
to run
it
on a 16K
Computer.
20
REM
XPAD
DEMONSTRATION
30
REM
40
REM
41 REM TOP MENU
FUNCTIONS:
42
REM
BOX
43
REM
BOX
44
REM
BOX
45
REM
BOX
46
REM
BOX
47
REM
BOX
48
REM
BOX
COPY
CONTENTS
OF
BOX
TO NEW
LOCATION
ENTER
TEXT
FROM
KEYBOARD
AT
GIVEN
LOCATION
DRAW
CONTINUOUSLY
WHILE
PEN
IS DOWN
PAINT
COLOR
SELECTED
FROM
LOWER
MENU
ERASE
A LINE
DRAW
A
STRAIGHT
LINE
BETWEEN TWO
POINTS
DRAW A
CIRCLE
AROUND A
CENTER POINT
WITH
DEFINED
RADIUS
49
REM
BOX
8
DRAW
A
BOX
AT
DIAGONAL
CORNER
POINTS
50
REM
BOX
9
CLEAR THE
SCREEN
51
REM
52
REM
BOTTOM
MENU
COLORS:
53
REM
BOX
1 BLACK
54
REM BOX
2 GREEN
55
REM
BOX
3
YELLOW
56
REM
BOX
4 BLUE
57
REM
BOX
5
RED
58
REM
BOX
6
BUFF
59
REM
BOX
7 CYAN
60
REM
BOX
8 MAGENTA
61
REM
BOX
9
ORANGE
62
REM
10
REM
************************
80
REM
SOME HANDY
VARIABLES:
90
REM
X=HORIZONTAL
PEN POSIT
100
REM
110
REM
120
REM
130
REM
140
REM
150
REM
152
REM
160
REM
161 REM
162 REM
163
REM
164
REM
165
REM
170
REM
180
REM
Y=VERTICAL
PEN POSIT
S=PEN STATUS
MU=CURRENT
MENU
FUNCTION
C=CURRENT
PAINT
COLOR
B=CURRENT
BORDER
COLOR
TP=TEXT
POSIT
SELECTED
CS=COLOR
SET
************************
THIS
PROGRAM
WILL
RUN
IN
A 16K
MACHINE
IF
THE FOLLOWING
LINES
ARE
DELETED:
200-210,610-690,1080,1160
THIS
DISABLES
THE
"COPY"
FUNCTION
INITIALIZE
PROGRAM
210
DIM
V(30,30)
220
DIM
AZ$(25)
230
FOR
LE
=
TO
25
240
READ
AZ$(LE)
250
NEXT LE
260
CS=1
270
PCLS:PMODE
3,1:
SCREEN
1,CS
280
MU=0
290
REM
300
REM
***********************
310
REM
TOP
OF MAIN
LOOP
320
REM
DECODE
PEN STATUS
AND
330
REM DISPATCH
ACCORDINGLY
332
REM IF TEXT
IS BEING
ENTERED
334
REM
DECODE
AND DRAW THE
LETTER
340
REM
***********************
350
GOSUB
2870
360
IF
S>15
THEN
350
370
S=S+1: REM
"ON
S"
MUST
START WITH
1
380
ON
S GOSUB
2900,2900,530,780,2900,2900,2900,3630,2900,2900,2900,890,2900
,2900,2900,2900
390
IF MU<>2
THEN
350
400
IF
TP^0
THEN
350
410
A$=INKEY$
420
IF A$=""
THEN
350
430
IF
"A">A$ OR
"Z"<A$ THEN
35044
450
DRAW
"BR5BU7"
460
GOTO
350
470
REM
480
REM
***********************
490
REM PEN
STATUS
2:
500
REM
"PEN NOT DEPRESSED"
510
REM DISPLAY
CURSOR
DRAW
AZ$(ASC(A$)-65)
49