home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Resources
/
System
/
BoingBag1
/
Contributions
/
Workbench
/
RexxArpLib3p6
/
rexx
/
ScreenTest.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-06-26
|
6KB
|
192 lines
/*
* ScreenTest.rexx
* Script for testing rexxarplib.library screen usages.
*
*/
ScreenTest:
options results
options failat 200
signal on syntax
debugging = 0 /* set if we want debug messages */
arg quick .
if (quick = '') then
do
say "All test screens are named 'MNS'. If one is left open the following command:"
say 'rx "call closescreen(''MSN'')"'
say
/*
* Get the global options that we need for various uses.
*/
editor = ""
pubscreen = ""
if editor = "" then
editor = getenv("editor")
say "getenv done"
/*
* Set up a host
*/
say
say "Setting up for a misnamed pubscreen window open. The test window should"
say "appear on the WorkBench screen."
say
pubscreen = 'NOTMNS'
/* Screen pen indices */
/* 1 = screen title text default = 1 */
/* 2 = screen title background default = 2 */
/* 3 = gadget text default = 1 */
/* 4 = highlights default = 2 */
/* 5 = shadows default = 1 */
/* 6 = active window highlight default = 3 */
/* 7 = active window text default = 1 */
/* 8 = screen background always = 0 */
/* 9 = Highlight Text Pen default = 1 */
call OpenScreen( 0, 2, 'HIRES LACE OVERSCAN', 'My new screen!', 'MNS', '121213102', 724, 482, 0 )
address arexx "'x = CreateHost(TESTSTUFF, TESTSTUFF_PORT, "pubscreen")'"
/*
* Wait until it is ready. It times out after a while, so do
* a few of them. May not be necessary, try it on your system
* for best results.
*/
WaitForPort TESTSTUFF
WaitForPort TESTSTUFF
WaitForPort TESTSTUFF
/*
* Open the window
*/
idcmp = 'CLOSEWINDOW+GADGETUP'
flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL'
call OpenWindow(TESTSTUFF, 200, 100, 240, 133, idcmp, flags, "BixParse Shell Options")
say "Window open delaying 1 sec"
call delay(50)
call AddGadget(TESTSTUFF, 10, 35, 'S', ' Post Conference Message ', 'S')
call AddGadget(TESTSTUFF, 10, 47, "RE"," Post Bug Report ", "RE")
call AddGadget(TESTSTUFF, 10, 64, "M", " Send Mail to... ", "M")
call AddGadget(TESTSTUFF, 10, 76, "E", " Edit Mail Lists ", "E")
call AddGadget(TESTSTUFF, 10, 88, "CH"," Get Charges ", "CH")
call AddGadget(TESTSTUFF, 10, 105, "RC"," Read Last Conference Msgs ", "RC")
call AddGadget(TESTSTUFF, 10, 117, "RM"," Read Last Mail Messages ", "RM")
call ActivateWindow(TESTSTUFF) /* make it the active one! */
say "Delay 4 seconds"
call delay(200)
say "Closing window"
call CloseWindow(TESTSTUFF)
say "Delaying 1 second"
call delay(50)
call CloseScreen('MNS')
end
/* Now go around for a second legal try */
say
say
say "Setting up for access to the correct screen."
say "Test window should open on the new screen."
say
pubscreen = 'MNS'
/* Screen pen indices */
/* 1 = screen title text default = 1 */
/* 2 = screen title background default = 2 */
/* 3 = gadget text default = 1 */
/* 4 = highlights default = 2 */
/* 5 = shadows default = 1 */
/* 6 = active window highlight default = 3 */
/* 7 = active window text default = 1 */
/* 8 = screen background always = 0 */
/* 9 = Highlight Text Pen default = 1 */
/* 123456789 */
call OpenScreen( 0, 2, 'HIRES LACE OVERSCAN', 'My new screen!', 'MNS', '121213101', 724, 482, 0 )
address arexx "'x = CreateHost(TESTSTUFF, TESTSTUFF_PORT, "pubscreen")'"
/*
* Wait until it is ready. It times out after a while, so do
* a few of them. May not be necessary, try it on your system
* for best results.
*/
WaitForPort TESTSTUFF
WaitForPort TESTSTUFF
WaitForPort TESTSTUFF
/*
* Open the window
*/
idcmp = 'CLOSEWINDOW+GADGETUP'
flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL'
call OpenWindow(TESTSTUFF, 200, 100, 240, 133, idcmp, flags, "BixParse Shell Options")
say "Window open delaying 1 sec"
call delay(50)
/*
* Add all the gadgets
call AddGadget(controlport, x, y, gadgetid, gadgettext, messagetext,
hsize, flags)
If hsize is specified, this call creates a string gadget of that
horizontal size and gadgettext is the default string. If hsize is
not specified, this call creates an autosizing boolean gadget, where
the text in gadgettext is displayed. In both cases, the string in
messagetext is sent to controlport (see also under OpenWindow). As
usual, the gadgettext for boolean gadgets may contain \ characters
to cause multiple lines of text (See e.g. PostMsg()). Under 2.0,
a flag can be specified for string gadgets: RIDGEBORDER. This will
cause the gadget to be displayed in the "2.0" style. Since this style
of gadget is a little different in size and location than non-ridge
border gadgets, the default is the usual gadget border under 1.3 and
a "recessed" gagdet under 2.0.
*/
call AddGadget(TESTSTUFF, 10, 35, 'S', ' Post Conference Message ', 'S')
call AddGadget(TESTSTUFF, 10, 47, "RE"," Post Bug Report ", "RE")
call AddGadget(TESTSTUFF, 10, 64, "M", " Send Mail to... ", "M")
call AddGadget(TESTSTUFF, 10, 76, "E", " Edit Mail Lists ", "E")
call AddGadget(TESTSTUFF, 10, 88, "CH"," Get Charges ", "CH")
call AddGadget(TESTSTUFF, 10, 105, "RC"," Read Last Conference Msgs ", "RC")
call AddGadget(TESTSTUFF, 10, 117, "RM"," Read Last Mail Messages ", "RM")
call ActivateWindow(TESTSTUFF) /* make it the active one! */
say "Delaying 4 seconds"
call delay(200)
say "Closing window only"
call CloseWindow(TESTSTUFF)
say "Delaying 1 second"
call delay(50)
say "Trying to open the same screen again. Should fail and leave screen."
say "If it is left behind issue the command:"
say 'rx "call closescreen(''MSN'')"'
say OpenScreen( 0, 2, 'HIRES LACE OVERSCAN', 'My new screen!', 'MNS', '011213102', 724, 482, 0 )
say rc results "FAILED: OpenScreen did not leave the old screen behind!"
exit
syntax:
say CloseScreen("MNS")
say "PASSED: Closed 'MNS' at the correct time."
exit