home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
PStream
/
Rexx
/
ARexxDemo.tsrx
next >
Wrap
Text File
|
1993-11-08
|
7KB
|
371 lines
/* DEMONSTRATION OF TYPESMITH'S AREXX CAPABILITIES */
/* Copyright 1993 Soft-Logik Publishing Corporation */
/* May not be distributed without Soft-Logik Publishing Corporation's express written permission */
/* $VER: 2.0 */
ADDRESS 'TYPESMITH'
OPTIONS RESULTS
TRACE OFF
/* Screen to front */
TO_FRONT
/* Get the version number of TypeSmith and store it in RESULT */
VERSION
/* The underscore character in front of a string is for hotkeys.
** It will be filtered out if you have `Use system requesters'
** turned on.
*/
DISPLAY_ALERT 'Welcome to a demonstration of TypeSmith 'TRUNC(RESULT/100,2) 'and ARexx!|Continue|Exit'
if RC = 5 then EXIT
/* open a requester with a text gadget */
GET_STRING 'What is your name?|Continue|Cancel'
if RC = 5 then RESULT = 'No Name'
name = RESULT
DISPLAY_ALERT 'Hi 'name'!|Continue|Exit'
if RC = 5 then EXIT
/* Ask for permission to start a new font */
DISPLAY_ALERT name', can I clear the existing font?|Continue|Exit'
if RC = 5 then EXIT
DISPLAY_ALERT 'First, we will start a new font...|Continue|Exit'
if RC = 5 then EXIT
/* Start a new font, open a character window, name it and size the window */
NEW_FONT
NEW_METRIC
SET_FONTNAME 'ARexx Demonstration'
SET_FAMILY 'ARexxDemo'
SET_WEIGHT 'Normal'
SET_FULLNAME 'ARexxDemoNormal'
SET_FONTID '999'
SET_NOTICE 'This is only a test folks...'
SIZE_WINDOW 550 600
SHOW_FILLED 0
DISPLAY_ALERT 'I will now draw a letter 'A'.|Continue|Exit'
if RC = 5 then EXIT
/* draw a serif 'A' */
MOVETO 18 2
LINETO 18 20
CURVETO 54 20 81 39 105 97
LINETO 336 651
LINETO 358 651
LINETO 606 73
CURVETO 626 32 650 20 683 20
LINETO 683 1
LINETO 438 1
LINETO 438 20
CURVETO 495 20 512 37 503 73
LINETO 447 208
LINETO 197 208
LINETO 153 97
CURVETO 127 46 139 20 209 20
LINETO 209 1
CLOSEPATH
MOVETO 211 251
LINETO 433 251
LINETO 322 512
CLOSEPATH
DISPLAY_ALERT 'Now I will zoom in and out a bit...|Continue|Exit'
if RC = 5 then EXIT
/* set the scaling factor a bit */
SET_SCALE 4
SET_SCALE 5
SET_SCALE 6
SET_SCALE 7
SET_SCALE 6
SET_SCALE 5
SET_SCALE 4
SET_SCALE 3
SET_SCALE 2
SET_SCALE 3
DISPLAY_ALERT 'TypeSmith can show characters filled or unfilled...|Continue|Exit'
if RC = 5 then EXIT
/* show character as filled */
SHOW_FILLED 1
DISPLAY_ALERT 'But it is easier to work with just outlines...|Continue|Exit'
if RC = 5 then EXIT
/* show characters as unfilled */
SHOW_FILLED 0
DISPLAY_ALERT 'I will now select the first point in the first path.|Continue|Exit'
if RC = 5 then EXIT
/* select the first point of the first path */
FIRST_PATH
DISPLAY_ALERT 'I can find out its coordinates...|Continue|Exit'
if RC = 5 then EXIT
/* get coordinates of point */
GET_POINTX
pointx = RESULT
GET_POINTY
pointy = RESULT
DISPLAY_ALERT 'Point x='pointx' y='pointy'|Continue|Exit'
if RC = 5 then EXIT
DISPLAY_ALERT 'I can change the coordinates of a point...|Continue|Exit'
if RC = 5 then EXIT
SET_POINT 100 100 0 0 0 0
DISPLAY_ALERT 'I will change it back now...|Continue|Exit'
if RC = 5 then EXIT
SET_POINT pointx pointy 0 0 0 0
DISPLAY_ALERT 'Watch me select various points in this path...|Continue|Exit'
if RC = 5 then EXIT
/* select the next point in this path, then continue... */
NEXT_POINT
NEXT_POINT
NEXT_POINT
NEXT_POINT
NEXT_POINT
PREVIOUS_POINT
PREVIOUS_POINT
GOTO_START
DISPLAY_ALERT 'Now I will select all the points in the first path.|Continue|Exit'
if RC = 5 then EXIT
/* select all the points in the path */
SELECT_PATH
DISPLAY_ALERT 'Now I will select all the points in the second path.|Continue|Exit'
if RC = 5 then EXIT
/* select the first point of the next path next_path only works when 1
point is selected, thus we need to use first_path again */
FIRST_PATH
NEXT_PATH
SELECT_PATH
DISPLAY_ALERT 'I can even switch back and forth between paths...|Continue|Exit'
if RC = 5 then EXIT
/* select one path, then all its points, then the other path... */
FIRST_PATH
NEXT_PATH
PREVIOUS_PATH
NEXT_PATH
PREVIOUS_PATH
DISPLAY_ALERT 'And I can select all the points in a specified area...|Continue|Exit'
if RC = 5 then EXIT
/* select an area */
SELECT_AREA 0 0 250 250
DISPLAY_ALERT 'Now I will select all the points in both paths.|Continue|Exit'
if RC = 5 then EXIT
/* select all the points in the character */
SELECT_ALL
DISPLAY_ALERT 'Watch me rotate the A.|Continue|Exit'
if RC = 5 then EXIT
/* rotate all the selected points */
ROTATE 5
ROTATE 5
ROTATE 5
ROTATE 5
ROTATE 5
DISPLAY_ALERT 'Watch me skew the A now.|Continue|Exit'
if RC = 5 then EXIT
/* skew all the selected points */
SKEW 5
SKEW 5
SKEW 5
SKEW 5
SKEW 5
DISPLAY_ALERT 'Watch me flip the A.|Continue|Exit'
if RC = 5 then EXIT
/* flip horizontally and vertically */
FLIP 0
FLIP 1
FLIP 0
FLIP 1
DISPLAY_ALERT 'I can make it bigger...|Continue|Exit'
if RC = 5 then EXIT
/* scale it */
SCALE 110 100
SCALE 110 100
SCALE 110 100
SCALE 100 110
SCALE 100 110
SCALE 100 110
DISPLAY_ALERT '...and make it smaller.|Continue|Exit'
if RC = 5 then EXIT
/* scale it down */
SCALE 90 90
SCALE 90 90
SCALE 90 90
DISPLAY_ALERT 'I can move paths, too.|Continue|Exit'
if RC = 5 then EXIT
/* move it */
MOVE 5 5
MOVE 10 10
MOVE 15 15
MOVE 20 20
MOVE 25 25
MOVE '-25 0'
MOVE '-20 0'
MOVE '-15 0'
MOVE '-10 0'
MOVE '-5 0'
DISPLAY_ALERT 'Or I can make you see double.|Continue|Exit'
if RC = 5 then EXIT
/* duplicate the paths and then offset them */
COPY
PASTE
MOVE 100 100
DISPLAY_ALERT 'I will get rid of the copy.|Continue|Exit'
if RC = 5 then EXIT
DELETE
DISPLAY_ALERT 'I can even make it disappear...|Continue|Exit'
if RC = 5 then EXIT
/* cut the paths to the clipboard */
SELECT_ALL
CUT
DISPLAY_ALERT '...and make it re-appear.|Continue|Exit'
if RC = 5 then EXIT
/* paste it back */
PASTE
DISPLAY_ALERT 'Watch me change the screen order.|Continue|Exit'
if RC = 5 then EXIT
/* Move the screen to the back and then back to the front.
Use the timer for a delay using standard ARexx commands */
loop=0
do while loop<3
TO_BACK
call time('R')
kount=time('E')
do while kount<.15
kount=time('E')
end
TO_FRONT
call time('R')
kount=time('E')
do while kount<.15
kount=time('E')
end
loop=loop+1
end
DISPLAY_ALERT 'I can open a file requester to let you choose files...|Continue|Exit'
if RC = 5 then EXIT
/* open a file requester and get a file path and name */
GET_FILE 'Choose any file...|Ok|ram:|'
/* if Cancel is selected, then change the result to no file selected */
if RC = 5 then RESULT = '<no file selected!>'
DISPLAY_ALERT 'The file you chose was: 'RESULT'|Continue|Exit'
if RC = 5 then EXIT
DISPLAY_ALERT 'This is the end of the demonstration.|Continue'
DISPLAY_ALERT 'Refer to Chapter 7 for more information.|Continue'
DISPLAY_ALERT 'I will return control to you now.|Bye!'