home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
DIVERSEN
/
TIPI2A
/
HELPGRAF.TPI
< prev
next >
Wrap
Text File
|
1994-09-13
|
7KB
|
309 lines
define menu
# ( -- choice)
# ( valid$ -- )
# Returns the chosen key or 0 if the user escapes from this menu
0 cursor
ucase$
27 chr$ swap$ +$
begin
inkey$ ucase$ # valid$ key$
len instr *
dup
if dup drop$ endif drop$
until
1 -
1 cursor
enddef
define wait
begin key until cls
enddef
begin cls
|
| ╔════════════════════════════════════════════════╗
| ║ G R A P H I C S I N S T R U C T I O N S ║
| ╠══════════════╦═══════════════╦═════════════════╣
| ║ ║ ║ ║
| ║ [A] DRAWLINE ║ [G] PLOTPOINT ║ [M] SETLINETYPE ║
| ║ ║ ║ ║
| ║ [B] DRAWRECT ║ [H] PLOTTEXT ║ [N] SETLOGORG ║
| ║ ║ ║ ║
| ║ [C] GETFONT ║ [I] SCREEN ║ [O] SETPENCOLOR ║
| ║ ║ ║ ║
| ║ [D] GETPOINT ║ [J] SCROLL ║ [P] SETREPRULE ║
| ║ ║ ║ ║
| ║ [E] MOVEPEN ║ [K] SETCLIP ║ [Q] SETVMODE ║
| ║ ║ ║ ║
| ║ [F] PLOTICON ║ [L] SETFONT ║ [R] ZOOM ║
| ╚══════════════╩═══════════════╩═════════════════╝
"abcdefghijklmnopqr" menu dup cls
case 0 of endof
1 of
|
| DRAWLINE
|
| Data Stack: row col --
| String Stack: --
|
| Draws a line from the current pen location to
| row, col.
|
wait
endof
2 of
|
| DRAWRECT
|
| Data Stack: fill row col --
| String Stack: --
|
| Draws a rectangle from the current pen location
| to row, col. If fill is 1 the rectangle is drawn
| filled. If not the rectangle will be drawn
| unfilled.
|
wait
endof
3 of
|
| GETFONT
|
| Data Stack: height width -- HiFontID LoFontID
| String Stack: --
|
| Returns the font ID of a font whose characters
| are height * width pixels.
|
wait
endof
4 of
|
| GETPOINT
|
| Data Stack: row col -- color
| String Stack: --
|
| Returns the color of the point at row, col.
|
wait
endof
5 of
|
| MOVEPEN
|
| Data Stack: row col --
| String Stack: --
|
| Moves the pen to row col.
|
wait
endof
6 of
|
| PLOTICON
|
| Data Stack: rule row col --
| String Stack: icon$ --
|
| Plots an HP icon (.icn) file at location row,
| col according to rule. The screen should have
| been set to a graphics mode and row and col are
| given in pixels. Row and col are the locations
| of the top left corner of the icon and rule
| should be set according to the following table.
|
| 0 FORCE
| 1 AND
| 2 OR
| 3 XOR
| 4 Invert the image and then FORCE
| 5 Invert the image and then AND
| 6 Invert the image and then OR
| 7 Invert the image and then XOR
|
wait
endof
7 of
|
| PLOTPOINT
|
| Data Stack: row col --
| String Stack: --
|
| Plots a point at row, col.
|
wait
endof
8 of
|
| PLOTTEXT
|
| Data Stack: Rflag Row Col --
| String Stack: Text$ --
|
| Plots Text$ at Row, Col in the current font. If
| Rflag is 0, text is plotted horizontally. If
| Rflag is 1, text is rotatated 90 degrees.
|
wait
endof
9 of
|
| SCREEN
|
| Data Stack: Mode --
| String Stack: --
|
| Sets the screen mode of a PC according to Mode.
| The following table gives values for mode.
|
| Mode Graphics Res. Text Res. Adapters
| ---- ------------- --------- --------
| 0 None 25*80*16 Any
| 1 200*320*4 25*40*4 CGA/EGA/VGA
| 2 200*640*2 25*80*2 CGA/EGA/VGA
| 7 200*320*16 25*40*16 EGA/VGA
| 9 350*640*16 25*80*16 EGA/VGA
| 13 200*320*256 25*40*16 VGA
|
wait
endof
10 of
|
| SCROLL
|
| Data Stack: Dir Row Col Color Distance --
| String Stack: --
|
| Scrolls a rectangular region of the screen.
| The region is defined from the current pen
| position to Row, Col. Distance is the number
| of pixels to scroll. Dir controls the direction
| of the scroll and Color controls whether bits
| scrolled "in" are set or cleared.
|
wait
endof
11 of
|
| SETCLIP
|
| Data Stack: MinRow MinCol MaxRow MaxCol --
| String Stack: --
|
| Sets the graphics clipping region.
|
wait
endof
12 of
|
| SETFONT
|
| Data Stack: HiFontID LoFontID --
| String Stack: --
|
| Sets a font for use in graphics modes.
|
wait
endof
13 of
|
| SETLINETYPE
|
| Data Stack: Type --
| String Stack: --
|
| Sets a line type for graphics plotting.
|
wait
endof
14 of
|
| SETLOGORG
|
| Data Stack: Row Col --
| String Stack: --
|
| Sets the logical origin to Row, Col. The logical
| coordinates are set off the actual physical
| screen. Any future coordinate operations are
| given relative to the logical origin. SETLOGORG
| resets the CLIP REGION to the entire physical
| screen.
|
wait
endof
15 of
|
| SETPENCOLOR
|
| Data Stack: Color --
| String Stack: --
|
| Sets the pen color for graphics drawing commands.
|
wait
endof
16 of
|
| SETREPRULE
|
| Data Stack: Rule --
| String Stack: --
|
| Sets the graphics replacement rule according to
| the following table:
|
| 0 = FORCE
| 1 = AND
| 2 = OR
| 3 = XOR
| 8 = FORCETEXT
|
wait
endof
17 of
|
| SETVMODE
|
| Data Stack: Mode --
| String Stack: --
|
| Sets the current video mode to alpha or graphics
| and clears the display. Mode should be set
| according to the following table:
|
| 3 = CGA alpha mode
| 6 = CGA graphics mode 640*200
| 7 = HP95LX alpha
| 32 = HP95LX graphics
|
wait
endof
18 of
|
| ZOOM
|
| Data Stack: Z --
| String Stack: --
|
| Changes the zoom mode of the HP100LX. Z should
| be set according to the following table:
|
| 2 = 80*25 BW
| 3 = 80*25 Color
| 7 = 40*16 BW Zoomed
| 33 = 80*25 BW
| 128 = 64*18 BW Zoomed
| 129 = 64*18 Color Zoomed
| 130 = 40*25 BW Zoomed
| 131 = 40*25 Color Zoomed
| 132 = 40*16 BW Zoomed
| 133 = 40*16 Color Zoomed
|
wait
endof
endcase
not until