home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / AWNP / AWNP-Docs / AWNPipe-Docs.text < prev    next >
Encoding:
Text File  |  2001-02-02  |  183.7 KB  |  6,436 lines

  1. ==============================================================================
  2.                                 AWNPipe - Docs                                
  3. ==============================================================================
  4.  
  5. Index:
  6. ======
  7.  
  8. 1 About
  9. 2 Read First
  10. 3 Pipe Functions
  11.   3.1 Overview
  12.   3.2 Conversion
  13.   3.3 Paths
  14.   3.4 Internal
  15.   3.5 Extensions
  16.   3.6 Tutorials
  17.       3.6.1 Simple
  18.       3.6.2 Advanced
  19.       3.6.3 Tricks
  20. 4 GUI Creation
  21.   4.1 Conversation
  22.       4.1.1 Basic
  23.       4.1.2 Step by Step
  24.       4.1.3 Details
  25.   4.2 Objects
  26.       4.2.1 Window
  27.       4.2.2 Simple Gadgets
  28.             4.2.2.1 Button
  29.             4.2.2.2 Integer
  30.             4.2.2.3 String
  31.             4.2.2.4 CheckBox
  32.             4.2.2.5 Chooser
  33.             4.2.2.6 RadioButton
  34.       4.2.3 Images
  35.             4.2.3.1 Label
  36.             4.2.3.2 Glyph
  37.             4.2.3.3 DrawList
  38.             4.2.3.4 PenMap
  39.             4.2.3.5 Bitmap
  40.             4.2.3.6 Image
  41.             4.2.3.7 Space
  42.       4.2.4 Special
  43.             4.2.4.1 Layout(End)
  44.             4.2.4.2 ClickTab
  45.             4.2.4.3 TextAttr
  46.             4.2.4.4 BrowserNode
  47.             4.2.4.5 Menu
  48.             4.2.4.6 Arexx
  49.       4.2.5 Fancy
  50.             4.2.5.1 GetFile
  51.             4.2.5.2 GetFont
  52.             4.2.5.3 TextEditor
  53.             4.2.5.4 TextFeild
  54.             4.2.5.5 ListBrowser
  55.             4.2.5.6 Palette
  56.       4.2.6 More
  57.             4.2.6.1 Fuelgauge
  58.             4.2.6.2 Scroller
  59.             4.2.6.3 Slider
  60.             4.2.6.4 WeightBar
  61.             4.2.6.5 Commodity
  62.             4.2.6.6 Sound
  63.   4.3 Events
  64.   4.4 Modify
  65.   4.5 GUI Tutorial
  66.       4.5.1 Design
  67.       4.5.2 Operation
  68.       4.5.3 Modification
  69.       4.5.4 Extras
  70.       4.5.5 Advanced
  71.       4.5.6 Tips
  72. 5 Demos
  73.  
  74.  
  75. ------------------------------------------------------------------------------
  76.                                    1 About                                    
  77. ------------------------------------------------------------------------------
  78.  
  79.      AWNPipe:   Multifunction Device
  80.      Author:    William H. M. Parker
  81.      Version:   2.54  31 Jan 2001
  82.  
  83.  AWNPipe is a new kind of ADOS device. It's functions can be accessed from 
  84. almost any program including C, E, Assembler, Arexx, and simple ADOS scripts. 
  85. AWNP has many uses but the most popular is the creation of Graphical User 
  86. Interfaces. Other functions include clipboard support, tooltype access, 
  87. pattern matching, Html conversion, data stream twinning, ...
  88.  Programmers will find that GUI development is VERY fast using AWNP and 
  89. testing various layouts is as easy as editing a text file.
  90.  
  91.  Programs written using AWNP present the user with a GUI that is easy to use 
  92. and consistent in form. The ease of adding menus, Arexx hosts, help 
  93. information and images encourages authors to add more of the 'Nice' features 
  94. to their programs.
  95.  
  96. Distribution
  97.  
  98.  AWNPipe can be freely distributed in the form of this archive, complete and 
  99. unmodified.
  100.  
  101.  The operational parts (AWNPipe-handler and AWNPipe) may be included in the 
  102. distribution of programs using AWNPipe if the following three conditions are 
  103. met.
  104.  
  105. 1. The distribution contains an install script and the AWNPipe files are 
  106. handled as follows (NOTE the use of 'copylib' for awnpipe-handler).
  107.  
  108. (copylib
  109.   (source "device/awnpipe-handler")
  110.   (dest "l:")
  111.   (prompt "Installing AWNPipe-handler")
  112. )
  113. (copyfiles
  114.   (dest "Devs:dosdrivers")
  115.   (source "device/awnpipe")
  116.   (prompt "Installing AWNPipe")
  117.   (infos)
  118. )
  119. (working ("Activating AWNPipe:"))
  120. (run "C:assign AWNPipe: dismount")
  121. (run "C:mount AWNPipe:")
  122.  
  123. 2. The docs mention the use of AWNP and the version number of AWNPipe in the 
  124. distribution.
  125.  
  126. 3. The AWNPipe author is notified, bill@amitrix.com .
  127.  
  128. This software is CHILDWARE. I require whoever uses this program to make a 
  129. donation to a beneficial organization working to help children. If you don't 
  130. know of any, ask at your local post office and learn how to make a payment to 
  131. UNICEF. The amount is up to you, but please do it!
  132.  
  133. Requirements
  134.  
  135.  AWNPipe requires ADOS 3.x
  136.  You must have Class Act installed or be using ADOS 3.5+ to use the pipes GUI 
  137. building functions. Class Act can be found on Aminet, or use 
  138. http://www.amitrix.com/AWeb30ca.lha (the latter has been tested for 
  139. compatability with AWNPipe).
  140.  
  141. Support
  142.  
  143.  Support is currently available from :
  144.  
  145.  http://www.yahoogroups.com/community/awnpipe
  146.  http://web.ukonline.co.uk/awnpipe/
  147.  or directly from the AWNP Author, bill@amitrix.com.
  148.  
  149. History
  150.  
  151. o AWNPipe-handler Vers 2.53
  152.   -added hook type to string gadget.
  153.  
  154. o AWNPipe-handler Vers 2.53
  155.   -added 'target' option to 'drawme' modify command
  156.   -added 'idme' keyword to allow tracking of labels,images and space gadgets.
  157.   -added 'bounds' modify query to get object size and location.
  158.   -added 'knob' and 'maxn' to scroller modify
  159.  
  160. o AWNPipe-handler Vers 2.52
  161.   -fixed handling of &#???; in unhtml function
  162.   -added "e; and © to unhtml function
  163.   -added '/xz' option to remove html tags <...>
  164.   -added '/xp' option to get information on public screens
  165.   -worked around listbrowser hit when presetting selected nodes
  166.   -added 'xw' fast simple text wrapping
  167.   -taps now wait for both ends of the pipe to close before closing.
  168.   -added patterned backfill support to layout groups
  169.   -added screen to front/back window modify command (GID 0)
  170.   -added BD keyword to arexx host return line
  171.  
  172. o AWNPipe-handler Vers 2.51
  173.   -added fast release of images used in a button object.
  174.  
  175. o AWNPipe-handler Vers 2.50
  176.   -added sound object
  177.   -fixed '/v' to handle clips with multiple char chunks.
  178.   -fixed slider modify
  179.  
  180. o AWNPipe-handler Vers 2.49
  181.   - added label softstyle 'softstyle=' (ss=)
  182.   - added hidechild modify to listbrowser
  183.   - added hidechild modify to browser node
  184.   - removed some duplicate events from attached getfile gadgets
  185.   - fixed bitmap error response
  186.   - removed some extranious 'ok's
  187.   - maximum predefined images increased to 50
  188.   - maximum defined master bitmaps increased to 10
  189.   - maximum layout group nesting increased to 50
  190.   - replacing a listbrowser no longer gives enforcer hits
  191.   - PIPE NAMES ARE NO LONGER CASE SENSITIVE ('/' options should be lowercase)
  192.  
  193. o AWNPipe-handler Vers 2.48
  194.   - added work around for disable of clicktabs
  195.   - added the ability to disable a single tab of a clicktab
  196.   - fixed docs, disable keyword description was backwards in some places
  197.   - '/m' multiple opens now work when reading data.
  198.   - added '/m' explanation to pipe functions/tutorials/tricks
  199.   - cleaned up docs in various places.
  200.   - added plain text version of these docs
  201.   - added Amiga Guide version of these docs
  202.   - fixed bug in XO.rx demo
  203.  
  204. o AWNPipe-handler Vers 2.47
  205.   - added '/xs' (seticon)  ability to write icon tooltypes, position, type, 
  206. and defaultool
  207.   - expanded tutorial5 to cover writing tooltypes
  208.   - GUI advanced doc has been expanded
  209.  
  210. o AWNPipe-handler Vers 2.46
  211.   - trailing '/' in no longer required in drawers only getfiles.
  212.   - fixed asl getfile loss of initial title
  213.   - fixed asl getfile missing space in event
  214.   - fixed asl getfile retention of pos and neg text
  215.   - worked around for missing refresh in multiselect listbrowser
  216.  
  217. o AWNPipe-handler Vers 2.45
  218.   - expanded drawlist commands (changed some directive values as well)
  219.   - corrected Browsernode and listbrowser docs
  220.   - added refresh ability to browsernodes
  221.   - fixed multiselect listbrowser bug
  222.  
  223. o AWNPipe-handler Vers 2.44
  224.   - fixed bug ScreenTitle could be trashed when setting WindowTitle.
  225.   - binary data for GUI is no longer limited to 10000 bytes
  226.   - added '/xt' option to query icon tooltypes
  227.   - fixed bug An extra 'ok' was returned when an addnode modify line included 
  228. sc=
  229.   - expanded readme file
  230.   - tutorial 5 now checks tool types of its icon
  231.   - Advanced GUI tutorial text updated
  232.   - Added sanity check, you can't force gadget refresh while window is 
  233. iconified
  234.   - The dictionary demo is now a thesaurus as well 
  235. (docs/demos/dict-thesar.rx)
  236.  
  237. o AWNPipe-handler Vers 2.43
  238.   - fixed return from commodity modify.
  239.   - Added underscore keyword to label image
  240.  
  241. o AWNPipe-handler Vers 2.42
  242.   - Added Commodity Object, see GUI Creation/Objects/More.
  243.   - Tutorial 5 is now a commodity.
  244.   - Tutorial 5 is now an arexx host.
  245.   - updated advanced gui tutorial docs.
  246.  
  247. o AWNPipe-handler Vers 2.41
  248.   - added order modify keyword to retrieve the order of nodes in a list 
  249. browser
  250.   - the CAList demo is now called GUIList and a short doc file added
  251.   - the FontToy demo has been updated and a short doc file added
  252.  
  253. o AWNPipe-handler Vers 2.40
  254.   - fixed bug in ASL getfile title modify
  255.   - added some important text to the getfile docs.
  256.   - fixed bug, GUI Host could hang on selection of invalid browsernode
  257.   - fixed bugs ASL getfile, height parameter, filename
  258.   - added function, removenode now works with list detached
  259.   - Listbrowsers can now be sorted by two fields at once.
  260.   - added option to set positive text is ASL getfile
  261.   - added option to set negative text is ASL getfile
  262.   - No more deadlocks when a read is pending on both ends of a pipe !!!
  263.   - refined help window size and placement
  264.  
  265. o AWNPipe-handler Vers 2.39
  266.  - added '/Xea' option to generate keystrokes from a simple ANSI source.
  267.  - fixed arexx host creation (could cause enforcer hits)
  268.  - changed fonttoy demo
  269.  
  270. o AWNPipe-handler Vers 2.38
  271.  - oops 2.37 has new 'beep' modify command to flash screen(s).
  272.  - added keystroke event generator.  '/Xe'
  273.  - added keystroke filter and notification '/Xk'
  274.  - optimized A4 initialization for faster handler.
  275.  
  276. o AWNPipe-handler Vers 2.37
  277.  - added 'bufferpos' to read cursor position in string gadgets.
  278.  - fixed bug, unmatched commands to an arexx host could cause software 
  279. failure.
  280.  - fixed cut and paste tutorial text in the docs.
  281.  - expanded tutorial 5 teaching about ARexx hosts.
  282.  - added sliders to gadgets 3 demo.
  283.  
  284. o AWNPipe-handler Vers 2.36
  285.  - started real history record
  286.  - added 'askclose' to window definition to stop window close button from 
  287. actually closing the window.
  288.  - added 'bubble' modify command to open a help bubble.
  289.  - added cursor position to help events.
  290.  - added 'ASL' option to getfile to use an ASL rather than ClassAct/Reaction 
  291. based requester.
  292.  - added work around for the fact CA/Reaction GetFile and GetFont can trash 
  293. the GUI when help events are enabled.
  294.  - added tutorial 5 teaching bubble help.
  295.  - added 'weightbar' gadget..
  296.  - 'label' and 'bitmap' now return the created image size.
  297.  
  298. o AWNPipe-handler Vers 2.33 and earlier
  299.  - added 'draw' modify command to draw images manually into GUI.
  300.  - added 'refresh' events to window to allow refreshing of manually drawn 
  301. images.
  302.  - added 'mouse' modify command to read mouse position.
  303.  - added 'slider' gadget type.
  304.  - added REAL menu bars.
  305.  - made menu mutilselect.
  306.  - extended appwindow support to allow dropping of a group of icons.
  307.  - added some 'C' based tutorials, anyone using awnp from 'C' please contact 
  308. the AWNP author.
  309.  - added unit number option to '/v' and '/c' reading and writing the 
  310. clipboard.
  311.  - fixed bug in modification of scroller gadgets.
  312.  - added a bunch of new modify commands for list browsers.
  313.  - added command to read the  contents aof a list node.
  314.  - added 'TextEditor' gadget type.
  315.  
  316. Origin
  317.  
  318.  AWNPipe was originally developed as a way to speed up the execution of my 
  319. ARexx script AWebNews.awebrx. As I continued writing scripts I added more and 
  320. more functions to the pipe. Some of the functions have proven useful to 
  321. others writing Amiga prpgrams. I built these docs in the hope that AWNPipe: 
  322. will be of use to Amiga programmers in general.
  323.  
  324. Acknowledgements
  325.  
  326.  I would like to thank Gabriele Favrin (author of HTTX) for his input, 
  327. testing and constant encouragement while writing AWNPipe.
  328.  
  329.  I also thank...
  330.  
  331.  Bruce Steers for maintaining the AWNP support page and finding many subtle 
  332. bugs.
  333.  
  334.  Nils Goers for his testing under ADOS 3.5 and developing his wonderful 
  335. program T.H.E. using AWNP, as well as his bug reports.
  336.  
  337.  Bernd Gollesch for writing the script that creates the Amiga Guide and plain
  338. text versions of the docs automagicaly.
  339.  
  340.  Everyone else who provided bug reports or feed back helping me make AWNP 
  341. better.
  342.  
  343. Bill
  344.  
  345. ------------------------------------------------------------------------------
  346.                                  2 Read First                                 
  347. ------------------------------------------------------------------------------
  348.  
  349.  AWNPipe itself is stable and quite well tested. These docs are still a work 
  350. in progress so please excuse typos and omissions.
  351.  
  352.  At first glance AWNPipe may appear complex. Actually each of the functions 
  353. in the pipe are simple to use when taken individually. Don't try to learn 
  354. everything at once, pick a single function and try it out. Each function can 
  355. be used without knowing anything about the other functions.
  356.  
  357.  Most of you will be primarily interested in building and operating GUI's. 
  358. You can go directly to the GUI Creation section and start there. The 
  359. important part to read about is the conversation, then try the tutorials in 
  360. that section.
  361.  
  362.  To learn about pipe functions go straight to Pipe Functions/Tutorials/Simple 
  363. and work through the examples.
  364.  
  365.  Right Amiga C can be used to cut and paste example text from the docs. This 
  366. helps to avoid typos.
  367.  
  368. Feel free to contact me, <bill@amitrix.com>, with your questions and 
  369. comments.
  370.  
  371.  Have Fun !
  372.  
  373. ------------------------------------------------------------------------------
  374.                                3 Pipe Functions                               
  375. ------------------------------------------------------------------------------
  376.  
  377.  
  378. ------------------------------------------------------------------------------
  379.                                  3.1 Overview                                 
  380. ------------------------------------------------------------------------------
  381.  
  382.  The pipe function sections are NOT required reading to learn how to build 
  383. GUI's.
  384.  
  385.  Using AWNPipe
  386.  -------------
  387.  
  388. All of AWNPipes functions are accessed through a pipe like interface as the 
  389. name implies. Pipes are accessed like any other type of file using open, 
  390. close, read, and write. From Amiga DOS a pipe can be used almost any place 
  391. you would normally use a file name.
  392.  
  393. The name of each pipe starts with the device name 'awnpipe:'. This is 
  394. followed by a unique name that is used to identify the pipe. The name MAY 
  395. also be followed by a '/' and some option information to give the pipe 
  396. special abilities. 'awnpipe:myfile' and 'awnpipe:test' are examples of pipe 
  397. names.
  398.  
  399. The options after the '/' usually cause the data to be altered as it passes 
  400. into the pipe. Then data you read out from the pipe will be different than 
  401. the data you wrote into it. The '/h' function works this way, any '&' written 
  402. into the pipe will be read back as '&'.
  403.  
  404. Some other options connect the pipe to special hosts like the clipboard. Data 
  405. written to a pipe ending in '/c0' goes into the clipboard unit 0. The data 
  406. read from a pipe ending in '/v0' will be the contents of clipboard unit 0.
  407.  
  408. Here is a simple example showing data going in and out of a pipe.
  409.  
  410. echo "hello World" > AWNPipe:test
  411. type AWNPipe:test
  412.  
  413.  
  414. This following information is intended as a reference for people already 
  415. familiar with AWNP. To learn how to use pipe functions work through the 
  416. tutorials.
  417.  
  418.  Pipe Types
  419.  ----------
  420.  
  421. /i immediate   /u unHTML        /e execute    /l link
  422. /r read        /p Postaweb      /o <option>   /v[unit#] readclip
  423. /w write       /! do not wait   /b backwards  /c[unit#] writeclip
  424. /h HTML        /t tap           /f force      /s status
  425. /g HTML2       /a abort         /-vers# minimum version
  426. /@ seek enable /m Multiple Opens   /1 open first end
  427.  
  428. /x[option] extra function
  429.       /xc open interactive Class Act pipe
  430.       /xcr[filename] open interactive Class Act pipe, reading the window and 
  431. gadget definitions from a separate file.
  432.       /xcw[filename] open interactive Class Act window, writing the events to 
  433. a separate file.(also sets immediate and force)
  434.       /xm[c]    string pattern match c=case sensitive
  435.       /xm[c]w    string pattern match c=case sensitive results to separate 
  436. file
  437.       /xm[c]r    string pattern match c=case sensitive reading data from 
  438. separate file. (also sets immediate and force)
  439.       /x0 programmable replace loopback
  440.       /x0r[filename] programmable replace from file
  441.       /x0w[filename] programmable replace to file
  442.       /xk remove keystrokes from input event stream and notify
  443.       /xe write keystrokes to the input event stream from code & qual
  444.       /xea write keystrokes to the input event stream from ANSI source
  445.       /xt[filename] query icon tooltypes
  446.       /xi[filename] read tooltype information for a file.
  447.       /xs[filename] set tooltype information for a file.
  448.       /xz remove html tags <...>  loopback
  449.       /xzr[filename] remove html tags <...> from file
  450.       /xzw[filename] remove html tags <...> to file
  451.       /xp get public screen names  loopback
  452.       /xpw[filename] get public screen names to file
  453.       /xw[length] text wrap loopback
  454.       /xw[length]r[filename] text wrap from file
  455.       /xw[length]w[filename] text wrap to file
  456.  
  457. Details about AWNPipe
  458. ---------------------
  459.  
  460. AWNPipe:test/h AWNPipe:TEST AWNPipe:test/h/f/rhelpme are all the same file. 
  461. The unique name is NOT case sensitive, and terminates on the first '/' or the 
  462. end of the name if no '/' is found. '%' may be substituted for  '/' . Options 
  463. after the '/' should be given in lower case.
  464.  
  465. A pipe name is usually only opened twice. After that calls to open will fail. 
  466. After both ends of the pipe are closed the pipe name can  be used again. A 
  467. pipe can immediately be written after it is opened, even if the other end has 
  468. not yet been opened. Some special options can override this behavior.
  469.  
  470. Some types of pipes are only opened ONCE. The second end of these pipes are 
  471. automatically connected to something by the AWNPipe internal code. Clipboard 
  472. access is an example of this type of pipe.
  473.  
  474. All file handles can both read or write data. A check is made to see if pipes 
  475. dead lock from pending reads on both ends. If this happens both of the 
  476. pending reads are aborted to break the deadlock.
  477.  
  478. Data flow is never stopped by buffering.
  479.  
  480. If data is written into a pipe and the second end never opened, the pipe 
  481. stores all written data.... forever  (until you reboot).
  482.  
  483.  
  484.  
  485. ------------------------------------------------------------------------------
  486.                                 3.2 Conversion                                
  487. ------------------------------------------------------------------------------
  488.  
  489. Data Conversion
  490. ----------------
  491.  
  492. The data passing through the pipe may be modified by the pipe with the 
  493. following options.
  494.  
  495. H option
  496. ========
  497.  
  498. html conversion - some special characters are translated into html tokens.
  499. & > <  become & < >
  500. This option must be specified on the file handle that is written.
  501.  
  502. copy ram:test AWNPipe:test/h
  503. copy AWNPipe:test ram:test2
  504.  
  505.  
  506. G option
  507. ========
  508.  
  509. The same as the H option above, except that any special html character 
  510. preceded by an '@' is not converted. The preceding '@' is removed during the 
  511. translation process.
  512.  
  513. U option
  514. ========
  515.  
  516. UNhtml conversion - some html tokens are translated into special character.
  517. & < > become & > <
  518. Tokens of the form &#NUM; are also translated.
  519. This option must be specified on the file handle that is written to..
  520.  
  521. copy ram:test AWNPipe:test/u
  522. copy AWNPipe:test ram:test2
  523.  
  524. P option
  525. ========
  526.  
  527. AWebPost conversion - some special characters are translated into standard 
  528. ascii. This must be specified on the file handle that does the writing.
  529.  
  530. copy ram:test AWNPipe:test/p
  531. copy AWNPipe:test ram:test2
  532.  
  533. B option
  534. ========
  535.  
  536. backwards blocks - characters read from a pipe are returned in reverse order
  537. of the character blocks written. This must be specified on the
  538. file handle that does the reading.
  539.  
  540. if you write 5 blocks of characters .....
  541.  
  542. 'hello'
  543. 'world'
  544. '1'
  545. '2'
  546. '3'
  547.  
  548. they are read back as
  549.  
  550. 321worldhello
  551.  
  552. Funny things can happen if you read before all writes are completed.
  553.  
  554. O option
  555. ========
  556.  
  557.  Adds the text '<option>' after every '0a'x . I use it in AWebNews.
  558.  
  559. copy ram:test AWNPipe:test/o
  560. copy AWNPipe:test ram:test2
  561.  
  562.  
  563. ------------------------------------------------------------------------------
  564.                                   3.3 Paths                                   
  565. ------------------------------------------------------------------------------
  566.  
  567. Controlling data paths.
  568. -----------------------
  569.  
  570. T option
  571. ========
  572.  
  573. TEE's or data taps. A tap is a extra read handle on a pipe connection. If the 
  574. pipe is not yet created the tap will wait for it to be created. A tap does 
  575. not see any data written to the pipe before the tap was created. Taps are 
  576. useful to listen in on interactive (2way) pipes as they read the data written 
  577. to both ends of the pipe.
  578.  
  579. Try this is 3 separate shells.
  580.  
  581. type AWNPipe:test/t
  582. type AWNPipe:test
  583. echo > AWNPipe:test "test data"
  584.  
  585.  
  586. R option
  587. ========
  588.  
  589. Read a file. The second end of a pipe can be connected to file automatically. 
  590. The file name is given after the 'R'.
  591.  
  592. Create a file 'ram:test' containing some text including the characters '<>&'.
  593. Now try this in a shell.
  594.  
  595. type AWNPipe:test/h/rram:test
  596.  
  597. The data from ram:test is read through a modifying pipe.
  598.  
  599. W option
  600. ========
  601.  
  602. Write a file. The second end of a pipe can be connected to file 
  603. automatically. The file name is given after the 'W'.
  604.  
  605. Create a file 'ram:test' containing some text including the characters '<>&'.
  606. Now try this in a shell.
  607.  
  608. copy ram:test AWNPipe:test/h/wram:test2
  609.  
  610. The data from ram:test is copied into a modifying pipe, the pipe 
  611. automatically
  612. outputs the data into a second file ram:test2 .
  613.  
  614. L option
  615. ========
  616.  
  617. Read AND write to an interactive file such as con: . The interactive file 
  618. name is given after the 'L'.
  619.  
  620. This is useful to be able to 'tap' into a two way conversation at a con: or 
  621. other interactive file handle. Instead of opening con: directly, open
  622. AWNPipe:test/Lcon:////mycon/
  623. Now you can open AWNPipe:test/t to tap the data exchanged with the con:.
  624.  
  625. V option
  626. ========
  627.  
  628. This option opens a pipe directly to the clipboard.
  629.  
  630. type AWNPipe:test/v
  631.  
  632. You may also specify a clipboard unit, defaults to 0 (the primary clip).
  633.  
  634. To access clipboard unit 5
  635.  
  636. type AWNPipe:test/v5
  637.  
  638.  
  639. C option
  640.  ========
  641.  
  642. This option allows you to set the clipboard
  643.  
  644. echo "set this as the clip" >AWNPipe:test/c
  645.  
  646. You may also specify a clipboard unit, defaults to 0 (the primary clip)
  647.  
  648. To set clipboard unit 5
  649.  
  650. echo "set this as the clip" >AWNPipe:test/c5
  651.  
  652. E option
  653. ========
  654.  
  655. execute a command . The file name is given after the 'E'. A command is 
  656. executed  with the pipe name as an argument. The pipe name replaces a '%' or 
  657. is placed at the end. You CAN NOT use a '/' instead of a '%' !.
  658.  
  659. copy ram:test.doc AWNPipe:test/h/eaweb3:aweb-II
  660.  
  661. copy ram:test.doc "AWNPipe:test/h/eaweb3:aweb-II % config
  662. local"
  663.  
  664. Both of these load a file ram:test into AWeb through a modifying pipe and 
  665. call AWeb to view it .
  666.  
  667. Into a file requester such as AWebs save requester...
  668. 'awnpipe:jpeg/eUtil:fjpeg_ecs'
  669. will send the data directly to the viewer.
  670.  
  671.  
  672.  
  673. ------------------------------------------------------------------------------
  674.                                  3.4 Internal                                 
  675. ------------------------------------------------------------------------------
  676.  
  677. Internal controls.
  678. -----------------
  679.  
  680. These options control some of the behaviours of AWNP regarding opening pipes 
  681. and reading data.
  682.  
  683. - option
  684. ========
  685.  
  686.  Specify a minimum version of AWNPipe you need. The format is /-VVRRR where V 
  687. is the version and R is the revision.
  688.  Opening AWNPipe:name/-02009 will fail to open unless AWNPipe is version 2.9 
  689. or newer.
  690.  
  691. A option
  692. ========
  693.  
  694.  Abort pending reads.  If you try to open a pipe using the '/a' option any 
  695. pending reads are aborted.  This USUALLY causes the pipe to shut so you can 
  696. reuse the pipename. It is seldom if ever needed now since AWNP catches most 
  697. problems and shuts down 'hung' pipes automatically. The open itself ALWAYS 
  698. fails, this is intended.
  699.  
  700. M option
  701. ========
  702.  
  703.  Multiple opens. When a pipe is opened with this option it behaves normally. 
  704. However when this file handle is closed that end of the pipe becomes 
  705. available to be opened again. If you open the pipe name again with the  '/1' 
  706. (open first end)  flag is set the open call only tries to open the first side 
  707. of the pipe (the end that was opened when the pipe was created). If the 
  708. donotwait flag is set the open call only tries to open the second side of the 
  709. pipe (the end that was NOT opened first). When neither flag is set you get 
  710. the first end of the pipe if available, else you get the second end.
  711.  
  712. I option
  713. ========
  714.  
  715.  Immediate reads. Reads to the file handle will return if there is any data 
  716. waiting to be read. If you try to read 10 characters from the pipe and only 5 
  717. are available, the read returns with the five characters immediately (rather 
  718. than waiting for 5 more characters to be available). Therefore only a read of 
  719. 0 length means end of file. This is useful with data originating  
  720. interactively from con: or ser: .
  721.  
  722. F option
  723. ========
  724.  
  725.  Force a pipe to be created. A new pipe is created even if the pipe name is 
  726. already is use. The open will not fail, and it will not connect to any 
  727. currently existing pipe end. After both ends of the forced pipe are opened 
  728. any previous partial ( only opened once) pipe of that name becomes available 
  729. again. (ONLY FORCE THE FIRST END OF THE PIPE)
  730.  
  731. ! or ~ option.
  732. ==============
  733.  
  734.  Do not wait. The open will fail unless the other end of the pipe is already 
  735. open. A new pipe will not ever be created. Used on a tap it stops the tap 
  736. from waiting for a matching pipe to be created.
  737.  
  738. @ option
  739. ==============
  740.  
  741.  Respond to seek packets. Normally seek is not supported by AWNPipe. If see 
  742. is turned on, the current position is reported as '0' if no data is available 
  743. on the pipe, '1' if data is waiting to be read.
  744.  
  745.  NOTE Do not use this function from ARexx as ARexx has a read ahead buffer
  746. that is flushed when you call seek. This can cause you to loose data. It may
  747. also happen in other languages if read data is buffered.
  748.  
  749. S or s option
  750. ==============
  751.  
  752. Status of a pipe. This MUST always be a tap as well. Read only returns a 
  753. single byte. This is the status of the real pipe the tap refers to. The 
  754. bits/nibbles or byte meanings are as follows.
  755.  
  756. 'FF' indicates  file handle does not exist. (you can check just the high bit)
  757.  
  758. low nibble = First end that is opened.
  759. high nibble =second end opened.
  760.  
  761. in each nibble
  762.  
  763. bit 4 always zero when FH exists
  764. bit 3 FH opened.  (nibble&4)
  765. bit 2 FH closed.  (nibble&2)
  766. bit 1 FH data available.  (nibble&1)  sub for WaitForChar in AREXX.
  767.  
  768. Note 'FF' indicates no file handle active.
  769.  
  770.  
  771.  
  772. ------------------------------------------------------------------------------
  773.                                 3.5 Extensions                                
  774. ------------------------------------------------------------------------------
  775.  
  776. X or x option
  777. ==============
  778.  
  779. These options let you open a pipe whose second end is connected to various
  780. special hosts. (you only open these pipes once)
  781.  
  782. The X option is always followed by additional character(s). The second 
  783. character determines what type of pipe is opened.
  784.  
  785. Xw[length][(r|w)filename]  (simple text wrap)
  786. ---------------------------------------------
  787.  
  788.  This pipe wraps text at 'length' characters. It DOES NOT rewrap (lines
  789. shorter than length chars are not joined into longer lines. Length defaults
  790. to 80 if it is not specified.
  791.  
  792.  When using this function in loopback mode each 'chunk' of text to be wrapped 
  793. MUST end in a linefeed. This allows the same pipe to be used to wrap several 
  794. seperate 'chunks' of text. (loopback mode is when you do not use 
  795. [(r|w)filename])
  796.  
  797. X0[(r|w)filename]  (Programmable replacement)
  798. ---------------------------------------------
  799.  
  800.  Programmable replacement of a character. A single character is looked for in 
  801. data written to the pipe and replaced by a multy character string.
  802.  
  803.  First write two bytes to the pipe. the first byte is always '1' the second 
  804. byte is the target character to be replaced. Then write a byte giving the 
  805. length of the replacement string (<=255) followed by the replacement string. 
  806. Do NOT include a terminating null .
  807.  
  808.  Data written to the pipe after this point is echoed back to the pipe with 
  809. any occurrences of the target character replaced by the specified string.
  810.  
  811.  X0wfilename causes the data to be echoed to a file rather than back to the 
  812. pipe.
  813.  
  814.  X0rfilename causes the data to be read from a file rather than from the 
  815. pipe. Note that the target character and replacement string is still read 
  816. from the pipe not the external file. Only data to be parsed and replaced is 
  817. read from the file.
  818.  
  819. Xz[mode][(r|w)filename] (process html)
  820. -----------------------------------------------------
  821.  
  822.  The function used depends on 'mode'. Mode is a bitmaped decimal.
  823.  
  824. bit 1 (1)- Remove all characters between '<' '>' including the '<' and '>'. 
  825. Condence
  826. bit 2 (2)- condence multiple spaces to a single space
  827. bit 3 (4)- do not condence at the start of a line.
  828. bit 4 (8)- replace '0a' characters with spaces
  829. bit 5 (16)- replace '0d' characters with spaces
  830. bit 6 (32)- replace tab characters with spaces
  831. bit 7 (64)- replace <br> and <p> with newline characters
  832. bit 8 (128)- format tables with newlines <td> <th> <table> <tr>
  833. bit 9 (256)- format lists with newlines <li> <ul> <ol>
  834.  
  835.  The rest of the characters pass unaltered. Sum the numbers in brakets to 
  836. select 'mode'. Mode defaults to 511 (all on).
  837.  
  838.  EXAMPLE: Writing '1<2>3' to the pipe returns '13'.
  839.  
  840.  Xzwfilename causes the data to be echoed to a file rather than back to the 
  841. pipe.
  842.  
  843.  Xzrfilename causes the data to be read from a file rather than from the 
  844. pipe. Note that the target character and replacement string is still read 
  845. from the pipe not the external file. Only data to be parsed and replaced is 
  846. read from the file.
  847.  
  848. Xp[(w)filename]  (get public screen information)
  849. ------------------------------------------------
  850.  
  851.  This pipe is only read, never written to.
  852.  
  853.  This pipe returns the name of the front public screen on the first line.
  854.  The default public screen name on the second line.
  855.  Then information on ALL public screens follows, two lines each screen. The 
  856. first line has the screen name, the second the following information 'Top 
  857. Left Height Width Flags ScreenMode'
  858.  All values are given in hexidecimal.
  859.  
  860.  Example: 'type awnpipe:/xp'
  861.  
  862. DM.1                          (front screen)
  863. Workbench                     (default screen)
  864. Workbench                     (1st screens name)
  865. 0 0 320 4B0 4651 4002         (1st screens info)
  866. AWeb                          (2nd screens name)
  867. 0 0 320 258 4652 6002         (2nd screens info)
  868. DM.1                          (3rd screens name)
  869. 0 0 320 258 4652 6002         (3rd screens info)
  870. DM.2                          (4th screens name)
  871. 0 0 320 258 4652 6002         (4th screens info)
  872. TURBOTEXT                     (5th screens name)
  873. 0 FFFFFF14 2CA 1D8 6212 F004  (5th screens info)
  874.  
  875.  Xpwfilename causes the data to be echoed to a file rather than back to the 
  876. pipe.
  877.  
  878. ICON HANLDING
  879. ========================
  880.  
  881. Xt[filename]   (find Tooltypes)
  882. -------------------------------
  883.  
  884.  This host is the best suited to quickly check for tooltypes and get there 
  885. values.
  886.  
  887.  The icon file for the specified file (you do NOT add '.icon') is queried.
  888.  
  889.  Open the file awnpipe:myname/Xt[filename]. Write a line containing the 
  890. tooltype you wish to query to the pipe. Read back a response line.
  891.  
  892.  If no icon file is found an eof is returned.
  893.  
  894.  If the tooltype is NOT found you will read back a null line (only a <cr>).
  895.  
  896.  If the tool type IS found you will read back 'ok ' followed by the tooltypes 
  897. value (if it has one).
  898.  
  899. Xi[filename]   (Icon information)
  900. ---------------------------------
  901.  
  902.  This host will retrieve fuller details about tooltypes and some other icon 
  903. information. It is often used in combination with the following host.
  904.  
  905.  The icon file for the specified file (you do NOT add '.icon') is read. The 
  906. pipe returns the following lines...
  907.  
  908. icon_type x y stack
  909. default tool
  910. tool window
  911. first tooltype
  912. second tooltype
  913. ...
  914.  
  915. If no icon file is found  no data is returned. Note that for blank lines will 
  916. be returned when the information does not apply to that icon type.
  917.  
  918. example: awnpipe:/xidevs:dosdrivers/awnpipe  returns
  919.  
  920. 4 3 139 4096
  921. C:Mount
  922.  
  923. ACTIVATE=0
  924.  
  925. To get information on a volume (say dh1:) use 'awnpipe:/xidh1:disk'.
  926.  
  927. Xs[filename]  (Set icon information)
  928. ------------------------------------
  929.  
  930.  This host will alter or create the icon and tooltypes for the specified 
  931. file.
  932. Data is written to the host in the same format as returned by the preceding
  933. host.
  934.  
  935. icon_type x y stack
  936. default tool
  937. tool window
  938. first tooltype
  939. second tooltype
  940. third ...
  941.  
  942. Icon_type, x, y, and stack are all integer values written on a single line.
  943.  
  944. Default tool and the tooltypes are ascii strings.
  945.  
  946. Tool window is ignored but MUST still be included, either use a blank line 
  947. ('0A'x) or used the data returned by the Xi host.
  948.  
  949. The first three lines are always required. You may set as many tooltypes as 
  950. you like including none.
  951.  
  952. some useful information:
  953.  
  954. setting x and y to -2147483648 unsnapshots the icon.
  955. icon_type 1=disk 2=drawer 3=tool 4=project 5=trashcan
  956.  
  957. Xm[c][(r|w)filename]  (pattern Matching)
  958. ----------------------------------------
  959.  
  960.  Pattern match Conversation. This conversation supports full ADOS pattern 
  961. matching. The trailing 'c' will make the match case sensitive.
  962.  
  963.  Xmwfilename causes the match result to be sent to a file rather than back to 
  964. the pipe.
  965.  
  966.  Xmrfilename causes the data to be read from a file rather than from the 
  967. pipe. The match results are read back from the pipe.
  968.  
  969. NOTE: the replies are ascii terminated with a newline.
  970.  
  971. Write the pattern to the pipe terminated with a newline. (<500 chars) The 
  972. pipe returns 'ok 1' when you sent a valid pattern to match to. It returns 'ok 
  973. 0' if you did not send a pattern ( the pipe will look only
  974. for exact matches).
  975.  
  976. write a string to the pipe terminated with a newline.(<500 chars) read the 
  977. reply  '0' (no match) '1' (is a match)
  978.  
  979. write as many stings as you like . Close pipe to end. The terminating 
  980. newlines are ignored while matching.
  981.  
  982. KEYSTROKE HANDLING
  983. ==================
  984.  
  985. Xk      (Keystroke filter)
  986. --------------------------
  987.  
  988.  Filter keystrokes from the input device event stream and receive 
  989. notifications of the keystroke.
  990.  
  991.  First write a byte to the pipe setting the priority of the key parse 
  992. handler. It is a signed byte -128 to 127. If you are not sure what you want 
  993. use 51 (0x33).
  994.  
  995.  Next  write a byte to the pipe indicating how many keystrokes to filter. The 
  996. maximum is 255 (0x'ff'). 0 is NOT valid.
  997.  
  998. 0x'0a' is 10 keys.
  999.  
  1000.  Then write two bytes to the pipe indicating how often a null match should be 
  1001. sent (to stop your task waiting forever for a match that never happens).
  1002.  
  1003.  0x'0032' is 50/100s of a second.
  1004.  
  1005.  Now write 4 bytes defining each key you wish to be notified of.  The first 
  1006. two bytes are the key the second two bytes are the qualifier.
  1007.  
  1008.  Writing 0x'00200001' to the pipe sets the 'a' key 'leftshifted' to be 
  1009. filtered from the event stream.
  1010.  
  1011.  You MUST set exactly the same amount of keys as specified above.
  1012.  
  1013.  Once the setup is complete you read notification from the pipe. Each 
  1014. notification is 1 byte giving a match number, the first keystroke you 
  1015. specified is 1, the second 2 ...
  1016.  
  1017.  A byte of 0 is a null event, no match occurred.
  1018.  
  1019.  Close the pipe to end key filtering. NOTE the keyparse handler actually does 
  1020. not get removed until the NEXT match or null event.
  1021.  
  1022. Xe   (key Event generator)
  1023. --------------------------
  1024.  
  1025.  Write keystrokes to the input device event stream.
  1026.  
  1027.  Each keystroke is sent by writing 4 bytes to this pipe. The first two bytes 
  1028. are the key the second two bytes are the qualifier.
  1029.  
  1030.  Writing 0x'00200001' to the pipe sends the 'a' key 'leftshifted'.
  1031.  
  1032.  You may close the pipe at any time.
  1033.  
  1034. Xea   (key events form Ascii)
  1035. -----------------------------
  1036.  
  1037.  Write keystrokes to the input device event stream from a string source.
  1038.  
  1039.  Each keystroke is sent by writing a byte to this pipe. You do NOT need to 
  1040. write one character at a time. Simply write ascii text to the pipe and it 
  1041. will generate keystrokes as if the string had been typed at the keyboard.
  1042.  
  1043.  This is easier than writing keycodes and qualifiers to the pipe but you can 
  1044. not generate 'special keystrokes' like Alt-F10 .
  1045.  
  1046.  You may close the pipe at any time.
  1047.  
  1048. Xc[(r|w)filename]    (ClassAct/Reaction host)
  1049. ---------------------------------------------
  1050.  
  1051.  ClassAct Window Conversation. The Window and gadgets are defined by writing 
  1052. to the pipe:. Gadget hits and error/confirmation information is read from the 
  1053. pipe. A filename may also be given. If the file is specified as write 'w' the 
  1054. output of the pipe is directed to that file. If the file is specified as read 
  1055. 'r' the window and gadget definitions are read from the file.
  1056.  
  1057.  See the GUI Creation section of the docs for details.
  1058.  
  1059. ------------------------------------------------------------------------------
  1060.                                 3.6 Tutorials                                 
  1061. ------------------------------------------------------------------------------
  1062.  
  1063.  
  1064. ------------------------------------------------------------------------------
  1065.                                  3.6.1 Simple                                 
  1066. ------------------------------------------------------------------------------
  1067.  
  1068. HINT: Drag select the text then use right Amiga C to copy the examples out of 
  1069. these docs. This helps avoid typos.
  1070. ---
  1071.  
  1072. The simplest use of awnpipe is as an ordinary pipe. That means put data into 
  1073. one end of a pipe and read it out the other.
  1074.  
  1075. In a shell type 'echo >awnpipe:mypipe hello'
  1076. Now type 'type awnpipe:mypipe'
  1077.  
  1078. The word hello went into the pipe from the echo command, and came out with 
  1079. the type command.
  1080.  
  1081. 'mypipe' was the name of the pipe. More than one pipe can exist at the same 
  1082. time.
  1083.  
  1084. In a shell type 'echo >awnpipe:mypipe1 hello'
  1085. In a shell type 'echo >awnpipe:mypipe2 goodbye'
  1086. In a shell type 'type awnpipe:mypipe1'
  1087. In a shell type 'type awnpipe:mypipe2'
  1088.  
  1089. Two pipes each with a different name.
  1090.  
  1091. ---
  1092.  
  1093. Make sure you have two different shells available.
  1094.  
  1095. In the first shell type 'type awnpipe:mypipe'
  1096. In the second shell type 'echo >awnpipe:mypipe hello'
  1097.  
  1098. You opened the read end of the pipe first. The type command waited until data 
  1099. was available from the pipe THEN returned.
  1100.  
  1101. A word of caution. Don't try to read from both ends of the pipe at the same 
  1102. time. If you 'type awnpipe:mypipe1' in two separate shells both will hang 
  1103. waiting for data to come from the pipe. AWNPipe notices this and cancels both 
  1104. reads to break the deadlock, this causes both type commands to end without 
  1105. typing any data.
  1106.  
  1107. ---
  1108.  
  1109. To use AWNPipe for other functions you add '/' followed by some parameters to 
  1110. the pipe name.'/h' will cause the pipe to translate a few special characters 
  1111. to there HTML equivalents. Note that the '/h' is only used when writing to 
  1112. the pipe.
  1113.  
  1114. In a shell type 'echo >awnpipe:mypipe/h "& > <"'
  1115. In a shell type 'type awnpipe:mypipe'
  1116.  
  1117. The data is modified as it pass through the pipe.
  1118.  
  1119. See the advanced examples for more types of data conversion.
  1120.  
  1121. ---
  1122. It is possible to have a pipe automatically connect it self to a file. In 
  1123. these cases you only open the pipe on one end, the other end is automatically 
  1124. connected to a file.
  1125.  
  1126. '/rFILENAME' reads the contents of FILENAME and places it in the pipe.
  1127.  
  1128. Create a file 'ram:test' containing some text including the characters '<>&'.
  1129.  
  1130. Now try this in a shell.
  1131.  
  1132. type AWNPipe:test/h/rram:test
  1133.  
  1134. (YES there are two colons ':' in the pipename. Strange but don't let it bug 
  1135. you.)
  1136.  
  1137. The data from ram:test is read through a modifying pipe.
  1138.  
  1139. ---
  1140.  
  1141. '/wFILENAME' writes the output of the pipe to FILENAME.
  1142.  
  1143. In a shell type 'echo >awnpipe:mypipe/h/wram:AWNPtest "& > <"'
  1144.  
  1145. Take a look at the file ram:AWNPtest (with your favorite text editor).
  1146.  
  1147. ---
  1148.  
  1149. '/u' reverses the translation done by '/h' and '/rFILENAME' reads data into a
  1150. pipe.
  1151.  
  1152. In a shell type 'type awnpipe:mypipe/u/rram:AWNPtest'
  1153.  
  1154. The contents of the file are read and translated.
  1155.  
  1156. ---
  1157.  
  1158. It is possible to have a pipe automatically connect it self to the clipboard.
  1159.  
  1160. In a shell type 'echo >awnpipe:mypipe/c hello'
  1161.  
  1162. The word hello was placed into the clipboard. Use your text editor to check 
  1163. it out. Then put different text into the clipboard using your text editor.
  1164.  
  1165. In a shell type 'type awnpipe:mypipe/v'
  1166.  
  1167.  The contents of the clipboard are typed out.
  1168.  
  1169.  
  1170. ------------------------------------------------------------------------------
  1171.                                 3.6.2 Advanced                                
  1172. ------------------------------------------------------------------------------
  1173.  
  1174. You should read the simple examples before trying these more advanced ones.
  1175.  
  1176. HINT: use right Amiga C the drag then clip the examples out of these docs to 
  1177. avoid typos.
  1178.  
  1179.  
  1180. ---
  1181.  
  1182. It is possible to tap into or duplicate the data passed in a pipe. '/t' will 
  1183. add a readonly third end to a pipe.
  1184.  
  1185. Make sure you have two different shells available.
  1186.  
  1187. In the first shell type 'type awnpipe:mypipe/t'
  1188.  
  1189. In the second shell type 'echo >awnpipe:mypipe hello'
  1190. In the second shell type 'type awnpipe:mypipe '
  1191.  
  1192.  The word hello came back from both the second end of the pipe and the 'Tap' 
  1193. third end.
  1194.  
  1195. ---
  1196.  
  1197. In the first shell type 'copy con:////pipe-test/close awnpipe:mypipe'
  1198. In the second shell type 'type awnpipe:mypipe '
  1199.  
  1200. Type a few lines of text into the test con:, nothing comes out in the second 
  1201. shell. Close the test con:, now the data comes out. This is because the type 
  1202. command wants to read large blocks of data.
  1203.  
  1204. '/i' will cause data to pass out of the pipe immediately (as soon as its 
  1205. available).
  1206.  
  1207. In the first shell type 'copy con:////pipe-test/close awnpipe:mypipe'
  1208. In the second shell type 'type awnpipe:mypipe/i '
  1209.  
  1210. Now the text comes out of the pipe each time you hit return in the test con:.
  1211. Close the test con: to end the example.
  1212.  
  1213. ---
  1214.  
  1215. You can use AWNPipe to read the tooltypes of an icon. The second end of the 
  1216. pipe automatically reads the tooltypes of FILENAME when '/xiFILENAME' is 
  1217. used. NOTE that parameters that start with '/x' can not be mixed with other 
  1218. parameters!
  1219.  
  1220. In a shell type 'type awnpipe:mypipe/xiDevs:dosdrivers/awnpipe'
  1221.  
  1222. YES the pipe name contains two colons ':', don't let it bug you.
  1223.  
  1224. The tooltype information from Devs:dosdrivers/awnpipe prints out. Note you do 
  1225. not include '.info' in the file name.
  1226.  
  1227. The data is typed out in the following format..
  1228.  
  1229. icon_type x y stack
  1230. default tool
  1231. tool window
  1232. first tooltype
  1233. second tooltype
  1234. ...
  1235.  
  1236. If you get some weird number (-2147483648) for the X and Y values it means 
  1237. you did not snapshot the icon yet.
  1238.  
  1239. ---
  1240.  
  1241. You can also use AWNPipe to write the tooltypes of an icon.
  1242.  
  1243. Copy a file with its icon into ram:., preferably an icon that has some 
  1244. tooltypes set in it.
  1245.  
  1246. In a shell 'copy awnpipe:/xiRam:filename ram:icondump' , do not include 
  1247. '.info' in the filename.
  1248.  
  1249. Now examine and edit the file ram:icondump change the default tool and 
  1250. tooltypes.
  1251.  
  1252. In a shell 'copy ram:icondump awnpipe:/xsRam:filename '.
  1253.  
  1254. Use the WB menu info function to verify the new setting in the icon.
  1255.  
  1256. ---
  1257.  
  1258.  AWNPipe can be used to pattern match. '/xm' is used for pattern matching. 
  1259. Data is usually written into the pipe, and the results of the pattern 
  1260. matching read back from THE SAME END OF THE PIPE. The second end of the pipe 
  1261. is automatically connected to a task that is doing the pattern matching. 
  1262. '/xmrFILENAME' causes the data to be read from a file rather than the pipe, 
  1263. the match results are read from the pipe.
  1264.  
  1265. In a shell type 'type awnpipe:mypipe/xmrcon:////pipetest/close'
  1266.  
  1267. In the pipetest con: type '#?a' . This sets a pattern to match any text 
  1268. ending in 'a'. 'ok 1' should come back from the pipe. ('ok 0' would means you 
  1269. did not enter a pattern so an exact match will be tested for.)
  1270.  
  1271. In the pipetest con: enter some text. If the text ends with 'a' then the pipe 
  1272. responds with '1' meaning a match. If not the pipe responds with '0' meaning 
  1273. no match. Close the pipe test con: to end the example.
  1274.  
  1275. ---
  1276.  
  1277.  Several functions can be used when processing html documents.
  1278.  
  1279.  '/xz' will remove html tags. This means a '<' and all following characters
  1280. until a matching '>'.
  1281.  
  1282.  Make a simple text file called 'file.html' as follows (or uses any html you 
  1283. already have).
  1284.  
  1285. 'hello <tag>world <another tag>
  1286. this is <tag>a test <another tag>
  1287. 1234567890123456789012345678901234567890'
  1288.  
  1289. In a shell 'type awnpipe:/xzrpath:file.html'
  1290.  
  1291.  '/xw[length]' allows you to wrap text. (Text parsed from html files is 
  1292. usualy unwrapped.)
  1293.  
  1294. Use the same file as above.
  1295.  
  1296. In a shell 'type awnpipe:/xw5rpath:file.html'
  1297. In a shell 'type awnpipe:/xw20rpath:file.html'
  1298. In a shell 'type awnpipe:/xwrpath:file.html'
  1299.  
  1300. ------------------------------------------------------------------------------
  1301.                                  3.6.3 Tricks                                 
  1302. ------------------------------------------------------------------------------
  1303.  
  1304.  
  1305. Now for some strange looking but powerful ideas. You don't have to understand 
  1306. them all just give them a try. Some interesting things can be done by setting 
  1307. a few simple aliases. Some of these aliases take advantage of AWNPipes GUI 
  1308. building feature covered in a different section of these docs.
  1309.  
  1310. alias see  echo >awnpipe:/xc "defg*nbitmap fn []*nimage*nopen"
  1311.  
  1312. Now 'see FILENAME' will display pictures using your datatypes.
  1313.  
  1314. alias readtext  echo >awnpipe:/xc "defg a cs *ntextfield a minw 200 minh 200 
  1315. gt 0 bd ro datain []*nopen"
  1316.  
  1317. Now 'readtext FILENAME' will display a textfile.
  1318.  
  1319. alias toolt  type awnpipe:/xi[]
  1320.  
  1321. Now 'toolt FILENAME' will display the tooltypes of FILENAME. (do not include 
  1322. .info in FILENAME).
  1323.  
  1324. alias text2html copy awnpipe:t2h/f/h/r[]
  1325.  
  1326. Now 'text2html infile outfile' will create special html sequences for certain 
  1327. characters in a text file and save it in a new file.
  1328.  
  1329. alias html2text copy awnpipe:t2h/f/u/r[]
  1330.  
  1331. Now 'html2text infile outfile' will convert special HTML sequences in a html 
  1332. file and save it in a new file.
  1333.  
  1334. ---
  1335.  
  1336. This next example is rather complex and is best studied after you have a 
  1337. working knowledge of AWNP.
  1338.  
  1339. It might be useful to be able to check an icons tooltype from an ADOS script, 
  1340. as earlier examples
  1341. have shown the '/Xt' option can do this. There is a problem however. You need 
  1342. to write data to the
  1343. pipe (the tooltype you wish to check), and read data from the pipe (the 
  1344. response to your query).
  1345.  
  1346.  It is simple to write data to the pipe with echo.
  1347.  
  1348. 'echo "filetype" >awnpipe:test/Xtpath:file'
  1349.  
  1350.  A pipe connected to path:file.icon is opened and the data 'filetype' is 
  1351. written to it. When the echo
  1352. command completes it closes the pipe. This breaks the connection to the 
  1353. tooltype host and the host
  1354. exits. You do not get a chance to read the response from the host.
  1355.  
  1356.  The '/m' option (multiple opens) solves this by allowing you to open the 
  1357. pipe connection to the
  1358. tooltype host more than once.
  1359.  
  1360.  'echo "filetype" >awnpipe:test/m/Xtpath:file'
  1361.  
  1362.  Again a pipe is connected to the tooltype host is created and sent data. 
  1363. This time however when echo
  1364. closes its pipe the connection to the host is not lost. AWNPipe knows you 
  1365. want to connect to the same
  1366. pipe again later.
  1367.  
  1368.  'type awnpipe:test'
  1369.  
  1370.  This reads the response back from the tooltype host. Note you only specified 
  1371. the pipe name, you do
  1372. NOT include '/Xtpath:file' again. When the type command completes the 
  1373. connection to the host is broken
  1374. and the host exits.
  1375.  
  1376.  This idea can be taken a step further.
  1377.  
  1378.  'echo "filetype" >awnpipe:test/m/Xtpath:file'
  1379.  'type awnpipe:test/m'
  1380.  'echo "filesize" >awnpipe:test/m'
  1381.  'type awnpipe:test/m'
  1382.  'echo "filedate" >awnpipe:test/m'
  1383.  'type awnpipe:test'
  1384.  
  1385. The connection to the host is not broken until you finally open the pipe a 
  1386. last time without the '/m'
  1387. option.
  1388.  
  1389.  
  1390. ------------------------------------------------------------------------------
  1391.                                 4 GUI Creation                                
  1392. ------------------------------------------------------------------------------
  1393.  
  1394.  
  1395. ------------------------------------------------------------------------------
  1396.                                4.1 Conversation                               
  1397. ------------------------------------------------------------------------------
  1398.  
  1399.  
  1400. ------------------------------------------------------------------------------
  1401.                                  4.1.1 Basic                                  
  1402. ------------------------------------------------------------------------------
  1403.  
  1404.  The sections on the conversation are important but do not try to memorize it 
  1405. all. It is enough to understand the general process.
  1406.  
  1407.  GUIs are defined and operated by means of a conversation with a special host 
  1408. built into the AWNP device. The host is accessed by opening a file . You  
  1409. write lines of text to the file and read the file to see the response.
  1410.  
  1411.  The GUI is defined by writing text lines to the file. You first write a line 
  1412. that defines the window title and other attributes of the window you want to 
  1413. create. Now you read back a response line from the pipe to make sure the 
  1414. window definition was ok. Next you write a line of text defining a gadget to 
  1415. have in the window and read another response line. This line will contain the 
  1416. Gadget ID assigned to the gadget you created. You can create as many gadgets 
  1417. as you like.
  1418.  Once you finish defining gadgets you open the window by writing a line 
  1419. containing the single word 'open'. You read back a response line confirm the 
  1420. window opened ok.
  1421.  
  1422.  Now that the GUI is created and open you simply continue to read lines from 
  1423. the file. When the user selects a gadget in the GUI you receive an event line 
  1424. containing the GID of the gadget selected and other data such the text 
  1425. entered in a string gadget. When the GUI window is closed you receive an 
  1426. EndOfFile.
  1427.  
  1428.  In some cases you will want to modify a gui after it has already been 
  1429. opened. This can be done by writing a lines of text to the file after it has 
  1430. been opened or after you read an event. You read a response to the modify 
  1431. line.
  1432.  
  1433.  For many GUIs you can tell the host to not send any response lines making 
  1434. the conversation even simpler. You can just write the GUI definition lines 
  1435. then read the event lines.
  1436.  
  1437.  
  1438. ------------------------------------------------------------------------------
  1439.                               4.1.2 Step by Step                              
  1440. ------------------------------------------------------------------------------
  1441.  
  1442. Understanding the conversation is the key to building GUIs with AWNP. Here is 
  1443. a walk through the creation and use of a simple example.
  1444.  
  1445.   Open the file AWNPipe:myGUI/xc. myGUI can be any name you want.The /xc must 
  1446. be used as it tells AWNPipe this file is for GUi creation. From now on I will 
  1447. refer to this file as the 'pipe'
  1448.  
  1449. Write a Window definition line to the pipe.
  1450. 'title "My First gui" defaultgadgets'
  1451. The line read from the pipe should be
  1452. 'ok window'
  1453. Anything else is an error response.
  1454.  
  1455. Write a Gadget definition line to the pipe. 
  1456. 'button gadgettext "testbutton"
  1457. The line read from the pipe should be
  1458. 'ok 1'
  1459. The Gadget ID of the button is 1. If the response line does not start with 
  1460. 'ok' then an error has occurred.
  1461.  
  1462. Write a Gadget definition line to the pipe. 
  1463. 'checkbox gadgettext "tryme"
  1464. The line read from the pipe should be
  1465. 'ok 2'
  1466. The Gadget ID of the checkbox is 2. If the response line does not start with 
  1467. 'ok' then an error has occurred.
  1468.  
  1469.  
  1470. Write open command line to the pipe.
  1471. 'open'
  1472. The line read from the pipe should be
  1473. 'ok window'
  1474. Anything else is an error response.
  1475.  
  1476. Now you read an event from the pipe. It will come when the user selects a 
  1477. gadget. 
  1478.  
  1479. If the checkbox is selected you get the line
  1480. 'gadget 2 1'
  1481. the first word 'gadget tells you the event was from a gadget being hit. 2 is 
  1482. the gadgets GID, the 1 at the end tells you the checkbox is now selected.
  1483.  
  1484. If the checkbox is selected a second time you get the line
  1485. 'gadget 2 1'
  1486. the first word 'gadget tells you the event was from a gadget being hit. 2 is 
  1487. the gadgets GID, the 0 at the end tells you the checkbox is now unselected.
  1488.  
  1489. If the button is selected you get the line
  1490. 'gadget 1 0'
  1491. the first word 'gadget tells you the event was from a gadget being nit. 1 is 
  1492. the gadgets GID, the 0 at the end tells you the button is not highlighted. In 
  1493. this example you can ignore the 0 (button state).
  1494.  
  1495. when the GUI window is closed you get the line
  1496. 'close 0'
  1497. the first word 'close' tells you the event was from the window being closed. 
  1498. 0 (close source) tells you it closed when the close gadget was hit. If the 
  1499. user entered <CTRL\>' the close source would be -1. After the close event any 
  1500. further attempts to read the pipe will return EndOfFile.
  1501.  
  1502. You keep reading events until the end of file is received. You could also 
  1503. close the pipe after the close event is read. 
  1504.  
  1505.  
  1506. This is a second conversation in which the GUI is modified after it is 
  1507. opened. 
  1508.  
  1509.   Open the file AWNPipe:myGUI/xc. 
  1510. Write a Window definition line to the pipe.
  1511. 'title "My First gui" defaultgadgets modify'
  1512. The modify keyword tells the pipe you want to be able to modify this GUI 
  1513. later.
  1514. The line read from the pipe should be
  1515. 'ok window'
  1516.  
  1517. Write a Gadget definition line to the pipe. 
  1518. 'button gadgettext "testbutton"
  1519. The line read from the pipe should be
  1520. 'ok 1'
  1521.  
  1522. Write a Gadget definition line to the pipe. 
  1523. 'checkbox gadgettext "tryme"
  1524. The line read from the pipe should be
  1525. 'ok 2'
  1526.  
  1527. Write open command line to the pipe.
  1528. 'open'
  1529. The line read from the pipe should be
  1530. 'ok window'
  1531.  
  1532. After the window is opened you get your first chance to modify it. We want to 
  1533. disable the button so we send the following line.
  1534. 'ID 1 disable 1 refresh'
  1535. The button is specified with 'ID 1' and 'disable 1' disables it. The refresh 
  1536. at the end tells the pipe to refresh the button so the changes show.
  1537. The line read from the pipe should be
  1538. 'ok'
  1539. If the response does not start with 'ok' an error occurred.
  1540.  
  1541. We also want the check mark to show as selected so we write the line
  1542. 'ID 2 selected 1'
  1543. The button is specified with 'ID 1' and 'selected 1' turns causes it to be 
  1544. checked (the checkmark showing in the box). The refresh at the end tells the 
  1545. pipe to refresh the button so the changes show.
  1546. The line read from the pipe should be
  1547. 'ok'
  1548.  
  1549. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1550. we are finished sending modify instruction and want to read an event from the 
  1551. pipe.
  1552. 'continue'
  1553. The line read from the pipe should be
  1554. 'ok'
  1555.  
  1556. Now you read an events from the pipe.  
  1557.  
  1558. If the checkbox is selected you get the line
  1559. 'gadget 2 0'
  1560. The user selected the checkbox gadget, it is now unchecked. We want enable 
  1561. the button gadget. AFTER SENDING AN EVENT THE PIPE STARTS READING MODIFY 
  1562. INSTRUCTIONS AGAIN. We send the following modify line to the pipe.
  1563. 'ID 1 disable 0 refresh'
  1564. The button is specified with 'ID 1' and 'disable 0' enables it. The refresh 
  1565. at the end tells the pipe to refresh the button so the changes show.
  1566. The line read from the pipe should be
  1567. 'ok'
  1568. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1569. we are finished sending modify instruction and want to read another event.
  1570. 'continue'
  1571. The line read from the pipe should be
  1572. 'ok'
  1573.  
  1574. If the checkbox is selected a second time you get the line
  1575. 'gadget 2 1'
  1576. The 1 at the end tells you the checkbox is now selected. We want to disable 
  1577. the button gadget so we send the line
  1578. 'ID 1 disable 1 refresh'
  1579. The line read from the pipe should be
  1580. 'ok'
  1581. WE have finished modifying the GUI for now so we send a line to tell the pipe 
  1582. we are finished sending modify instruction and want to read another event.
  1583. 'continue'
  1584. The line read from the pipe should be
  1585. 'ok'
  1586.  
  1587. If the button is selected you get the line
  1588. 'gadget 1 0'
  1589. WE do not want to modify anything at this time but we still need to send the 
  1590. continue line so the pipe will stop looking for modify lines and send us 
  1591. another event.
  1592. 'continue'
  1593. The line read from the pipe should be
  1594. 'ok'
  1595.  
  1596. when the GUI window is closed you get the line
  1597. 'close 0'
  1598. The window is closed but we can still send modify commands. For example we 
  1599. could read the final state of the gadgets. In this case we will do nothing 
  1600. but send the continue line.
  1601. 'continue'
  1602. The line read from the pipe should be
  1603. 'ok'
  1604. Any further reads from the pipe return EOF.
  1605.  
  1606. You keep reading an event then sending modify commands until the end of file 
  1607. is received. You could also close the pipe after the close event is read. 
  1608.  
  1609.  
  1610. ------------------------------------------------------------------------------
  1611.                                 4.1.3 Details                                 
  1612. ------------------------------------------------------------------------------
  1613.  
  1614.  When building a complex GUI you will use objects other than simple gadgets. 
  1615. These objects are created the same way as gadgets, by writing a line to the 
  1616. pipe and then reading a response. Some of these objects return a GID and some 
  1617. simply return an ok.
  1618.  
  1619.  You will also handle more types of events than just gadget and close events. 
  1620. You can receive menu events, keystrokes, window activation and other types of 
  1621. events. These events are handled the same way gadget events are handled.
  1622.  
  1623.  A wide range of modify commands can be used. As well as modifying gadgets 
  1624. you can iconify the window, read gadget contents, set the windows busy 
  1625. pointer and other things. The range of modify commands you use will be 
  1626. determined by the type program you are writing.
  1627.  
  1628.  Some types of gadget events (textfields, texteditors), and ARexx events 
  1629. require special handling since they can be more than one line. The tutorials 
  1630. will show you how to handle these events.
  1631.  
  1632.  You should now work through the examples. They will not only help you learn 
  1633. to use AWNP, they will provide example code you can use for the basis of your 
  1634. own GUIs.
  1635.  
  1636. ------------------------------------------------------------------------------
  1637.                                  4.2 Objects                                  
  1638. ------------------------------------------------------------------------------
  1639.  
  1640.  
  1641. ------------------------------------------------------------------------------
  1642.                                  4.2.1 Window                                 
  1643. ------------------------------------------------------------------------------
  1644.  
  1645. The parameters defining the CA window must all be on one line terminated by a 
  1646. newline. The pipe will reply with 'window ok'.
  1647.  
  1648.  
  1649. screentitle="screen title text"  (st=)
  1650.  
  1651.  Set the text for the screen title when CA window is active.
  1652.  
  1653. title="window title text"
  1654.  
  1655.  Set the title for the CA window.
  1656.  
  1657. pubscreen="Screen name"  (ps=)
  1658.  
  1659.  Open the CA window on a public screen
  1660.  
  1661. IconifyIcon (ii=)
  1662.  
  1663. Set the name of the icon to use when you iconify the window.
  1664.  
  1665. IconTitle="icon title text"  (it=)
  1666.  
  1667.  Set the title for the CA window when iconified.
  1668.  
  1669. backfill="filename"  (bf=)
  1670.  
  1671.  Image file to use as backfill for window. If backfill is not specified you 
  1672. get the default window backfill. Setting backfill="" can be used to have no 
  1673. backfill at all. Use this carefully as it overrides the user CA prefs.
  1674.  
  1675. NoBorder (NB)
  1676.  
  1677.  Make the window borderless.
  1678.  
  1679. Quiet  (q)
  1680.  
  1681.  Tell the pipe not to reply to the window, gadget definitions, or modify 
  1682. commands. This is actually a toggle switch turning replies off and on. SOME 
  1683. modify commands are ALWAYS replied to. (addnode and getfile selected 0|1)
  1684.  
  1685. NoWindow
  1686.  
  1687.  switch to causes no window to be opened. This will not work unless modify is 
  1688. set and an arexx object is defined.
  1689.  
  1690. NOTE: At times you may want to modify a GUI after is is created, but BEFORE 
  1691. the window is opened. Use the 'NoWindow' keyword in the window definition, 
  1692. create the GUI as usual. When you send 'open' the window does NOT open but 
  1693. you do go into modify mode. Modify the GUI then send 'id 0 s 64' to open the 
  1694. window after it has been modified.
  1695.  
  1696. app
  1697.  
  1698.  Make  this  window a application window.
  1699.  
  1700. activate  (a)
  1701.  
  1702.  Switch to activate theCA window when it opens.
  1703.  
  1704. depthgadget (dg)
  1705.  
  1706.  Switch to include a depth gadget on the CA window.
  1707.  
  1708. dragbar  (db)
  1709.  
  1710.  Switch to include a drag bar on the CA window.
  1711.  
  1712. closegadget (cg)
  1713.  
  1714.  Switch to include a close gadget on the CA window.
  1715.  
  1716. askclose
  1717.  
  1718.  Switch to stop the close gadget from actually closing the window. The close 
  1719. gadget will generate an 'askclose' event instead. This switch is ignored 
  1720. unless modify is also set.
  1721.  
  1722. sizegadget (sg)
  1723.  
  1724.  Switch to include a window size gadget on the CA window.
  1725.  
  1726. iconifygadget  (ig)
  1727.  
  1728.  Switch to include an iconify gadget on the CA window.
  1729.  
  1730. fullscreen    (fs)
  1731. centerscreen   (cs)
  1732. topleft         (tl)
  1733.  
  1734.  Relative position to open the CA window at. Defaults to centermouse.
  1735.  
  1736. top=number
  1737. left=number
  1738. width=umber
  1739. height=number
  1740.  
  1741.  Position and size to open  the CA window. Using the left parameter over 
  1742. rides the relative positioning above.
  1743.  
  1744. vertical     (v)
  1745.  
  1746.  Switch to display gadgets vertically, defaults to horizontal.
  1747.  
  1748. even    (e)
  1749.  
  1750.  Switch to make gadgets/groups all the same size.
  1751.  
  1752. defaultgadgets  (defg)
  1753.  
  1754.  Switch to include close, depth, size, and drag gadgets on the CA window.
  1755.  
  1756. sendkeys  (sk)
  1757.  
  1758.  Switch to have the CA window return keystrokes.
  1759.  
  1760. sendqual  (sq)
  1761.  
  1762.  Switch to have the CA window send qualifier events. (see events.doc)
  1763.  
  1764. modify   (m)
  1765.  
  1766.  Switch to allow the CA window to be modified AFTER it has been opened.
  1767. (See modify parameters below)
  1768.  
  1769. help (h)
  1770.  
  1771.   Switch to have the CA window return help events.
  1772.  
  1773. state
  1774.  
  1775. Switch to have the CA window return active/inactive events.
  1776.  
  1777. refresh
  1778.  
  1779. Switch to have the CA window return refresh events. This is only useful if 
  1780. you are doing your rendering directly into the window.
  1781.  
  1782. defer
  1783.  
  1784.  Switch to defer window layout from the input device to the pipe task. This 
  1785. will make input.device more responsive, and drop the (possibly quite 
  1786. heavy)process of recalculating the display to normal application priority 
  1787. instead of the priority 20 of input.device.
  1788.  
  1789.  It also means window refresh is blocked if you are sending modify commands 
  1790. to the pipe. The window refreshes AFTER you send 'continue'.
  1791.  
  1792. SpaceOuter (so)
  1793.  
  1794.  Leave a blank space outside the  root layout of the CA window.
  1795.  
  1796. SpaceInner  (si)
  1797.  
  1798.  Leave a blank space around elements in the root layout of the CA window.
  1799.  
  1800. fixwidth (fw)
  1801.  
  1802.  Do not allow the width of the window to be adjusted.
  1803.  
  1804. fixheight (fh)
  1805.  
  1806.  Do not allow the width of the window to be adjusted.
  1807.  
  1808. shrinkwrap (sw)
  1809.  
  1810.  Keep all gadgets in the window as close together as possible.
  1811.  
  1812. specialchar="character" (sc=)
  1813.  
  1814.  'Character' is a single character that replaces '|', in use as a separator 
  1815. inside parameters like chooserlabels, tags, penmapdata, ...
  1816.  
  1817. tags="tags|data[|tag|data...]|0
  1818.  
  1819.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  1820.  
  1821. info
  1822.  
  1823.  Include the drawinfo pen array for the screen in the reply to the window 
  1824. definition line.
  1825.  
  1826.  If successful the reply is
  1827.  
  1828. 'ok window NUMBERofPENS PEN0 PEN1 ...'
  1829.  
  1830. see include:intuition/screen.h for more about drawinfo pens.
  1831.  
  1832.  
  1833. Modify GID 0
  1834. ------------
  1835.  
  1836. GID 0 is used to specify the GUI window itself. It can be used in modify 
  1837. lines to control certain aspects of the window.
  1838.  
  1839. selected=function_bitmap (s=)
  1840. This should really have been in HEX but its not for backward compatability.
  1841.  
  1842. bit# decimal function
  1843.  
  1844. 0       1      activate window
  1845. 1       2      window to front
  1846. 2       4      window to back
  1847. 3       8      set window title
  1848. 4      16      set screen title
  1849. 5      32      iconify window
  1850. 6      64      uniconify (or open) window
  1851. 7     128      Close window (but do not dispose)
  1852. 8     256      Set busy pointer and disable window
  1853. 9     512      Clear busy pointer and enable window
  1854. 10   1024      window to front
  1855. 11   2048      window to back
  1856.  
  1857. You can use more than one function at the same time. 66=uniconify and 
  1858. windowtofront.
  1859.  
  1860. gadgettext=  (gt=)
  1861.  
  1862.  Text for setting screen or window title.
  1863.  
  1864. disable=BOOL  (dis=)
  1865.  
  1866.  0 enables all gadgets in window.
  1867.  !1 disables all gadgets
  1868.  
  1869. wide=num
  1870. high=num
  1871.  
  1872.  Attempt to resize the window to the given width and/or height.Set wide=1 
  1873. high=1 to get the minimum size possible.
  1874.  
  1875. top=num
  1876. left=num
  1877.  
  1878.  Move the window to the given position(s).
  1879.  
  1880. 'ID 0 read'
  1881. returns the windows 'left top width height' settings. (width and height 
  1882. report as 0 until you get at least 1 event back from the
  1883. pipe)
  1884.  
  1885. refresh (ref)
  1886.  
  1887.  Refresh all gadgets in the window.
  1888.  
  1889.  
  1890. ------------------------------------------------------------------------------
  1891.                              4.2.2 Simple Gadgets                             
  1892. ------------------------------------------------------------------------------
  1893.  
  1894.  
  1895. ------------------------------------------------------------------------------
  1896.                                 4.2.2.1 Button                                
  1897. ------------------------------------------------------------------------------
  1898.  
  1899. Button gadget event
  1900. -------------------------
  1901.  
  1902. 'gadget GID selected_state'
  1903.  
  1904. selected_state =0 not selected,!=0 selected
  1905.  
  1906. Button gadget parameters.
  1907. -------------------------
  1908.  
  1909. font=GID
  1910.  
  1911. This sets the font for the gadget. The GID must point to an ALREADY defined 
  1912. text attribute.
  1913.  
  1914. close (c)
  1915.  
  1916.  This gadget will close the window when selected by the user.
  1917.  
  1918. readonly (ro)
  1919.  
  1920.  This gadget is read only.
  1921.  
  1922. disable=number (dis=)
  1923.  
  1924.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  1925. enabled.
  1926.  
  1927. selected=number (s=)
  1928.  
  1929.   The gadget is selected if number != 0 , unselected if number = 0. Defaults 
  1930. to unselected.
  1931.  
  1932. autobutton=number (ab)
  1933.  
  1934.  This button uses a scaled glyph image. The number selects the glyph.
  1935.  
  1936. 0 POPFILE
  1937. 1 POPDRAWER
  1938. 2 POPFONT
  1939. 3 CHECKBOX
  1940. 4 CANCELBOX
  1941. 5 UPARROW
  1942. 6 DNARROW
  1943. 7 RTARROW
  1944. 8 LFARROW
  1945. 9 POPTIME
  1946. 10 POPSCREEN
  1947. 11 POPUP
  1948.  
  1949. pushbutton  (pb)
  1950.  
  1951.  This button is a pushbutton.
  1952.  
  1953. gadgettext="text"  (gt=)
  1954.  
  1955.  Set the text of the gadget.
  1956.  
  1957. bevel=TYPE  (b=)
  1958.  
  1959.  Set the bevel type for this gadget.
  1960. 0=NONE
  1961. 1=THIN
  1962. 2=BUTTON
  1963. 3=GROUP
  1964. 4=FIELD
  1965. 5=DROPBOX
  1966. 6=SBAR_HORIZ
  1967. 7=SBAR_VERT
  1968. 8=BOX
  1969. 9=STANDARD
  1970.  
  1971. leftjustify  (lj)
  1972. rightjustify (rj)
  1973.  
  1974.  Set the justification of the text for the gadget. Defaults to centerjustify.
  1975.  
  1976. minwidth=number  (minw=)
  1977.  
  1978.  Set the minimum width for this gadget
  1979.  
  1980. minheight=number (minh=)
  1981.  
  1982.  Set the minimum height for this gadget
  1983.  
  1984. weightedwidth=number   (weiw=)
  1985.  
  1986.  Set the weighted width for this gadget
  1987.  
  1988. weightedheight=number  (weih=)
  1989.  
  1990.  Set the weighted height for this gadget
  1991.  
  1992. nominalsize   (noms)
  1993.  
  1994.  Set this gadget to its nominal size.
  1995.  
  1996. useimage   (ui)
  1997.  
  1998.  Use the last defined image (bitmap/drawlist/penmap) as the gadgets image.
  1999.  
  2000. Anim="x|y|wide|high|offsetx|offsety|count"
  2001.  
  2002.  Use portions of a bitmap for this gadgets image(s).
  2003. x,y              the left and top pixel of the first image.
  2004. wide,high        the size of the images.
  2005. offsetx,offsety  the offset to the next image.
  2006. count            must be 0 for a standard two image button
  2007.                  (normal and selected image)
  2008.  
  2009. The first image is the gadget graphic, the offset is to the selected image. 
  2010. offsets can be 0 to use a single image.
  2011.  
  2012. If count!=0 an array of images is produced to allow animation of the button.
  2013. If count >0 an array of count images is built. The button image is set to
  2014. the first image in the array.
  2015. If count <0 an array of absolute value(count)*2 images is built. The button 
  2016. image is set to the first image in the array. The selected image is set to 
  2017. image absolute value(count)+1.
  2018.  
  2019. See the 'animimage' modify parameter for details about animating the button.
  2020.  
  2021.  
  2022. FileName='path:file'
  2023.  
  2024.  A image file to use as the source bitmap for the anim data. If no file name 
  2025. is given an anim is given the bitmap from the previous anim will be reused. 
  2026. This bitmap in held in a buffer shared by bitmap images. See the image 
  2027. docs-bitmap for more info.
  2028.  
  2029. trans
  2030.  
  2031.  The animation background should be transparent if the image type allows it.
  2032.  
  2033. tags="tags|data[|tag|data...]|0
  2034.  
  2035.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  2036.  
  2037. childlabel    (chl)
  2038. childlabelr   (chlr)
  2039.  
  2040.  Use the previously defined image as a childlabel for this gadget. Display 
  2041. the childlabel to the right or left of the gadget.
  2042.  
  2043. replace=GID
  2044.  
  2045.  Use this gadget to replace an existing gadget specified by GID.
  2046.  
  2047. Definition Reply
  2048. -----------------
  2049.  
  2050.  When the gadget creation is successful the pipe replies with
  2051.  
  2052. 'ok GID'
  2053.  
  2054. Button gadget modify parameters.
  2055. -------------------------
  2056.  
  2057. readonly=number (ro=)
  2058.  
  2059.  The gadget is readonly if number = 1 , functional if number= 0. Note that 
  2060. this is different handling then in gadget definitions.
  2061.  
  2062. disable=number (dis=)
  2063.  
  2064.  The gadget is enabled if number = 0 , disabled if number != 0.
  2065.  
  2066. selected=number (s=)
  2067.  
  2068.   The gadget is selected if number != 0 , unselected if number = 0.
  2069.  
  2070. gadgettext="text"  (gt=)
  2071.  
  2072.  Set the text of the gadget.
  2073.  
  2074. newimage=number (ni=)
  2075.  
  2076.  Replace the gadget image with a previously defined image. If number =0 
  2077. replace normal image, else replace selected image.
  2078.  
  2079. animimage=number  (ai=)
  2080.  
  2081.  When used with the 'newimage' keyword the button image is replaced with an 
  2082. image from the buttons image array. The image to be used is specified by 
  2083. number.
  2084.  
  2085. get=TAG
  2086.  
  2087.  Read the value of a specific gadget attribute. Returns a blank line if 
  2088. attribute is not readable. This should not be combined with any other modify 
  2089. command on the same line.
  2090.  
  2091. read
  2092.  
  2093.  returns the state of the button
  2094.  
  2095. refresh (ref)
  2096.  
  2097.  Redraw the gadget.
  2098.  
  2099. ------------------------------------------------------------------------------
  2100.                                4.2.2.2 Integer                                
  2101. ------------------------------------------------------------------------------
  2102.  
  2103. Integer gadget event
  2104. -------------------------
  2105.  
  2106. 'gadget GID integer_value'
  2107.  
  2108. Integer gadget parameters.
  2109. -------------------------
  2110.  
  2111. font=GID
  2112.  
  2113. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2114. attribute.
  2115.  
  2116. TabCycle (tc)
  2117.  
  2118.  This gadget can be activated using the tab key.
  2119.  
  2120. close (c)
  2121.  
  2122.  This gadget will close the window when selected by the user.
  2123.  
  2124. readonly (ro)
  2125.  
  2126.  This gadget is read only.
  2127.  
  2128. disable=number (dis=)
  2129.  
  2130.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2131. enabled.
  2132.  
  2133. arrows (a)
  2134.  
  2135.  Switch to display up/down arrows for this gadget.
  2136.  
  2137. minchars=number (minc=)
  2138.  
  2139.  Minimum number of character/digits in this gadget.
  2140. Defaults to 5.
  2141.  
  2142. maxchars=number (maxc=)
  2143.  
  2144.  Maximum number of character/digits in this gadget.
  2145. Defaults to 10.
  2146.  
  2147. minnumber=number (minn=)
  2148.  
  2149.  Minimum value for this gadget. Defaults to 0.
  2150.  
  2151. maxnumber=number (maxn=)
  2152.  
  2153.  Maximum value for this gadget. Defaults to 32768.
  2154.  
  2155. defnumber=number (defn=)
  2156.  
  2157.  Value for this gadget when window is opened. Defaults to 1.
  2158.  
  2159. leftjustify (lj)
  2160. centerjustify (cj)
  2161.  
  2162.  Set the justification of the text for the gadget. Defaults to rightjustify.
  2163.  
  2164. minwidth=number (minw=)
  2165.  
  2166.  Set the minimum width for this gadget
  2167.  
  2168. minheight=number (minh=)
  2169.  
  2170.  Set the minimum height for this gadget
  2171.  
  2172. weightedwidth=number (weiw=)
  2173.  
  2174.  Set the weighted width for this gadget
  2175.  
  2176. weightedheight=number (weih=)
  2177.  
  2178.  Set the weighted height for this gadget
  2179.  
  2180. nominalsize (noms)
  2181.  
  2182.  Set this gadget to its nominal size.
  2183.  
  2184. tags="tags|data[|tag|data...]|0
  2185.  
  2186.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  2187.  
  2188. childlabel    (chl) childlabelr   (chlr)
  2189.  
  2190.  Use the previously defined image as a childlabel for this gadget. Display 
  2191. the childlabel to the right or left of the gadget.
  2192.  
  2193. replace=GID
  2194.  
  2195.  Use this gadget to replace an existing gadget specified by GID.
  2196.  
  2197. Definition Reply
  2198. -----------------
  2199.  
  2200.  When the gadget creation is successful the pipe replies
  2201. with
  2202.  
  2203. 'ok GID'
  2204.  
  2205. Integer gadget modify parameters.
  2206. -------------------------
  2207.  
  2208. disable=number (dis=)
  2209.  
  2210.  The gadget is enabled if number = 0 , disabled if number != 0.
  2211.  
  2212. defnumber=number (defn=)
  2213.  
  2214.  Set the value for this gadget.
  2215.  
  2216.  
  2217.  
  2218. ------------------------------------------------------------------------------
  2219.                                 4.2.2.3 String                                
  2220. ------------------------------------------------------------------------------
  2221.  
  2222. String gadget event
  2223. -------------------------
  2224.  
  2225. 'gadget GID string'
  2226.  
  2227. String gadget parameters.
  2228. -------------------------
  2229.  
  2230. Hook=number
  2231.  
  2232.  Select a special string gadget type where number =
  2233.  
  2234. PASSWORD        1
  2235. IPADDRES        2
  2236. FLOAT           3
  2237. HEXIDECIMAL     4
  2238. TELEPHONE       5
  2239. POSTALCODE      6
  2240. AMOUNT          7
  2241. UPPERCASE       8
  2242.  
  2243. NOTE: some types do not seem to implimented in string gadget yet. 1,4,5,8
  2244. seem to work under OS 3.9.
  2245.  
  2246. font=GID
  2247.  
  2248. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2249. attribute.
  2250.  
  2251. TabCycle (tc)
  2252.  
  2253.  This gadget can be activated using the tab key.
  2254.  
  2255. close (c)
  2256.  
  2257.  This gadget will close the window when selected by the user.
  2258.  
  2259. readonly (ro)
  2260.  
  2261.  This gadget is read only.
  2262.  
  2263. disable=number (dis=)
  2264.  
  2265.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2266. enabled.
  2267.  
  2268. gadgettext="text" (gt=)
  2269.  
  2270.  Set the text in the gadget.
  2271.  
  2272. minchars=number (minc=)
  2273.  
  2274.  Minimum number of character/digits in this gadget. Defaults to 10.
  2275.  
  2276. maxchars=number (maxc=)
  2277.  
  2278.  Maximum number of character/digits in this gadget. Defaults to 100.
  2279.  
  2280. leftjustify (lj)
  2281. centerjustify (cj)
  2282.  
  2283.  Set the justification of the text for the gadget. Defaults to rightjustify.
  2284.  
  2285. minwidth=number (minw=)
  2286.  
  2287.  Set the minimum width for this gadget
  2288.  
  2289. minheight=number (minh=)
  2290.  
  2291.  Set the minimum height for this gadget
  2292.  
  2293. weightedwidth=number (weiw=)
  2294.  
  2295.  Set the weighted width for this gadget
  2296.  
  2297. weightedheight=number (weih=)
  2298.  
  2299.  Set the weighted height for this gadget
  2300.  
  2301. nominalsize (noms)
  2302.  
  2303.  Set this gadget to its nominal size.
  2304.  
  2305. replace=GID
  2306.  
  2307.  Use this gadget to replace an existing gadget specified by GID.
  2308.  
  2309. Definition Reply
  2310. -----------------
  2311.  
  2312.  When the gadget creation is successful the pipe replies with
  2313.  
  2314. 'ok GID'
  2315.  
  2316. String gadget modify parameters.
  2317. -------------------------
  2318.  
  2319. disable=number (dis=)
  2320.  
  2321.  The gadget is enabled if number = 0 , disabled if number != 0.
  2322.  
  2323. gadgettext="text" (gt=)
  2324.  
  2325.  Set the text in the gadget.
  2326.  
  2327. selected=num  (s=)
  2328.  
  2329.  Set the cursor position in a string gadget, and activate the gadget.
  2330.  
  2331. bufferpos
  2332.  
  2333.  Read the current cursor position in the string gadget. This keyword should 
  2334. be used by itself. ( 'id GID getposition')
  2335.  
  2336.  It is replied to with 'POSITION ok'.
  2337.  
  2338.  
  2339. ------------------------------------------------------------------------------
  2340.                                4.2.2.4 CheckBox                               
  2341. ------------------------------------------------------------------------------
  2342.  
  2343. CheckBox gadget event
  2344. -------------------------
  2345.  
  2346. 'gadget GID selected_state'
  2347.  
  2348.  
  2349. CheckBox gadget parameters.
  2350. -------------------------
  2351.  
  2352. font=GID
  2353.  
  2354. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2355. attribute.
  2356.  
  2357. close (c)
  2358.  
  2359.  This gadget will close the window when selected by the user.
  2360.  
  2361. readonly (ro)
  2362.  
  2363.  This gadget is read only.
  2364.  
  2365. disable=number (dis=)
  2366.  
  2367.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2368. enabled.
  2369.  
  2370. selected=number (s=)
  2371.  
  2372.   The gadget is selected if number != 0 , unselected if number = 0. Defaults 
  2373. to unselected.
  2374.  
  2375. gadgettext="text" (gt=)
  2376.  
  2377.  Set the text of the gadget.
  2378.  
  2379. leftjustify (lj)
  2380.  
  2381.  Set the placement of the text for the gadget. Defaults to Rightjustify.
  2382.  
  2383. minwidth=number (minw=)
  2384.  
  2385.  Set the minimum width for this gadget
  2386.  
  2387. minheight=number (minh=)
  2388.  
  2389.  Set the minimum height for this gadget
  2390.  
  2391. weightedwidth=number (weiw=)
  2392.  
  2393.  Set the weighted width for this gadget
  2394.  
  2395. weightedheight=number (weih=)
  2396.  
  2397.  Set the weighted height for this gadget
  2398.  
  2399. nominalsize (noms)
  2400.  
  2401.  Set this gadget to its nominal size.
  2402.  
  2403. tags="tags|data[|tag|data...]|0
  2404.  
  2405.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  2406.  
  2407. childlabel    (chl)
  2408. childlabelr   (chlr)
  2409.  
  2410.  Use the previously defined image as a childlabel for this gadget. Display 
  2411. the childlabel to the right or left of the gadget.
  2412.  
  2413. replace=GID
  2414.  
  2415.  Use this gadget to replace an existing gadget specified by GID.
  2416.  
  2417. Definition Reply
  2418. -----------------
  2419.  
  2420.  When the gadget creation is successful the pipe replies with
  2421.  
  2422. 'ok GID'
  2423.  
  2424. CheckBox gadget modify parameters.
  2425. -------------------------
  2426.  
  2427. disable=number (dis=)
  2428.  
  2429.  The gadget is enabled if number = 0 , disabled if number != 0.
  2430.  
  2431. selected=number (s=)
  2432.  
  2433.   The gadget is selected if number != 0 , unselected if number = 0.
  2434.  
  2435. gadgettext="text" (gt=)
  2436.  
  2437.  Set the text of the gadget.
  2438.  
  2439.  
  2440. ------------------------------------------------------------------------------
  2441.                                4.2.2.5 Chooser                                
  2442. ------------------------------------------------------------------------------
  2443.  
  2444. Chooser gadget event
  2445. -------------------------
  2446.  
  2447. 'gadget GID selected'
  2448.  
  2449. selected = the selected choice in the chooser.
  2450.  
  2451. Chooser gadget parameters.
  2452. -------------------------
  2453.  
  2454. font=GID
  2455.  
  2456. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2457. attribute.
  2458.  
  2459. close (c)
  2460.  
  2461.  This gadget will close the window when selected by the user.
  2462.  
  2463. readonly (ro)
  2464.  
  2465.  This gadget is read only.
  2466.  
  2467. disable=number (dis=)
  2468.  
  2469.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  2470. enabled.
  2471.  
  2472. gadgettext="text" (gt=)
  2473.  
  2474.  Set the text for the gadget.
  2475.  
  2476. selected=number (s=)
  2477.  
  2478.   Set which choice is selected when the window opens. Selections start at 0 . 
  2479. This defaults to choice 0.
  2480.  
  2481. ChooserLabels="choice0|choice1|choice..." (cl)
  2482.  
  2483.  Set the choices for the gadget. Maximum 50 choices, do not exceed this !
  2484.  
  2485. Maxnumber=count (maxn=)
  2486.  
  2487.  The maximum number of selection to display. Defaults to 12.
  2488.  
  2489. Popup   (pu)
  2490.  
  2491.  This is a popup chooser. Defaults to dropdown.
  2492.  
  2493. minwidth=number (minw=)
  2494.  
  2495.  Set the minimum width for this gadget
  2496.  
  2497. minheight=number (minh=)
  2498.  
  2499.  Set the minimum height for this gadget
  2500.  
  2501. weightedwidth=number (weiw=)
  2502.  
  2503.  Set the weighted width for this gadget
  2504.  
  2505. weightedheight=number (weih=)
  2506.  
  2507.  Set the weighted height for this gadget
  2508.  
  2509. nominalsize (noms)
  2510.  
  2511.  Set this gadget to its nominal size.
  2512.  
  2513. tags="tags|data[|tag|data...]|0
  2514.  
  2515.  A list of tag and value pairs in HEX. Do not forget the
  2516. trailing null !
  2517.  
  2518. childlabel    (chl)
  2519. childlabelr   (chlr)
  2520.  
  2521.  Use the previously defined image as a childlabel for this gadget. Display 
  2522. the childlabel to the right or left of the gadget.
  2523.  
  2524. TabCycle (tc)
  2525.  
  2526.  This gadget can be selected by cycling with the tab key.
  2527.  
  2528. replace=GID
  2529.  
  2530.  Use this gadget to replace an existing gadget specified by GID.
  2531.  
  2532. Definition Reply
  2533. -----------------
  2534.  
  2535.  When the gadget creation is successful the pipe replies with
  2536.  
  2537. 'ok GID'
  2538.  
  2539. Chooser gadget modify parameters.
  2540. -------------------------
  2541.  
  2542. disable=number (dis=)
  2543.  
  2544.  The gadget is enabled if number = 0 , disabled if number !=0.
  2545.  
  2546. selected=number (s=)
  2547.  
  2548.   Set which choice is selected . Selections start at 0 .
  2549.  
  2550. chooserlabels="choice0|choice1|choice..." (cl=)
  2551.  
  2552.  Change the choices available in the chooser.
  2553.  
  2554. defnumber=count (defn=)
  2555.  
  2556.  The maximum number of selection to display.
  2557.  
  2558.  
  2559. ------------------------------------------------------------------------------
  2560.                              4.2.2.6 RadioButton                              
  2561. ------------------------------------------------------------------------------
  2562.  
  2563. Radio Button gadget event
  2564. -------------------------
  2565.  
  2566. 'gadget GID selected_state'
  2567.  
  2568. Radio Button gadget parameters.
  2569. -------------------------
  2570.  
  2571. font=GID
  2572.  
  2573. This sets the font for the gadget. The GID points to an ALREADY defined text 
  2574. attribute.
  2575.  
  2576. close (c)
  2577.  
  2578.  This gadget will close the window when selected by the user.
  2579.  
  2580. readonly (ro)
  2581.  
  2582.  This gadget is read only.
  2583.  
  2584. disable=number (dis=)
  2585.  
  2586.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  2587. enabled.
  2588.  
  2589. selected=number (s=)
  2590.  
  2591.   Set which choice is selected when the window opens. Selections start at 0 . 
  2592. This defaults to choice 0.
  2593. to unselected.
  2594.  
  2595. RadioLabels="choice0|choice1|choice..."  (rl=)
  2596.  
  2597.  Set the choices for the gadget. This parameter MUST be given.
  2598.  
  2599. minwidth=number (minw=)
  2600.  
  2601.  Set the minimum width for this gadget
  2602.  
  2603. minheight=number (minh=)
  2604.  
  2605.  Set the minimum height for this gadget
  2606.  
  2607. weightedwidth=number (weiw=)
  2608.  
  2609.  Set the weighted width for this gadget
  2610.  
  2611. weightedheight=number (weih=)
  2612.  
  2613.  Set the weighted height for this gadget
  2614.  
  2615. nominalsize (noms)
  2616.  
  2617.  Set this gadget to its nominal size.
  2618.  
  2619. replace=GID
  2620.  
  2621.  Use this gadget to replace an existing gadget specified by GID.
  2622.  
  2623. Definition Reply
  2624. -----------------
  2625.  
  2626.  When the gadget creation is successful the pipe replies with
  2627.  
  2628. 'ok GID'
  2629.  
  2630. Radio Button gadget modify parameters.
  2631. -------------------------
  2632.  
  2633. disable=number (dis=)
  2634.  
  2635.  The gadget is enabled if number = 0 , disabled if number != 0.
  2636.  
  2637. selected=number (s=)
  2638.  
  2639.  Set the current selection of the radio button.
  2640.  
  2641.  
  2642.  
  2643. ------------------------------------------------------------------------------
  2644.                                  4.2.3 Images                                 
  2645. ------------------------------------------------------------------------------
  2646.  
  2647.  
  2648. ------------------------------------------------------------------------------
  2649.                                 4.2.3.1 Label                                 
  2650. ------------------------------------------------------------------------------
  2651.  
  2652. Label gadget parameters.
  2653. -------------------------
  2654.  
  2655. IDME
  2656.  
  2657. Force this object to be assigned a GID. Normaly no GID is assigned to labels. 
  2658. The definition reply becomes 'ok GID WIDTH HEIGHT'
  2659.  
  2660. The label produces an image and usually puts it into your GUI right away. To 
  2661. use the label as a child label of a gadget You MUST use the unattached 
  2662. keyword.
  2663.  
  2664. unattached (ua)
  2665.  
  2666. The unattached keyword does not produce a gadget. It creates an image to be 
  2667. used. Up to 50 images can be predefined, the last one defined is the first 
  2668. one used. Last In First Out. No GID is assigned EVEN WITH 'IDME'.
  2669.  
  2670. font=GID
  2671.  
  2672. This sets the font for the label. The GID points to an ALREADY defined text 
  2673. attribute.
  2674.  
  2675. Selected=num (s=)
  2676.  
  2677.  Set the pen number used to render the text.
  2678.  
  2679. SoftStyle=num (ss=)
  2680.  
  2681.  Set the soft style for the label. This is a bitmaped decimal number.
  2682. example 3=bold + underline
  2683.             decimal    bit
  2684. NORMAL       0          -
  2685. UNDERLINED   1          0
  2686. BOLD         2          1
  2687. ITALIC       4          2
  2688. EXTENDED     8          3
  2689.  
  2690. gadgettext="Label text"  (gt=)
  2691.  
  2692.  Set the text of the Label.
  2693.  
  2694. underscore="CHAR"
  2695.  
  2696.  Use an alternate character to flag the hotkey for the label. CHAR is a 
  2697. single character. This defaults to underscore '_', changing it will allow an 
  2698. underscore to be used as a plain character in a label.
  2699.  
  2700. leftjustify  (lj)
  2701. rightjustify (rj)
  2702.  
  2703.  Set the justification of the text for the gadget. Defaults to centerjustify.
  2704.  
  2705. minwidth=number  (minw=)
  2706.  
  2707.  Set the minimum width for this gadget
  2708.  
  2709. minheight=number (minh=)
  2710.  
  2711.  Set the minimum height for this gadget
  2712.  
  2713. weightedwidth=number  (weiw=)
  2714.  
  2715.  Set the weighted width for this gadget
  2716.  
  2717. weightedheight=number (weih=)
  2718.  
  2719.  Set the weighted height for this gadget
  2720.  
  2721. nominalsize  (noms)
  2722.  
  2723.  Set this gadget to its nominal size.
  2724.  
  2725. useimage   (ui)
  2726.  
  2727.  Use the last defined image (bitmap/drawlist/penmap) as the gadgets image.
  2728.  
  2729. Even
  2730.  
  2731.  Correct a possible layout problem in the image position. You will probably 
  2732. never use this parameter. Technically it moves th image up one pixel, which 
  2733. is useful when mixing different fonts in the same line.
  2734.  
  2735. Definition Reply
  2736. ----------------
  2737.  
  2738.  When the image creation is successful the pipe replies with
  2739.  
  2740. 'ok WIDTH HEIGHT'
  2741.  
  2742.  
  2743. ------------------------------------------------------------------------------
  2744.                                 4.2.3.2 Glyph                                 
  2745. ------------------------------------------------------------------------------
  2746.  
  2747. Glyph parameters
  2748. -------------------
  2749.  
  2750. The glyph keyword does not produce a gadget. It creates an image to be used 
  2751. later. Up to 50 images can be predefined, the last one defined is the first 
  2752. one used. Last In First Out.
  2753.  
  2754. defnumber=number (defnum)
  2755.  
  2756.  Choose the image this glyph displays. the possible values number are
  2757.  
  2758. 0 NONE
  2759. 1 DOWNARROW
  2760. 2 UPARROW
  2761. 3 LEFTARROW
  2762. 4 RIGHTARROW
  2763. 5 DROPDOWN
  2764. 6 POPUP
  2765. 7 CHECKMARK
  2766. 8 POPFONT
  2767. 9 POPFILE
  2768. 10 POPDRAWER
  2769. 11 POPSCREENMODE
  2770. 12 POPTIME
  2771. 13 RADIOBUTTON
  2772. 14 RETURNARROW
  2773.  
  2774. Definition Reply
  2775. -----------------
  2776.  
  2777.  When the image creation is successful the pipe replies with
  2778.  
  2779. 'ok '
  2780.  
  2781.  
  2782. ------------------------------------------------------------------------------
  2783.                                4.2.3.3 DrawList                               
  2784. ------------------------------------------------------------------------------
  2785.  
  2786. DrawList parameters
  2787. -------------------
  2788.  
  2789. The drawlist keyword does not produce a gadget. It creates an image to be 
  2790. used later. Up to 50 images can be predefined, the last one defined is the 
  2791. first one used. Last In First Out.
  2792.  
  2793. bindata (bd)
  2794.  
  2795. The drawlistdata will be passed to this pipe in binary after the command 
  2796. line. The drawlistdata parameter now gives the length of the data. Setting 
  2797. datain means the data is read from an external file rather than the pipe.
  2798.  
  2799. dataout="filename" (do=)
  2800.  
  2801.  Send the data for this gadget to a file. This is a development tool to allow 
  2802. you to create binary data to pass to the pipe. It is ignored if the Bindata 
  2803. keyword is also present.
  2804.  
  2805. datain="filename" (di=)
  2806.  
  2807.  Read the data for this gadget from a file. It is ignored if the Bindata 
  2808. keyword is not present.
  2809.  
  2810. minheight=number (minh)
  2811.  
  2812.  Set the height of the virtual raster the drawlist data
  2813. relates to.
  2814.  
  2815. minwidth=number (minw)
  2816.  
  2817.  Set the width of the virtual raster the drawlist data relates
  2818. to.
  2819.  
  2820. drawlistdata="value1|value2|..."   (dld=)
  2821.  
  2822.  The draw list data defines a set of drawing instruction to create an image. 
  2823. Each drawing instruction has 6 values.
  2824. directive|X1|Y1|X2|Y2|pen
  2825.  
  2826. The possible directives are
  2827.  
  2828. 0 END
  2829. 1 LINE
  2830. 2 RECT
  2831. 3 FILL
  2832. 4 ELLIPSE
  2833. 5 CIRCLE
  2834. 6 LINEPAT
  2835. 7 FILLPAT
  2836. 8 AMOVE
  2837. 9 ADRAW
  2838. 10 AFILL
  2839. 11 BEVELBOX
  2840. 12 ARC
  2841. 13 START = BOUNDS
  2842. 14 LINESIZE
  2843.  
  2844. Register as a Class Act developer and read the docs for more info on 
  2845. drawlists.
  2846.  
  2847. When sending binary data you send an array of structure DrawLists.
  2848.  
  2849. struct DrawList
  2850.             {
  2851.                 WORD dl_Directive;
  2852.                 WORD dl_X1, dl_Y1;
  2853.                 WORD dl_X2, dl_Y2;
  2854.                 WORD dl_Pen;
  2855.             };
  2856. The last structure MUST be END (dl_Directive=0).
  2857.  
  2858. Definition Reply
  2859. -----------------
  2860.  
  2861.  When the image creation is successful the pipe replies with
  2862.  
  2863. 'ok'
  2864.  
  2865.  
  2866.  
  2867. ------------------------------------------------------------------------------
  2868.                                 4.2.3.4 PenMap                                
  2869. ------------------------------------------------------------------------------
  2870.  
  2871. PenMap parameters
  2872. -------------------
  2873.  
  2874. The penmap keyword does not produce a gadget.  It creates an image to be used 
  2875. later. Up to 50 images can be predefined, the last one defined is the first 
  2876. one used. Last In First Out.
  2877.  
  2878. bindata (bd)
  2879.  
  2880. The PenMapPalette,penmapdata, and selectedimage  will be passed to this pipe 
  2881. in binary after the command line, AND IN THAT ORDER. The 
  2882. penmapdata,selectedimage, and PenMapPalette parameters now give the length of 
  2883. each data segment. Do NOT specify a data length of 0 for selected image, omit 
  2884. the keyword instead.
  2885.  
  2886. dataout="filename" (do)
  2887.  
  2888.  Send the data for this gadget to a file. This is a development tool to allow 
  2889. you to create binary data to pass to the pipe. It is ignored if the Bindata 
  2890. keyword is also present.
  2891.  
  2892. penmapdata="data" (pmd)
  2893.  
  2894. The image data. NOTE all values are ascii HEX. The data is in the following 
  2895. format.
  2896.  
  2897. "width_h_byte|width_l_byte|height_h_byte|height_l_byte|data1|data2..."
  2898.  
  2899. If the bindata keyword is used the image data is the following format
  2900.  
  2901. word width, height;
  2902. char data[];
  2903.  
  2904. Note the size specified in penmapdata INCLUDES the 4 bytes for width and 
  2905. height.
  2906.  
  2907. selectedimage="data" (si)
  2908.  
  2909. The image data for a selected image. NOTE all values are ascii HEX. The data 
  2910. is in the following format.
  2911.  
  2912. "width_h_byte|width_l_byte|height_h_byte|height_l_byte|data1|data2..."
  2913.  
  2914. If the bindata keyword is used the image data is the same format as
  2915. for penmapdata.
  2916.  
  2917. PenMapPalette="data" (pmp)
  2918.  
  2919. The palate data. NOTE all values are ascii HEX. The data is in the following 
  2920. format.
  2921.  
  2922. "triplet_count|red1|green1|blue1|red2|..."
  2923.  
  2924. If the bindata keyword is used the palate data is the format
  2925.  
  2926.            ULONG palette[] =
  2927.            {
  2928.                number_triplets,
  2929.                red1, green1, blue1,
  2930.                red2, green2, blue2,
  2931.                ...
  2932.            };
  2933.  
  2934.  
  2935.  
  2936. Trans
  2937.  
  2938.  Make pen 0 transparent.
  2939.  
  2940.  
  2941. ------------------------------------------------------------------------------
  2942.                                 4.2.3.5 Bitmap                                
  2943. ------------------------------------------------------------------------------
  2944.  
  2945. BitMap parameters
  2946. -------------------
  2947.  
  2948. The bitmap keyword does not produce a gadget. It creates an image to be used 
  2949. later. Up to 50 images can be predefined, the last one defined is the first 
  2950. one used. Last In First Out.
  2951.  
  2952. FileName='path:file' (fn)
  2953.  
  2954.  The file to read and produce an image from using datatypes.
  2955.  
  2956. selectedimage='path:file' (si)
  2957.  
  2958.  The file to read and produce the selected image from using datatypes.
  2959.  
  2960. trans
  2961.  
  2962. Make the image background transparent
  2963. (if the associated image and datatype allows this).
  2964.  
  2965. Part="x|y|wide|high|offsetx|offsety|buffer"
  2966.  
  2967. x,y              the left and top pixel of the first image.
  2968. wide,high        the size of the images.
  2969. offsetx,offsety  the offset to the selected state image.
  2970. buffer           the buffer used to store the root bitmap. (0-9)
  2971.                  ( buffer 0 is also used for button animations )
  2972.  
  2973.  Use portions of a bitmap for this image.
  2974.  
  2975. The image is only part of the root bitmap specified by x|y|wide|high, the 
  2976. offsets can be set to 0 to make the normal and selected state the same.
  2977.  
  2978. filename="" will cause this image to use the next available predefined bitmap
  2979. for the root bitmap. (only with 'part')
  2980.  
  2981. Not including a file name at all will reuse an existing root bitmap. This 
  2982. allows you to only load one bitmap with a images needed. You can then reuse 
  2983. parts mutiple times. Also you only need to have a single image file for most 
  2984. applications rather than several small ones.(only with part)
  2985.  
  2986.  It is possible to redefine an image buffer. When this is done the previous 
  2987. contents of the image buffer are saved before the new bitmap is created. See 
  2988. the freeimage modify command for more information on handling image buffers.
  2989.  
  2990. Definition Reply
  2991. -----------------
  2992.  
  2993.  When the image creation is successful the pipe replies with
  2994.  
  2995. 'ok BITMAP_width BITMAP_height'
  2996.  
  2997.  
  2998. ------------------------------------------------------------------------------
  2999.                                 4.2.3.6 Image                                 
  3000. ------------------------------------------------------------------------------
  3001.  
  3002. Image gadget parameters.
  3003. -------------------------
  3004.  
  3005. You must first define an image before you can produce an image gadget. The 
  3006. last defined image is placed into the GUI.
  3007.  
  3008. IDME
  3009.  
  3010. Force this object to be assigned a GID. Normaly no GID is assigned to Images. 
  3011. The definition reply becomes 'ok GID'
  3012.  
  3013. minwidth=number  (minw=)
  3014.  
  3015.  Set the minimum width for this gadget
  3016.  
  3017. minheight=number (minh=)
  3018.  
  3019.  Set the minimum height for this gadget
  3020.  
  3021. weightedwidth=number  (weiw=)
  3022.  
  3023.  Set the weighted width for this gadget
  3024.  
  3025. weightedheight=number (weih=)
  3026.  
  3027.  Set the weighted height for this gadget
  3028.  
  3029. nominalsize  (noms)
  3030.  
  3031.  Set this gadget to its nominal size.
  3032.  
  3033. Definition Reply
  3034. -----------------
  3035.  
  3036.  When the gadget creation is successful the pipe replies with
  3037.  
  3038. 'ok'
  3039.  
  3040. ------------------------------------------------------------------------------
  3041.                                 4.2.3.7 Space                                 
  3042. ------------------------------------------------------------------------------
  3043.  
  3044.  
  3045. Space gadget parameters.
  3046. -------------------------
  3047.  
  3048. IDME
  3049.  
  3050. Force this object to be assigned a GID. Normaly no GID is assigned to spaces. 
  3051. The definition reply becomes 'ok GID'
  3052.  
  3053. trans
  3054.  
  3055.  Turn transparency on for this space.
  3056.  
  3057. minwidth=number  (minw=)
  3058.  
  3059.  Set the minimum width for this gadget
  3060.  
  3061. minheight=number (minh=)
  3062.  
  3063.  Set the minimum height for this gadget
  3064.  
  3065. bevel=TYPE  (b=)
  3066.  
  3067.  Set the bevel type for this gadget. Defaults to none.
  3068. 0=NONE
  3069. 1=THIN
  3070. 2=BUTTON
  3071. 3=GROUP
  3072. 4=FIELD
  3073. 5=DROPBOX
  3074. 6=SBAR_HORIZ
  3075. 7=SBAR_VERT
  3076. 8=BOX
  3077. 9=STANDARD
  3078.  
  3079.  
  3080. Definition Reply
  3081. -----------------
  3082.  
  3083.  When the gadget creation is successful the pipe replies with
  3084.  
  3085. 'ok'
  3086.  
  3087. ------------------------------------------------------------------------------
  3088.                                 4.2.4 Special                                 
  3089. ------------------------------------------------------------------------------
  3090.  
  3091.  
  3092. ------------------------------------------------------------------------------
  3093.                              4.2.4.1 Layout(End)                              
  3094. ------------------------------------------------------------------------------
  3095.  
  3096. LayOutEnd parameters
  3097. ----------------------
  3098.  
  3099. LayOutEnd=le=pg
  3100.  
  3101. (pg is for historical reasons)
  3102.  
  3103. This ends the current layout group. It takes no parameters.
  3104.  
  3105. layout parameters.
  3106. -------------------------
  3107.  
  3108. Layouts can be nested up to 50 deep.
  3109.  
  3110. page=GID
  3111.  
  3112.  Use this layout group as a page in the Clicktab gadget specified by GID.
  3113.  
  3114. selected=number (s=)
  3115.  
  3116.  The clicktab page to be displayed on startup, defaults to 0. Ignored unless 
  3117. page is also specified. It is only useful when adding the final page to a 
  3118. clicktab.
  3119.  
  3120. font=GID
  3121.  
  3122. This sets the font for the whole group. The GID points to an ALREADY defined 
  3123. text attribute.
  3124.  
  3125.  
  3126. bevel=TYPE  (b=)
  3127.  
  3128.  Set the bevel type for this gadget.
  3129. 0=NONE
  3130. 1=THIN
  3131. 2=BUTTON
  3132. 3=GROUP
  3133. 4=FIELD
  3134. 5=DROPBOX
  3135. 6=SBAR_HORIZ
  3136. 7=SBAR_VERT
  3137. 8=BOX
  3138. 9=STANDARD
  3139.  
  3140.  
  3141. gadgettext="group label" (gt=)
  3142.  
  3143.  set the group label for this group. Ignored if nobevel is
  3144. set.
  3145.  
  3146. labr
  3147. labl
  3148. labc
  3149.  
  3150.  Set the position of the layout label (topleft/topright/topcenter). Defaults 
  3151. to the users prefs setting, so don't set/force this unless you really need 
  3152. to..
  3153.  
  3154. defn=PEN
  3155.  
  3156. The pen number to use when backfilling this layout.
  3157.  
  3158. fpat="HEX"
  3159.  
  3160.  The fill pattern to backfill this layout. A 24 bit hexidecimal number, 
  3161. interpeted as a 16 x 2 pattern. fpat is ignored unless defn is also 
  3162. specified.
  3163.  
  3164. minwidth=number (minw=)
  3165.  
  3166.  Set the minimum width for this gadget
  3167.  
  3168. minheight=number (minh=)
  3169.  
  3170.  Set the minimum height for this gadget
  3171.  
  3172. weightedwidth=number (weiw=)
  3173.  
  3174.  Set the weighted width for this gadget
  3175.  
  3176. weightedheight=number (weih=)
  3177.  
  3178.  Set the weighted height for this gadget
  3179.  
  3180. nominalsize (noms)
  3181.  
  3182.  Set this gadget to its nominal size.
  3183.  
  3184. SpaceOuter (so)
  3185.  
  3186.  Leave a blank space outside the layout group.
  3187.  
  3188. SpaceInner  (si)
  3189.  
  3190.  Leave a blank space around elements in the layout group.
  3191.  
  3192. disable=number (dis=)
  3193.  
  3194.  The gadgets in this layout are enabled if number = 0 , disabled if number != 
  3195. 0. Defaults to enabled.
  3196.  
  3197. centerjustify  (cj)
  3198. rightjustify   (rj)
  3199. bottomjustify  (bj)
  3200.  
  3201.  Set the justification of the gadgets in this layout. Defaults to leftjustify 
  3202. or topjustify.
  3203.  
  3204. vertical      (v)
  3205.  
  3206.  Switch to display gadgets vertically, defaults to horizontal.
  3207.  
  3208. even      (e)
  3209.  
  3210.  Switch to make gadgets/groups all the same size.
  3211.  
  3212. shrinkwrap  (sw)
  3213.  
  3214.  Switch to cause gadgets in this group to have no space between them.
  3215.  
  3216. tags="tags|data[|tag|data...]|0
  3217.  
  3218.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3219.  
  3220. childlabel    (chl)
  3221. childlabelr   (chlr)
  3222.  
  3223.  Use the previously defined image as a childlabel for this gadget. Display 
  3224. the childlabel to the right or left of the gadget.
  3225.  
  3226. replace=GID
  3227.  
  3228.  Use this gadget to replace an existing gadget specified by GID.
  3229.  
  3230. Definition Reply
  3231. -----------------
  3232.  
  3233.  When the gadget creation is successful the pipe replies with
  3234.  
  3235. 'ok GID'
  3236.  
  3237.  LayoutEnd replies with
  3238.  
  3239. 'ok'
  3240.  
  3241. layout modify parameters.
  3242. -------------------------
  3243.  
  3244. disable=number (dis=)
  3245.  
  3246.  The gadgets in this layout are enabled if number = 0 , disabled if number != 
  3247. 0. Defaults to enabled.
  3248.  
  3249. refresh (ref)
  3250.  
  3251.  
  3252. ------------------------------------------------------------------------------
  3253.                                4.2.4.2 ClickTab                               
  3254. ------------------------------------------------------------------------------
  3255.  
  3256. ClickTab gadget event
  3257. -------------------------
  3258.  
  3259. 'gadget GID selected_page'
  3260.  
  3261. ClickTab gadget parameters.
  3262. -------------------------
  3263.  
  3264. This actually creates a pair of connected gadgets, a clicktab->pagegadget. 
  3265. Each tab labels will display a different page in the page gadget. See parent 
  3266. group for how
  3267. to attach a page to a clicktab gadget.
  3268.  
  3269. font=GID
  3270.  
  3271. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3272. attribute.
  3273.  
  3274. readonly (ro)
  3275.  
  3276.  This gadget is read only.
  3277.  
  3278. disable=number (dis=)
  3279.  
  3280.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3281. enabled.
  3282.  
  3283. ClickTabLabels="choice0|choice1|choice..." (ctl)
  3284.  
  3285.  Set the choices for the gadget. This parameter MUST be given.
  3286.  
  3287. minwidth=number (minw=)
  3288.  
  3289.  Set the minimum width for this gadget
  3290.  
  3291. minheight=number (minh=)
  3292.  
  3293.  Set the minimum height for this gadget
  3294.  
  3295. weightedwidth=number (weiw=)
  3296.  
  3297.  Set the weighted width for this gadget
  3298.  
  3299. weightedheight=number (weih=)
  3300.  
  3301.  Set the weighted height for this gadget
  3302.  
  3303. nominalsize (noms)
  3304.  
  3305.  Set this gadget to its nominal size.
  3306.  
  3307. replace=GID
  3308.  
  3309.  Use this gadget to replace an existing gadget specified by GID.
  3310.  
  3311. Definition Reply
  3312. -----------------
  3313.  
  3314.  When the gadget creation is successful the pipe replies with
  3315.  
  3316. 'ok GID'
  3317.  
  3318. ClickTab gadget modify parameters.
  3319. -------------------------
  3320.  
  3321. disable=number (dis=)
  3322.  
  3323.  The gadget is enabled if number = 0 , disabled if number != 0.
  3324.  
  3325. NOTE: when you disable a layout, Clicktab gadgets in the layout do not
  3326. properly disable themselves (CA/Reaction bug?). You must manualy disable the
  3327. clicktabs your self.
  3328.  
  3329. target=number  (tar=)
  3330.  
  3331.  When used with disable only the targeted tab is enabled or disabled. If
  3332. target is not specified all tabs will be disabled or enabled.
  3333.  
  3334. selected=number  (s=)
  3335.  
  3336.  Set the page displayed by the clicktab gadget.
  3337.  
  3338. refresh (ref)
  3339.  
  3340.  Redraw the gadget.
  3341.  
  3342. ------------------------------------------------------------------------------
  3343.                                4.2.4.3 TextAttr                               
  3344. ------------------------------------------------------------------------------
  3345.  
  3346. TextAttr parameters.
  3347. -------------------------
  3348.  
  3349. gadgettext="fontname"  (gt=)
  3350.  
  3351. This text defines the font.  Remember the '.font' like 'gt=topaz.font'
  3352.  
  3353. defnumber=number  (defn=)
  3354.  
  3355. The font size attribute.
  3356.  
  3357. selected="number"  s=
  3358.  
  3359. The fonts style attributes. Sorry it a decimal number...
  3360.  
  3361. Definition Reply
  3362. -----------------
  3363.  
  3364.  When the gadget creation is successful the pipe replies with
  3365.  
  3366. 'ok GID HEXADDRESS'
  3367.  
  3368. The address allows you to use the text attribute with the 'set' modify 
  3369. command.
  3370.  
  3371.  The same text attribute can be used to specify a font for many gadgets.
  3372.  
  3373. ------------------------------------------------------------------------------
  3374.                              4.2.4.4 BrowserNode                              
  3375. ------------------------------------------------------------------------------
  3376.  
  3377. BrowserNode gadget parameters.
  3378. -------------------------
  3379.  
  3380.  Browsernodes always belong to last defined listbrowser. NEVER use the 
  3381. BrowserNode keyword after you GUI window has opened. Use the AddNode modify 
  3382. command instead.
  3383.  
  3384. selected=number (s=)
  3385.  
  3386.   The node is selected if number != 0 , unselected if number = 0. Defaults to 
  3387. unselected.
  3388.  
  3389.  
  3390.   Set which choice is selected when the window opens. This is only for 
  3391. multiple select list browsers. Set selected in the Listbrowser definition for 
  3392. single select lists.
  3393.  
  3394. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  3395.  
  3396.  Set the text(s). This parameter MUST be given. YOU MUST NOT GIVE MORE TEXTS 
  3397. THAN THE AMOUNT OF COLUMNS IN THE LISTBROWSER. A leading '^' makes the text 
  3398. editable. A leading '¶' (ALT p) uses the last defined image for the column 
  3399. rather than text. Note that images used in browsernodes can not be more than 
  3400. 255 pixels high. (hint: split larger images and use more than one node)
  3401.  
  3402. NOTE: the following parameters may only be used if the ListBrowser containing 
  3403. the node allows parenting.
  3404.  
  3405. defnumber=number  (defn=)
  3406.  
  3407.  Set the Generation of this browser node.
  3408.  
  3409. browsernodeparent  (bnp)
  3410.  
  3411.  This browser node has children.
  3412.  
  3413. Definition Reply
  3414. -----------------
  3415.  
  3416.  When the node creation is successful the pipe replies with
  3417.  
  3418. 'ok GID'
  3419.  
  3420. BrowserNode gadget modify parameters.
  3421. -------------------------------------
  3422.  
  3423. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  3424.  
  3425.  Set the text(s). YOU MUST NOT GIVE MORE TEXTS THAN THE AMOUNT OF COLUMNS IN 
  3426. THE LISTBROWSER. A leading '^' makes the text editable. A leading '¶' (ALT p) 
  3427. uses the last defined image for the column rather than text. Note that images 
  3428. used in browsernodes can not be more than 255 pixels high. (hint: split 
  3429. larger images and use more than one node)
  3430.  
  3431. removenode (remn)
  3432.  
  3433.  remove this browsernode from its ListBrowser
  3434.  
  3435. selected=number (s=)
  3436.  
  3437.   The node is selected if number != 0 , unselected if number = 0. This is 
  3438. only for nodes in multi select listbrowsers, for single select browsers see 
  3439. the listbrowser modify docs.
  3440.  
  3441. read
  3442. sort=COLUMN#
  3443.  
  3444.  To read a browser node you must also specify a column. The text contents of
  3445. that column are returned.
  3446.  
  3447. refresh (ref)
  3448.  
  3449.  Refresh this listnodes listbrowser (not just the node itself). When setting 
  3450. multiple nodes in a multiselect listbrowser only refresh when you set the 
  3451. last node. This avoids multiple refreshes.
  3452.  
  3453. hidechild=num (hc=)
  3454.  
  3455.  If num =0 show all this nodes children . If num >0 then hide all this nodes 
  3456. children.
  3457.  
  3458. ------------------------------------------------------------------------------
  3459.                                  4.2.4.5 Menu                                 
  3460. ------------------------------------------------------------------------------
  3461.  
  3462. Menu gadget event
  3463. -------------------------
  3464.  
  3465. 'menu menu_number item_number sub_item_number checked'
  3466.  
  3467. checked=0 Item is not checked
  3468. checked=1 Item is checked
  3469.  
  3470. Menu gadget parameters.
  3471. -------------------------
  3472.  
  3473. gadgettext="menudata"  (gt=)
  3474.  
  3475. This text defines a menu for the CA window. The data is the following format.
  3476.  
  3477. menu_title|menu_item0|menu_item1 ...
  3478.  
  3479. Each menu_item is the following format
  3480.  
  3481. [@hotkey][$][-][^][%][&][!][`][#HEX_number#]menu_item_title
  3482.  
  3483. @ = hotkey for menu, following character is hotkey.
  3484. $ =  sub Item (of previous menu_item)
  3485. - =  Display a separator bar (ignore text and other options for this item )
  3486. ^ =  menu toggle
  3487. % =  menu checkable (unchecked at startup)
  3488. & =  menu checkable (checked at startup)
  3489. ! =  highlight none
  3490. ` =  disabled
  3491. # =  mutual exclude. Note the trailing '#' MUST be used.
  3492. If multiple flags are set they MUST be in the order shown.
  3493.  
  3494. Note: '`' is the only flag that may be set for the menu title.
  3495. Note: Separator bars are considered a menu item. Example
  3496.  
  3497. gt="dothis|-|dothat"
  3498. dothis is item 0, the bar is item 1, dothat is item 2.
  3499.  
  3500. replace=GID
  3501.  
  3502.  Use this menu to replace an existing menu specified by GID.
  3503.  
  3504. Menu gadget modify parameters.
  3505. -------------------------
  3506.  
  3507. disable=number (dis=)
  3508.  
  3509.  The menu or menu item is enabled if number = 0 , disabled if number != 0.
  3510.  
  3511. selected=number (s=)
  3512.  
  3513.   The menu item is checked if number != 0 , unchecked if number = 0. Ignored 
  3514. if a target is not specified.
  3515.  
  3516. target=number  (tar=)
  3517.  
  3518.  If a target is specified you are modifying a menu item. If a target is not 
  3519. specified you are modifying the menu itself.
  3520.  
  3521. ------------------------------------------------------------------------------
  3522.                                 4.2.4.6 Arexx                                 
  3523. ------------------------------------------------------------------------------
  3524.  
  3525. Arexx event  stream
  3526. -------------------
  3527.  
  3528. Arexx events are handled differently than other types of events, be careful.
  3529.  
  3530. The events are as follows.
  3531.  
  3532.  
  3533. 'arexx FID textlength <newline> text'
  3534.  
  3535.     FID is the function ID number
  3536.  
  3537.     textlength is the length of the text after the newline character.
  3538.  
  3539.  
  3540. If modify is turned on, after each event you MUST write a single line to the 
  3541. pipe in the following format.
  3542.  
  3543. 'rc=number result="(result text|length)" [bd]'
  3544.  
  3545. If rc > 0 result is ignored, if RC is omitted it defaults to 0.
  3546.  
  3547. If the bd (binary data) keyword is given result MUST be the length of the 
  3548. data to be returned, and you then MUST write length chars of data to the 
  3549. pipe.
  3550.  
  3551. The pipe replies with 'ok' to your result line (unless quiet is set).
  3552.  
  3553. If modify is not turned on all arexx events are given a rc of 0 (success) and 
  3554. a null result.
  3555.  
  3556. Arexx object parameters.
  3557. -------------------------
  3558.  
  3559. gadgettext="HOSTNAME|Function0|Function1|..."  (gt=)
  3560.  
  3561. The gadget text defines the arexx host name and the functions available. 
  3562. Hostname should be all capitals, function names should not contain spaces. 
  3563. The first function is FID 0, the second FID 1, ...
  3564.  
  3565. slot
  3566.  
  3567. This switch causes a slot number to appended to the host name. TESTHOST would 
  3568. become TESTHOST.1 or TESTHOST.2 etc.
  3569.  
  3570. Arexx definition Reply
  3571. ----------------------
  3572.  
  3573.  When the ARexx object creation is successful the pipe replies with
  3574.  
  3575. 'ok HOSTNAME'
  3576.  
  3577. NOTE only one arexx host can be defined for each GUI window.
  3578.  
  3579. Additional info
  3580. ---------------------
  3581.  
  3582. To have a arexx host with no GUI window, set the NoWindow switch in the 
  3583. window definition.  See the window docs for more information.
  3584.  
  3585. ------------------------------------------------------------------------------
  3586.                                  4.2.5 Fancy                                  
  3587. ------------------------------------------------------------------------------
  3588.  
  3589.  
  3590. ------------------------------------------------------------------------------
  3591.                                4.2.5.1 GetFile                                
  3592. ------------------------------------------------------------------------------
  3593.  
  3594. There are actually two file requesters available in AWNPipe. The 
  3595. ClassAct/Reaction getfile.gadget, and the ASL file requester. Only the 
  3596. getfile.gadget can be displayed in a gui. Both can be opened under your 
  3597. control to present the user with a file requester. The details for the ASL 
  3598. requester are at the end of this file.
  3599.  
  3600.   *** GETFILE GADGET CLASS ***
  3601.  
  3602. GetFile gadget event.
  3603. -------------------------
  3604.  
  3605. 'gadget GID  success ["filename" ["filename" ...]]'
  3606.  
  3607.  Success=0 user selected no file or canceled.
  3608.  Success!=0 user selected a file.
  3609. Filenames are fully qualified with path.
  3610.  
  3611. GetFile gadget parameters.
  3612. -------------------------
  3613.  
  3614. font=GID
  3615.  
  3616. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3617. attribute.
  3618.  
  3619.  
  3620. readonly (ro)
  3621.  
  3622.  This gadget is read only.
  3623.  
  3624. disable=number (dis=)
  3625.  
  3626.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3627. enabled.
  3628.  
  3629. gadgettext="file requester title" (gt=)
  3630.  
  3631.  Set the title of the file requester.
  3632.  
  3633. pattern="pattern" (pat=)
  3634.  
  3635.  Set and Enable pattern matching in the file.
  3636.  
  3637. multi  (m)
  3638.  
  3639.  Allow multi selection in the file requester. (does not seem to work)
  3640.  
  3641. save
  3642.  
  3643.  This is a save requester.
  3644.  
  3645. drawers (dr)
  3646.  
  3647.  Only show and allow selections of drawers.
  3648.  
  3649. icons (i)
  3650.  
  3651.  Do NOT show .info files.
  3652.  
  3653. filename="path:filename" (fn=)
  3654.  
  3655.  Set the filename and directory for the file requester. It must end in a '/' 
  3656. for drawer only file requesters
  3657.  
  3658. Wide=num
  3659. High=num
  3660.  
  3661.  Set the size of the requester when opened.
  3662.  
  3663. unattached    (ua)
  3664.  
  3665.  This file requester is not attached to the CA window. It may still be 
  3666. activated in the modify conversation.
  3667.  
  3668. minwidth=number (minw=)
  3669.  
  3670.  Set the minimum width for this gadget
  3671.  
  3672. minheight=number (minh=)
  3673.  
  3674.  Set the minimum height for this gadget
  3675.  
  3676. weightedwidth=number (weiw=)
  3677.  
  3678.  Set the weighted width for this gadget
  3679.  
  3680. weightedheight=number (weih=)
  3681.  
  3682.  Set the weighted height for this gadget
  3683.  
  3684. nominalsize (noms)
  3685.  
  3686.  Set this gadget to its nominal size.
  3687.  
  3688. tags="tags|data[|tag|data...]|0
  3689.  
  3690.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3691.  
  3692. childlabel    (chl)
  3693. childlabelr   (chlr)
  3694.  
  3695.  Use the previously defined image as a childlabel for this gadget. Display 
  3696. the childlabel to the right or left of the gadget.
  3697.  
  3698. replace=GID
  3699.  
  3700.  Use this gadget to replace an existing gadget specified by GID.
  3701.  
  3702. Definition Reply
  3703. -----------------
  3704.  
  3705.  When the gadget creation is successful the pipe replies
  3706. with
  3707.  
  3708. 'ok GID'
  3709.  
  3710. GetFile gadget modify parameters.
  3711. -------------------------
  3712.  
  3713. selected=number (sel=)
  3714.  
  3715. This modify command is only valid for UNATTACHED getfile gadgets. Number is 
  3716. ignored but must be given. This opens the file requester and the selected 
  3717. files are returned rather than a simple ok.
  3718. You should not use other modify instructions on the same line as 'selected'.
  3719.  
  3720. NOTE: You can not force an attached getfile to open.
  3721.  
  3722. disable=number (dis=)
  3723.  
  3724.  The gadget is enabled if number = 0 , disabled if number != 0.
  3725.  
  3726. save=number
  3727.  
  3728.  If number=0 this is NOT a save requester. If number~=0 this is a save 
  3729. requester.
  3730.  
  3731. filename="path:filename" (fn=)
  3732.  
  3733.  Set the filename and directory for the file requester.
  3734.  
  3735. gadgettext="title" (gt=)
  3736.  
  3737.  Set the file requesters title.
  3738.  
  3739.  
  3740.   *** GETFILE ASL ***
  3741.  
  3742. The ASL requester does not send events.
  3743.  
  3744. GetFile ASL parameters.
  3745. -------------------------
  3746.  
  3747. ASL
  3748.  
  3749.   This tells AWNP you want to define an ASL file requester.
  3750.  
  3751. font=GID
  3752.  
  3753. This sets the font for the gadget. The GID points to an ALREADY defined text 
  3754. attribute.
  3755.  
  3756.  
  3757. gadgettext="file requester title" (gt=)
  3758.  
  3759.  Set the title of the file requester.
  3760.  
  3761. pattern="pattern" (pat=)
  3762.  
  3763.  Set and Enable pattern matching in the file.
  3764.  
  3765. multi  (m)
  3766.  
  3767.  Allow multi selection in the file requester. (does not seem to work)
  3768.  
  3769. save
  3770.  
  3771.  This is a save requester.
  3772.  
  3773. drawers (dr)
  3774.  
  3775.  Only show and allow selections of drawers.
  3776.  
  3777. icons (i)
  3778.  
  3779.  Do NOT show .info files.
  3780.  
  3781. filename="path:filename" (fn=)
  3782.  
  3783.  Set the filename and directory for the file requester. It must end in a '/' 
  3784. for drawer only file requesters
  3785.  
  3786. Wide=num
  3787. High=num
  3788.  
  3789.  Set the size of the requester when opened.
  3790.  
  3791. top=num
  3792. left=num
  3793.  
  3794.  Set the position of the requester when it opens.
  3795.  
  3796. postx="positive text"
  3797.  
  3798.  Set the text for the positive choice in the file requester. Defaults to OK.
  3799.  
  3800. negtx="negative text"
  3801.  
  3802.  Set the text for the positive choice in the file requester. Defaults to 
  3803. Cancel
  3804.  
  3805. Definition Reply
  3806. -----------------
  3807.  
  3808.  When the gadget creation is successful the pipe replies
  3809. with
  3810.  
  3811. 'ok GID'
  3812.  
  3813. GetFile ASL modify parameters.
  3814. -------------------------
  3815.  
  3816.  You can only modify the ASL getfile requester when opening it. Unless the 
  3817. selected keyword is present the modify line is ignored.
  3818.  
  3819.  
  3820. selected=number (sel=)
  3821.  
  3822. Number is ignored but must be given. This opens the file requester and you 
  3823. get returned the following line rather than a simple ok.
  3824.  
  3825. SUCCESS "path:drawer/filename" "path2:drawer2/filename2"  ...
  3826.  
  3827. SUCCESS=0 if the user aborted the file requester without making a selection. 
  3828. SUCCESS !=0 if the user selected a file, each file name is quoted and all are 
  3829. on a single line.
  3830.  
  3831. save=number
  3832.  
  3833.  If number=0 this is NOT a save requester. If number~=0 this is a save 
  3834. requester.
  3835.  
  3836. filename="path:filename" (fn=)
  3837.  
  3838.  Set the filename and directory for the file requester.
  3839.  
  3840. gadgettext="title" (gt=)
  3841.  
  3842.  Set the file requesters title.
  3843.  
  3844. Wide=num
  3845. High=num
  3846.  
  3847.  Set the size of the requester when opened.
  3848.  
  3849. top=num
  3850. left=num
  3851.  
  3852.  Set the position of the requester when it opens.
  3853.  
  3854. postx="positive text"
  3855.  
  3856.  Set the text for the positive choice in the file requester. Defaults to OK.
  3857.  
  3858. negtx="negative text"
  3859.  
  3860.  Set the text for the positive choice in the file requester. Defaults to 
  3861. Cancel
  3862.  
  3863.  
  3864. ------------------------------------------------------------------------------
  3865.                                4.2.5.2 GetFont                                
  3866. ------------------------------------------------------------------------------
  3867.  
  3868. GetFont gadget event.
  3869. -------------------------
  3870.  
  3871. 'gadget GID  success fontname fontsize fontstyle fontflags'
  3872.  
  3873.  Success=0 user selected no font or canceled. Success!=0 user selected a 
  3874. font.
  3875.  
  3876. GetFont gadget parameters.
  3877. -------------------------
  3878.  
  3879. font=GID
  3880.  
  3881. This sets the font for the gadgets text. The GID points to an ALREADY defined 
  3882. text attribute.
  3883.  
  3884. close (c)
  3885.  
  3886.  This gadget will close the window when selected by the user.
  3887.  
  3888. readonly (ro)
  3889.  
  3890.  This gadget is read only.
  3891.  
  3892. disable=number (dis=)
  3893.  
  3894.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  3895. enabled.
  3896.  
  3897. gadgettext="font requester title" (gt=)
  3898.  
  3899.  Set the title of the file requester.
  3900.  
  3901. style
  3902.  
  3903.  This requester includes style settings.
  3904.  
  3905. fixed
  3906.  
  3907.  This requester includes fixed width fonts only.
  3908.  
  3909. Minn=num
  3910. Maxn=num
  3911.  
  3912. The minimum and maximum font size allowed. Defaults to 6-20
  3913.  
  3914. Wide=num
  3915. High=num
  3916.  
  3917.  Set the size of the requester when opened.
  3918.  
  3919. unattached    (ua)
  3920.  
  3921.  This file requester is not attached to the CA window. It may still be 
  3922. activated in the modify conversation.
  3923.  
  3924. minwidth=number (minw=)
  3925.  
  3926.  Set the minimum width for this gadget
  3927.  
  3928. minheight=number (minh=)
  3929.  
  3930.  Set the minimum height for this gadget
  3931.  
  3932. weightedwidth=number (weiw=)
  3933.  
  3934.  Set the weighted width for this gadget
  3935.  
  3936. weightedheight=number (weih=)
  3937.  
  3938.  Set the weighted height for this gadget
  3939.  
  3940. nominalsize (noms)
  3941.  
  3942.  Set this gadget to its nominal size.
  3943.  
  3944. tags="tags|data[|tag|data...]|0
  3945.  
  3946.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  3947.  
  3948. childlabel    (chl) childlabelr   (chlr)
  3949.  
  3950.  Use the previously defined image as a childlabel for this gadget. Display 
  3951. the childlabel to the right or left of the gadget.
  3952.  
  3953. replace=GID
  3954.  
  3955.  Use this gadget to replace an existing gadget specified by GID.
  3956.  
  3957. Definition Reply
  3958. -----------------
  3959.  
  3960.  When the gadget creation is successful the pipe replies
  3961. with
  3962.  
  3963. 'ok GID'
  3964.  
  3965. GetFont gadget modify parameters.
  3966. -------------------------
  3967.  
  3968. selected=number (sel=)
  3969.  
  3970. Number is ignored but must be given. This opens the font requester and the 
  3971. selected font is returned rather than a simple ok.
  3972.  
  3973. disable=number (dis=)
  3974.  
  3975.  The gadget is enabled if number = 0 , disabled if number != 0.
  3976.  
  3977. ------------------------------------------------------------------------------
  3978.                               4.2.5.3 TextEditor                              
  3979. ------------------------------------------------------------------------------
  3980.  
  3981. The TextEditor.gadget is only available under ADOS 3.5 . At this time only
  3982. beta versions were available but the TextEditor gadget is so great it had to
  3983. be included in AWNPipe. These functions should all work once it is released.
  3984.  
  3985.  
  3986.  TextEditor gadget event.
  3987. -------------------------
  3988. An event is only generated when the user double clicks the gadget.
  3989.  
  3990. 'gadget GID DoubleClickPositionX DoubleClickPositionY'
  3991.  
  3992. DoubleClickPositionX/Y is the position in the current line the user double 
  3993. clicked.
  3994.  
  3995. NOTE: You must the TextEditor directly at appropriate times in your program. 
  3996. This means you should have modify turned on if the TextEditor gadget is not 
  3997. read only.
  3998.  
  3999.  
  4000. TextEditor gadget parameters.
  4001. -------------------------
  4002.  
  4003. font=GID
  4004.  
  4005. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4006. attribute.
  4007.  
  4008. arrows (a)
  4009.  
  4010.  Give the TextEditor a scroll gadget on the right.
  4011.  
  4012. readonly (ro)
  4013.  
  4014.  This gadget is read only.
  4015.  
  4016. disable=number (dis=)
  4017.  
  4018.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4019. enabled.
  4020.  
  4021. export="num"
  4022.  
  4023.  Set the export hook for the TextEditor.
  4024.  
  4025. num=0  Plain text hook
  4026. num=1  EMail hook
  4027.  
  4028. import="num"
  4029.  
  4030.  Set the import hook for the TextEditor.
  4031.  
  4032. num=0  Plain text hook
  4033. num=1  EMail hook
  4034. num=2  Mime hook
  4035. num=3  Mime quoted hook
  4036.  
  4037. block
  4038.  
  4039.  The texteditor should mark a block of text as well as generate an event when 
  4040. it is double clicked.
  4041.  
  4042. gadgettext="text" (gt=)
  4043.  
  4044.  Set the text in the gadget.
  4045. given.
  4046.  
  4047. bindata (bd)
  4048.  
  4049. The text will be passed to this pipe in binary after the command line. The 
  4050. gadgettext parameter now gives the length of the data. Setting datain means 
  4051. the data is read from an external file rather than the pipe.
  4052.  
  4053. datain="filename" (di=)
  4054.  
  4055.  Read the data for this gadget from a file.
  4056. It is ignored if the Bindata keyword is not present. A length of 0 means to 
  4057. use the complete file.
  4058.  
  4059. minwidth=number (minw=)
  4060.  
  4061.  Set the minimum width for this gadget
  4062.  
  4063. minheight=number (minh=)
  4064.  
  4065.  Set the minimum height for this gadget
  4066.  
  4067. weightedwidth=number (weiw=)
  4068.  
  4069.  Set the weighted width for this gadget
  4070.  
  4071. weightedheight=number (weih=)
  4072.  
  4073.  Set the weighted height for this gadget
  4074.  
  4075. nominalsize (noms)
  4076.  
  4077.  Set this gadget to its nominal size.
  4078.  
  4079. replace=GID
  4080.  
  4081.  Use this gadget to replace an existing gadget specified by GID.
  4082.  
  4083. Fixed
  4084.  
  4085.  Use a fixed font for this TextEditor.
  4086.  
  4087. Definition Reply
  4088. -----------------
  4089.  
  4090.  When the gadget creation is successful the pipe replies with
  4091.  
  4092. 'ok GID'
  4093.  
  4094. TextEditor gadget modify parameters.
  4095. -------------------------
  4096. read
  4097.  
  4098.  This should not be used with any other parameters. It is ALWAYS responded to 
  4099. with 'SIZE<newline>CHARACTERS'.
  4100.  
  4101. SIZE is the number or characters after the newline. The characters are the 
  4102. current contents of the TextEditor gadget.
  4103.  
  4104. info
  4105.  
  4106.  This should not be used with any other parameters. It is ALWAYS responded to 
  4107. with
  4108. 'CURSORX CURSORY BLOCKMARKED [BSTARTX BSTARTY BENDX BENDY]'.
  4109.  
  4110. CURSORX and CURSORY are the current cursor location, BLOCKMARKED=0 if no 
  4111. block is marked, BLOCKMARKED~=0 means a block is currently marked. BSTARTX/Y 
  4112. and BENDX/Y (the start and end of the marked block) are only given if 
  4113. BLOCKMARKED!=0.
  4114.  
  4115. update=number
  4116.  
  4117. If number=0 then turn off updating of the Texteditor gadget. If number!=0 
  4118. then turn updating of the gadget back on.
  4119.  
  4120. disable=number (dis=)
  4121.  
  4122.  The gadget is enabled if number = 0 , disabled if number != 0.
  4123.  
  4124. readonly=num (ro=)
  4125.  
  4126.  if num != 0 then this gadget is read only. If num =0 then the gadget is NOT
  4127. readonly.
  4128.  
  4129. clear
  4130.  
  4131.  Remove all text from the TextEditor gadget.
  4132.  
  4133. CursorY="num" (cy=)
  4134.  
  4135.  Set the cursor to Y position to num.
  4136.  
  4137. Cursorx="num" (cx=)
  4138.  
  4139.  Set the cursor to Y position to num.
  4140.  
  4141. command="string" (cmd=)
  4142.  
  4143.  Have the TextEditor gadget execute the Arexx command given in string.Command 
  4144. should not be used with other modify parameters.
  4145.  
  4146.  Command always replies with 'ok SUCCESS [SIZE] <newline>[CHARACTERS]'
  4147.  if SUCCESS!=0 then the command was handled by the TextEditor, if SUCCESS=0 
  4148. then the command was not recognised.
  4149.  If the command succeeds you MUST check to see if SIZE is given. If size is 
  4150. specified you then read SIZE  the number or characters after the newline. 
  4151. This is data returned by the command to the TextEditor.
  4152.  
  4153. replace
  4154.  
  4155.  Replace the text highlighted with the text given in gadgettext.
  4156.  
  4157. Replace ALWAYS responds with 'RESULT' where result=0 if a marked string is 
  4158. not found, and RESULT !=0 if the replace is successful.
  4159.  
  4160. search
  4161.  
  4162.  Search for the text given in gadgettext.
  4163.  
  4164. Search ALWAYS responds with 'RESULT' where result=0 if the search string is 
  4165. not found, and RESULT !=0 if the search string is found.
  4166.  
  4167. gadgettext="text" (gt=)
  4168.  
  4169.  Insert the text in the gadget. OR text to search for if search parameter is 
  4170. specified, OR text to replace highlighted text with if replace is specified.
  4171.  
  4172. target="num" (tar=)
  4173.  
  4174.  If num=0 insert text at start of current contents. If num!=0 then insert 
  4175. text at the cursor position. If target is not specified the text is inserted 
  4176. at the end of the current contents.
  4177. If target is not given insert text at cursor position (default).
  4178.  
  4179.   OR
  4180.  
  4181. With search, num is a bit field for search modifiers.
  4182.  
  4183. bit 0 (1)  search from top
  4184. bit 1 (2)  search next (default)
  4185. bit 2 (4)  search case sensitive
  4186. bit 3 (8)  search dospattern
  4187. bit 4 (16)  search backwards
  4188.  
  4189. Unfortunately this is implemented as a decimal number. See the 'Hints' 
  4190. section for easy ways to handle this.
  4191.  
  4192. bindata (bd)
  4193.  
  4194. The text will be passed to this pipe in binary after the command line. The 
  4195. gadgettext parameter now gives the length of the data. Note that you can NOT 
  4196. use datain during modify.
  4197.  
  4198. Search responds with 'ok RESULT' where result=0 if the search string is not 
  4199. found, and RESULT !=0 if the search string is found.
  4200.  
  4201. ------------------------------------------------------------------------------
  4202.                               4.2.5.4 TextFeild                               
  4203. ------------------------------------------------------------------------------
  4204.  
  4205. TextField gadget event.
  4206. -------------------------
  4207. NOTE: The textfield gadget has two event forms. For more information see the 
  4208. shortevent parameter below
  4209.  
  4210. Short Event
  4211. 'gadget GID'
  4212.  
  4213. or Default event.
  4214. 'gadget GID size <newline> characters[size]'
  4215.  
  4216. The next 'size' number of characters after the newline are the contents of 
  4217. the TextField gadget.
  4218.  
  4219. Textfield gadget parameters.
  4220. -------------------------
  4221.  
  4222. font=GID
  4223.  
  4224. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4225. attribute.
  4226.  
  4227. arrows (a)
  4228.  
  4229.  Give the textfield a scroll gadget on the right.
  4230.  
  4231. readonly (ro)
  4232.  
  4233.  This gadget is read only.
  4234.  
  4235. disable=number (dis=)
  4236.  
  4237.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4238. enabled.
  4239.  
  4240. TabCycle (tc)
  4241.  
  4242.  This gadget can be activated using the tab key.
  4243.  
  4244. gadgettext="text" (gt=)
  4245.  
  4246.  Set the text in the gadget.
  4247.  
  4248. bindata (bd)
  4249.  
  4250. The text will be passed to this pipe in binary after the command line. The 
  4251. gadgettext parameter now gives the length of the data. Setting datain means 
  4252. the data is read from an external file rather than the pipe.
  4253.  
  4254. datain="filename" (di=)
  4255.  
  4256.  Read the data for this gadget from a file.
  4257. It is ignored if the Bindata keyword is not present. A length of 0 means to 
  4258. use the complete file.
  4259.  
  4260. shortevent  (se)
  4261.  
  4262.  The events sent by the textfield gadget do not include the contents of the 
  4263. textfield. This parameter only works if modify is turned on.Also see events 
  4264. above.
  4265.  
  4266.  
  4267. centerjustify  (cj)
  4268. rightjustify   (rj)
  4269.  
  4270.  Set the justification of the text for the gadget. Defaults to leftjustify.
  4271.  
  4272. bevel=TYPE  (b=)
  4273.  
  4274.  Set the bevel type for this gadget.
  4275.  
  4276. 0=NONE
  4277. 1=THIN
  4278. 2=BUTTON
  4279. 3=GROUP
  4280. 4=FIELD
  4281. 5=DROPBOX
  4282. 6=SBAR_HORIZ
  4283. 7=SBAR_VERT
  4284. 8=BOX
  4285. 9=STANDARD
  4286.  
  4287.  
  4288. minwidth=number (minw=)
  4289.  
  4290.  Set the minimum width for this gadget
  4291.  
  4292. minheight=number (minh=)
  4293.  
  4294.  Set the minimum height for this gadget
  4295.  
  4296. weightedwidth=number (weiw=)
  4297.  
  4298.  Set the weighted width for this gadget
  4299.  
  4300. weightedheight=number (weih=)
  4301.  
  4302.  Set the weighted height for this gadget
  4303.  
  4304. nominalsize (noms)
  4305.  
  4306.  Set this gadget to its nominal size.
  4307.  
  4308. replace=GID
  4309.  
  4310.  Use this gadget to replace an existing gadget specified by GID.
  4311.  
  4312. Definition Reply
  4313. -----------------
  4314.  
  4315.  When the gadget creation is successful the pipe replies with
  4316.  
  4317. 'ok GID'
  4318.  
  4319. Textfield gadget modify parameters.
  4320. -------------------------
  4321. disable=number (dis=)
  4322.  
  4323.  The gadget is enabled if number = 0 , disabled if number != 0.
  4324.  
  4325. gadgettext="text" (gt=)
  4326.  
  4327.  Set the text in the gadget to text if scroll keyword is not used. Else 
  4328. insert the text at the position set by scroll.
  4329.  
  4330. scroll="num"
  4331.  
  4332.  Set the cursor to position num.
  4333.  
  4334. delete=num
  4335.  
  4336.  Delete num of characters from the cursor forward.
  4337.  
  4338. bindata (bd)
  4339.  
  4340. The text will be passed to this pipe in binary after the command line. The 
  4341. gadgettext parameter now gives the length of the data. Note that you can NOT 
  4342. use datain during modify.
  4343.  
  4344. All modifications of a textfield (except a lone disable) are responded to by 
  4345. 'ok POSITION' where POSITION is the final curser position.
  4346.  
  4347. ------------------------------------------------------------------------------
  4348.                              4.2.5.5 ListBrowser                              
  4349. ------------------------------------------------------------------------------
  4350.  
  4351. ListBrowser gadget event
  4352. -------------------------
  4353.  
  4354. 'gadget GID event_source event_column NodeGID [NodeGID [NodeGID ...]]'
  4355.  
  4356. event_source&1 means normal selection of node.
  4357.  
  4358. event_source&2 means this nodes children have been hidden.
  4359.  
  4360. event_source&4 means this nodes children are now shown.
  4361.  
  4362. event_source&8 means node has been edited.
  4363.  
  4364. event_source&16 means double click on node.
  4365.  
  4366. event_column is the column the mouse was over when the node was clicked.
  4367.  
  4368. ListBrowser gadget parameters.
  4369. -------------------------
  4370.  
  4371. font=GID
  4372.  
  4373. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4374. attribute.
  4375.  
  4376. readonly (ro)
  4377.  
  4378.  This list browser entries can not be edited.
  4379.  
  4380. disable=number (dis=)
  4381.  
  4382.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4383. enabled.
  4384.  
  4385. selected=number (s=)
  4386.  
  4387.   Set which choice is selected when the window opens. Selections start at 0 . 
  4388. This defaults to none. CAREFUL modify uses the listnode GID, this parameter 
  4389. uses the ordinal position of the node.
  4390.  
  4391. ListbrowserLabels="text0|text1|text..."  (lbl=)
  4392.  
  4393.  Set the column labels for the list. Defaults to 1 unlabeled column.  NO MORE 
  4394. THAN 20 COLUMNS can be defined !
  4395.  
  4396. bnparent (bnp)
  4397.  
  4398.  Allow parenting in this listbrowser.
  4399.  
  4400. showtitles (st)
  4401.  
  4402.  Show the column tiles of this listbrowser.
  4403.  
  4404. vertical (v)
  4405.  
  4406.  Use vertical separators in the listbrowser.
  4407.  
  4408. hori (h)
  4409.  
  4410.  Use horizontal separators in the listbrowser.
  4411.  
  4412. arrows   (a)
  4413.  
  4414.  Show arrows for horizontal scrolling and make this a virtual width list.
  4415.  
  4416. multi  (m)
  4417.  
  4418.  Switch to allow multi selection in the list. Multi select by holding the 
  4419. shift key.
  4420.  
  4421. minwidth=number (minw=)
  4422.  
  4423.  Set the minimum width for this gadget
  4424.  
  4425. minheight=number (minh=)
  4426.  
  4427.  Set the minimum height for this gadget
  4428.  
  4429. weightedwidth=number (weiw=)
  4430.  
  4431.  Set the weighted width for this gadget
  4432.  
  4433. weightedheight=number (weih=)
  4434.  
  4435.  Set the weighted height for this gadget
  4436.  
  4437. nominalsize (noms)
  4438.  
  4439.  Set this gadget to its nominal size.
  4440.  
  4441. SPECIAL FUNCTION
  4442. -----------------
  4443. /* do not use this function it may be removed !*/
  4444. /* instead see the note at the end of this doc */
  4445.  Using sort on a line BY ITSELF during gadget definitions will cause the last 
  4446. defined listbrowser to be sorted. This is to allow a list browser to be 
  4447. sorted before the gui window is opened. (the modify sort command sorts the 
  4448. listbrowser after the window is opened.)
  4449.  
  4450. sort=COLUMN#
  4451.  
  4452. (optional) sort=COLUMN# defn=COLUMN#
  4453.  
  4454.  Sort list browser based on the column number, if the sort entries are the 
  4455. save a secondary sort based on the defaultnumber column is done. Specifying a 
  4456. secondary column to sort by is optional. Remember columns start at 0. You 
  4457. MUST NOT specify an invalid column number.
  4458.  
  4459. Definition Reply
  4460. -----------------
  4461.  
  4462.  When the gadget creation is successful the pipe replies with
  4463.  
  4464. 'ok GID'
  4465.  
  4466. ListBrowser gadget modify parameters.
  4467. -------------------------
  4468. down
  4469.  
  4470. Select the next node in the list.
  4471.  
  4472. up
  4473.  
  4474. Select the previous node in the list.
  4475.  
  4476. addnode (addn)
  4477.  
  4478.  Add a new node to this ListBrowser.
  4479.  
  4480.  You should keep this modify command a s simple as possible, only use 
  4481. keywords that specifically deal with the creation of the node. (tar gt bnp 
  4482. defn sc )
  4483.  
  4484.  Put additional changes like select= or disable = in a separate modify line. 
  4485. Some keywords like refresh, tick, disable, sort, and others could cause extra 
  4486. 'oks' to be in the response line.
  4487.  
  4488.  Keep it simple and this modify command is responded to with 'ok GID' where 
  4489. GID is the ID of the browser node.
  4490.  
  4491. GadgetText="[^|¶]text0|[^|¶]text1|[^|¶]text..." (gt=)
  4492.  
  4493.  Set the text(s) for the added node. This parameter MUST be given if you are 
  4494. using 'addnode' . YOU MUST NOT GIVE MORE TEXTS THAN THE AMOUNT OF COLUMNS IN 
  4495. THE LISTBROWSER. A leading '^' makes the text editable. A leading '¶' (ALT p) 
  4496. uses the last defined image for the column rather than text. Note that images 
  4497. used in browsernodes can not be more than 255 pixels high. (hint: split 
  4498. larger images and use more than one node)
  4499.  
  4500. defnumber=number  (defn=)
  4501.  
  4502.  Set the Generation of this browser node.
  4503.  
  4504. target=GID  (tar=)
  4505.  
  4506.  If GID=0 add the new node at head of list. If GID=-1 add the new node at 
  4507. tail of list. Else add the new node immediately after the node specified by 
  4508. GID.
  4509.  
  4510. browsernodeparent  (bnp)
  4511.  
  4512.  The new browser node has children.
  4513.  
  4514. List=number
  4515.  
  4516.  If number=0 detach the node list from the listbrowser. If number!=0 then 
  4517. reattaches the node list to the listbrowser.
  4518.  
  4519. removenode (remn)
  4520.  
  4521.  Remove ALL browsernodes from this ListBrowser.
  4522.  
  4523. readonly (ro)
  4524.  
  4525.  This list browser entries can not be edited.
  4526.  
  4527. disable=number (dis=)
  4528.  
  4529.  The gadget is enabled if number = 0 , disabled if number != 0.
  4530.  
  4531. scroll=GID (scr=)
  4532.  
  4533.  Scroll the listbrowser so the node specified by GID is at the top.
  4534.  
  4535. selected=num (s=)
  4536.  
  4537.   For multi select lists
  4538.  
  4539.  Setting selected=0 sets all nodes as unselected. Setting selected=-1 sets 
  4540. all nodes as selected.  You may set the nodes individually instead of using 
  4541. this command. See browsernode modify commands.
  4542.  
  4543. selected=node_GID (s=)
  4544.  
  4545.   For single select lists
  4546.  
  4547.  Set the selected node. Selected=0 sets all nodes as unselected, else the 
  4548. specified node is selected. CAREFUL modify uses the listnode GID not the 
  4549. ordinal position. This is different then in the listbrowser definition.
  4550.  
  4551. order
  4552.  
  4553.  Read the order of nodes in the listbrowser. This does not return the normal 
  4554. 'ok' instead it returns a sequence of GID's in the same order as the nodes in 
  4555. the listbrowser. THIS COMMAND SHOULD NOT BE USED WITH ANY OTHER MODIFY 
  4556. COMMANDS ON THE SAME LINE.
  4557.  
  4558. sort=COLUMN#
  4559.  
  4560. (optional) sort=COLUMN# defn=COLUMN#
  4561.  
  4562.  Sort list browser based on the column number, if the sort entries are the 
  4563. save a secondary sort based on the defaultnumber column is done. Specifying a 
  4564. secondary column to sort by is optional. Remember columns start at 0. You 
  4565. MUST NOT specify an invalid column number.
  4566.  
  4567. autofit
  4568.  
  4569.  This keyword forces the listbrowser to evaluate its size. It is only needed 
  4570. when a listbrowser uses a font other than the screen default font AND no new 
  4571. browser nodes are added after the GUI window is opened.
  4572.  
  4573. hidechild=num (hc=)
  4574.  
  4575.  If num =0 show all the children in this listbrowser. If num !=0 then hide 
  4576. all the children in this listbrowser.
  4577.  
  4578. NOTE: At times you may want to modify a listbrowser after is is created, but 
  4579. BEFORE the window is opened. Use the 'NoWindow' keyword in the window 
  4580. definition, create the GUI as usual. When you send 'open' the window does NOT 
  4581. open but you do go into modify mode. Modify the GUI then send 'id 0 s 64' to 
  4582. open the window after it has been modified.
  4583.  
  4584. ------------------------------------------------------------------------------
  4585.                                4.2.5.6 Palette                                
  4586. ------------------------------------------------------------------------------
  4587.  
  4588. palette gadget event
  4589. -------------------------
  4590.  
  4591. 'gadget GID selected_color'
  4592.  
  4593. Palette gadget parameters.
  4594. -------------------------
  4595.  
  4596. font=GID
  4597.  
  4598. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4599. attribute.
  4600.  
  4601. close (c)
  4602.  
  4603.  This gadget will close the window when selected by the user.
  4604.  
  4605. readonly (ro)
  4606.  
  4607.  This gadget is read only.
  4608.  
  4609. disable=number (dis=)
  4610.  
  4611.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4612. enabled.
  4613.  
  4614. minnumber=number (minn=)
  4615.  
  4616.  The first color to display in this gadget. Defaults to 0.
  4617.  
  4618. maxnumber=number (maxn=)
  4619.  
  4620.  How many colors to display in this gadget. Defaults to 8.
  4621.  
  4622. selected=number (s=)
  4623.  
  4624.  Color selected when window is opened. Defaults to 0.
  4625.  
  4626. minwidth=number (minw=)
  4627.  
  4628.  Set the minimum width for this gadget
  4629.  
  4630. minheight=number (minh=)
  4631.  
  4632.  Set the minimum height for this gadget
  4633.  
  4634. weightedwidth=number (weiw=)
  4635.  
  4636.  Set the weighted width for this gadget
  4637.  
  4638. weightedheight=number (weih=)
  4639.  
  4640.  Set the weighted height for this gadget
  4641.  
  4642. nominalsize (noms)
  4643.  
  4644.  Set this gadget to its nominal size.
  4645.  
  4646. replace=GID
  4647.  
  4648.  Use this gadget to replace an existing gadget specified by GID.
  4649.  
  4650. Definition Reply
  4651. -----------------
  4652.  
  4653.  When the gadget creation is successful the pipe replies with
  4654.  
  4655. 'ok GID'
  4656.  
  4657. Palette gadget modify parameters.
  4658. -------------------------
  4659.  
  4660. disable=number (dis=)
  4661.  
  4662.  The gadget is enabled if number = 0 , disabled if number != 0.
  4663.  
  4664. selected=number (s=)
  4665.  
  4666.  Set the color selected in the gadget
  4667.  
  4668.  
  4669. ------------------------------------------------------------------------------
  4670.                                   4.2.6 More                                  
  4671. ------------------------------------------------------------------------------
  4672.  
  4673.  
  4674. ------------------------------------------------------------------------------
  4675.                               4.2.6.1 Fuelgauge                               
  4676. ------------------------------------------------------------------------------
  4677.  
  4678.  
  4679. The Fuel gauge do not produce events.
  4680.  
  4681.  
  4682. FuelGauge gadget parameters.
  4683. -------------------------
  4684.  
  4685. font=GID
  4686.  
  4687. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4688. attribute.
  4689.  
  4690. close (c)
  4691.  
  4692.  This gadget will close the window when selected by the user.
  4693.  
  4694. readonly (ro)
  4695.  
  4696.  This gadget is read only.
  4697.  
  4698. disable=number (dis=)
  4699.  
  4700.  The gadget is enabled if number = 0 , disabled if number !=0. Defaults to 
  4701. enabled.
  4702.  
  4703. gadgettext="text" (gt=)
  4704.  
  4705.  Set the text of the gadget.
  4706.  
  4707. centerjustify (cj)
  4708.  
  4709.  Set the justification of the text for the gadget. Defaults to leftjustify.
  4710.  
  4711. vertical   (v)
  4712.  
  4713.  This fuelgauge is vertical. Defaults to horizontal.
  4714.  
  4715. ticks=number (t=)
  4716.  
  4717.  Set the  'number' of ticks in the fuel gauge. Defaults to 11.
  4718.  
  4719. percent (per)
  4720.  
  4721.  Show the percentage full as the fuel gauge text.
  4722.  
  4723. minnumber=number (minn=)
  4724.  
  4725.  Empty value for this gadget. Defaults to 0.
  4726.  
  4727. maxnumber=number (maxn=)
  4728.  
  4729.  Full value for this gadget. Defaults to 100.
  4730.  
  4731. defnumber=number  (defn=)
  4732.  
  4733.  Value for this gadget when window is opened. Defaults to 50.
  4734.  
  4735. minwidth=number (minw=)
  4736.  
  4737.  Set the minimum width for this gadget
  4738.  
  4739. minheight=number (minh=)
  4740.  
  4741.  Set the minimum height for this gadget
  4742.  
  4743. weightedwidth=number (weiw=)
  4744.  
  4745.  Set the weighted width for this gadget
  4746.  
  4747. weightedheight=number (weih=)
  4748.  
  4749.  Set the weighted height for this gadget
  4750.  
  4751. nominalsize (noms)
  4752.  
  4753.  Set this gadget to its nominal size.
  4754.  
  4755. tags="tags|data[|tag|data...]|0
  4756.  
  4757.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  4758.  
  4759. childlabel    (chl)
  4760. childlabelr   (chlr)
  4761.  
  4762.  Use the previously defined image as a childlabel for this gadget. Display 
  4763. the childlabel to the right or left of the gadget.
  4764.  
  4765. replace=GID
  4766.  
  4767.  Use this gadget to replace an existing gadget specified by GID.
  4768.  
  4769. Definition Reply
  4770. -----------------
  4771.  
  4772.  When the gadget creation is successful the pipe replies with
  4773.  
  4774. 'ok GID'
  4775.  
  4776. FuelGauge gadget modify parameters.
  4777. ----------------------------------
  4778.  
  4779. disable=number (dis=)
  4780.  
  4781.  The gadget is enabled if number = 0 , disabled if number != 0.
  4782.  
  4783. gadgettext="text" (gt=)
  4784.  
  4785.  Set the text of the gadget.
  4786.  
  4787. defnumber=number  (defn=)
  4788.  
  4789.  Value for this gadget .
  4790.  
  4791. get=TAG
  4792.  
  4793.  Read the value of a specific gadget attribute. Returns a blank line if 
  4794. attribute is not readable. This should not be combined with any other modify 
  4795. command on the same line.
  4796.  
  4797. refresh (ref)
  4798.  
  4799.  Redraw the gadget.
  4800.  
  4801. ------------------------------------------------------------------------------
  4802.                                4.2.6.2 Scroller                               
  4803. ------------------------------------------------------------------------------
  4804.  
  4805. Scroller gadget event.
  4806. -------------------------
  4807.  
  4808. 'gadget GID scroller_value'
  4809.  
  4810. Scroller gadget parameters.
  4811. -------------------------
  4812.  
  4813. font=GID
  4814.  
  4815. This sets the font for the gadget. The GID points to an ALREADY defined text 
  4816. attribute.
  4817.  
  4818. readonly (ro)
  4819.  
  4820.  This gadget is read only.
  4821.  
  4822. disable=number (dis=)
  4823.  
  4824.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4825. enabled.
  4826.  
  4827. vertical   (v)
  4828.  
  4829.  This gadget is free vertically, defaults to free horizontally.
  4830.  
  4831. arrows (a)
  4832.  
  4833.  Switch to display arrows for this gadget.
  4834.  
  4835. delta=number
  4836.  
  4837.  The change in the gadget when an arrow is clicked. Defaults to 1.
  4838.  
  4839. knob=number
  4840.  
  4841.  The size of the knob in the scroller.
  4842.  
  4843. maxnumber=number (maxn=)
  4844.  
  4845.  Maximum value for this gadget. Defaults to 100.
  4846.  
  4847. defnumber=number  (defn=)
  4848.  
  4849.  Value for this gadget when window is opened. Defaults to 0.
  4850.  
  4851. minwidth=number (minw=)
  4852.  
  4853.  Set the minimum width for this gadget
  4854.  
  4855. minheight=number (minh=)
  4856.  
  4857.  Set the minimum height for this gadget
  4858.  
  4859. weightedwidth=number (weiw=)
  4860.  
  4861.  Set the weighted width for this gadget
  4862.  
  4863. weightedheight=number (weih=)
  4864.  
  4865.  Set the weighted height for this gadget
  4866.  
  4867. nominalsize (noms)
  4868.  
  4869.  Set this gadget to its nominal size.
  4870.  
  4871. replace=GID
  4872.  
  4873.  Use this gadget to replace an existing gadget specified by GID.
  4874.  
  4875. Definition Reply
  4876. -----------------
  4877.  
  4878.  When the gadget creation is successful the pipe replies with
  4879.  
  4880. 'ok GID'
  4881.  
  4882. Scroller gadget modify parameters.
  4883. -------------------------
  4884.  
  4885. disable=number (dis=)
  4886.  
  4887.  The gadget is enabled if number = 0 , disabled if number != 0.
  4888.  
  4889. defnumber=number  (defn=)
  4890.  
  4891.  Value for this gadget.
  4892.  
  4893. knob=number
  4894.  
  4895.  The size of the knob in the scroller.
  4896.  
  4897. maxnumber=number (maxn=)
  4898.  
  4899.  Maximum value for this gadget. Defaults to 100.
  4900.  
  4901.  
  4902. ------------------------------------------------------------------------------
  4903.                                 4.2.6.3 Slider                                
  4904. ------------------------------------------------------------------------------
  4905.  
  4906. Slider gadget event.
  4907. -------------------------
  4908.  
  4909. 'gadget GID slider_value'
  4910.  
  4911. slider gadget parameters.
  4912. -------------------------
  4913.  
  4914. readonly (ro)
  4915.  
  4916.  This gadget is read only.
  4917.  
  4918. disable=number (dis=)
  4919.  
  4920.  The gadget is enabled if number = 0 , disabled if number != 0. Defaults to 
  4921. enabled.
  4922.  
  4923. ticks=number
  4924.  
  4925.  Set how many ticks to display along the slider.
  4926.  
  4927. Sticks
  4928.  
  4929.  Show every second tick as a short tick.
  4930.  
  4931. Flip
  4932.  
  4933.  Reverse the min and max positions on the slider.
  4934.  
  4935. vertical   (v)
  4936.  
  4937.  This gadget is free vertically, defaults to free horizontally.
  4938.  
  4939. maxnumber=number (maxn=)
  4940.  
  4941.  Maximum value for this gadget. Defaults to 100.
  4942.  
  4943. minnumber=number (minn=)
  4944.  
  4945.  Maximum value for this gadget. Defaults to 100.
  4946.  
  4947. selected=number  (s=)
  4948.  
  4949.  Value for this gadget when window is opened. Defaults to 0.
  4950.  
  4951. useimage (ui)
  4952.  
  4953.  Use the last defined image as the knob for this slider.
  4954.  
  4955. bodyimage (bi)
  4956.  
  4957.  Use the last defined image as the body of this slider.
  4958.  
  4959.  NOTE: if both useimage and bodyimage are given, the knob gets the last 
  4960. defined image , the body gets the send last defined image.
  4961.  
  4962. minwidth=number (minw=)
  4963.  
  4964.  Set the minimum width for this gadget
  4965.  
  4966. minheight=number (minh=)
  4967.  
  4968.  Set the minimum height for this gadget
  4969.  
  4970. weightedwidth=number (weiw=)
  4971.  
  4972.  Set the weighted width for this gadget
  4973.  
  4974. weightedheight=number (weih=)
  4975.  
  4976.  Set the weighted height for this gadget
  4977.  
  4978. nominalsize (noms)
  4979.  
  4980.  Set this gadget to its nominal size.
  4981.  
  4982. replace=GID
  4983.  
  4984.  Use this gadget to replace an existing gadget specified by GID.
  4985.  
  4986. Definition Reply
  4987. -----------------
  4988.  
  4989.  When the gadget creation is successful the pipe replies with
  4990.  
  4991. 'ok GID'
  4992.  
  4993. slider gadget modify parameters.
  4994. -------------------------
  4995.  
  4996. disable=number (dis=)
  4997.  
  4998.  The gadget is enabled if number = 0 , disabled if number != 0.
  4999.  
  5000. selected=number  (s=)
  5001.  
  5002.  Value for this gadget.
  5003.  
  5004.  
  5005. ------------------------------------------------------------------------------
  5006.                               4.2.6.4 WeightBar                               
  5007. ------------------------------------------------------------------------------
  5008.  
  5009. WeightBar parameters
  5010. ----------------------
  5011.  
  5012. WeightBar
  5013.  
  5014. Place a user controllable weightbar in the GUI. WeightBar has no parameters.
  5015.  
  5016. Definition Reply
  5017. -----------------
  5018.  
  5019.  When the gadget creation is successful the pipe replies with
  5020.  
  5021. 'ok'
  5022.  
  5023. ------------------------------------------------------------------------------
  5024.                               4.2.6.5 Commodity                               
  5025. ------------------------------------------------------------------------------
  5026.  
  5027. Commodity event
  5028. ----------------
  5029.  
  5030. Commodity    "cx TYPE [SUBTYPE]"
  5031.  
  5032.  TYPE=hotkey            The commodities hotkey has been detected.
  5033.  TYPE=kill              The commodity has been requested to quit.
  5034.  TYPE=unique            Another commodity with the same name tried to start 
  5035. (but always fails)
  5036.  TYPE=show              The commodity has been requested to show its GUI.
  5037.  TYPE=hide              The commodity has been requested to hide its GUI.
  5038.  TYPE=disable           The commodity has been disabled.
  5039.  TYPE=enable            The commodity has been enabled.
  5040.  
  5041.  
  5042.  With dis/enable your commodity is automatically enabled or disabled. You 
  5043. MUST respect this in your program. With other commodity events you SHOULD TRY 
  5044. to react in some proper way.
  5045.  
  5046.  The next three types are included to alow for future enhancements of the 
  5047. Amiga Commodity ability.
  5048.  
  5049.  TYPE=command SUBTYPE   The commodity has received an unrecognized command. 
  5050. The subtype is the messageID.
  5051.  TYPE=event SUBTYPE     The commodity has received an unrecognized event. The 
  5052. subtype is the messageID.
  5053.  TYPE= NUMBER SUBTYPE   The commodity has received an unrecognized message 
  5054. type. Number is the message type, subtype is the messageID.
  5055.  
  5056. Commodity parameters
  5057. --------------------
  5058.  
  5059. You may only create one commodity object, per GUI.
  5060.  
  5061. CxName="name"
  5062.  
  5063. Name Commodities uses to identify this commodity.(REQUIRED)
  5064.  
  5065. CxPri=number
  5066.  
  5067. The priority of your commodity, defaults to 0.
  5068.  
  5069. CxTitle="title"
  5070.  
  5071. Title of commodity that appears in CXExchange.
  5072.  
  5073. CxDesc="description"
  5074.  
  5075. Description of the commodity.
  5076.  
  5077. CxHotkey=" hotkey description"
  5078.  
  5079. example  CxHotKey="ctrl alt f1"
  5080.  
  5081. CxNoGui
  5082.  
  5083. Do not allow CXExchange to request GUI open and closing.
  5084.  
  5085. Definition Reply
  5086. -----------------
  5087.  
  5088.  When the commodity creation is successful the pipe replies with
  5089.  
  5090. 'ok'
  5091.  
  5092. Modify parameters
  5093. -----------------
  5094.  
  5095. Normally you should not need to disable or enable your commodity as it is 
  5096. handled automatically. This gives you the ability to override the automatic 
  5097. control, use it carefully.
  5098.  
  5099. Commodity=number
  5100.  
  5101. If number =0 then disable the commodity, else enable the commodity. Replied 
  5102. to with ok.
  5103.  
  5104. ------------------------------------------------------------------------------
  5105.                                 4.2.6.6 Sound                                 
  5106. ------------------------------------------------------------------------------
  5107.  
  5108. Sound objects do not generate events
  5109. -------------------------
  5110.  
  5111. Sound object parameters.
  5112. -------------------------
  5113.  
  5114. FileName="path:file"
  5115.  
  5116. Specify the file file containing the audio data. This parameter MUST be 
  5117. given. Datatypes are used to generate the sound object.
  5118.  
  5119. Volume=NUM
  5120.  
  5121. The volume to play the sound at 0-64. Defaults to 64.
  5122.  
  5123. Period=NUM
  5124.  
  5125. The period for playback of the sound. Defaults to natural period for the 
  5126. sample.
  5127.  
  5128. Cycles=NUM
  5129.  
  5130. The amount of cycles of the sound to play. Defaults to 1.
  5131.  
  5132. Definition Reply
  5133. -----------------
  5134.  
  5135.  When the object creation is successful the pipe replies with
  5136.  
  5137. 'ok GID'
  5138.  
  5139. Sound object modify parameters.
  5140. -------------------------
  5141.  
  5142. Period=NUM
  5143.  
  5144. The period for playback of the sound.
  5145.  
  5146. Volume=NUM
  5147.  
  5148. The volume to play the sound at 0-64. Defaults to 64.
  5149.  
  5150. NOTE: To work around a pre-ADOS 3.5 sound.dataype bug you can change the 
  5151. volume or frequency at the same time playback is triggered.
  5152.  
  5153. topipe('ID soundGID Volume new_volume Period new_period S 2')
  5154.  
  5155. Under OS3.5 volume and frequency can  be changed any time, but period may not 
  5156. work as expected.
  5157.  
  5158. Selected=TriggerMethod   (s=)
  5159.  
  5160. Cause the sound object to react. Most sound objects only support the trigger 
  5161. method Play (2) and method Stop (14).
  5162.  
  5163. Some other trigger methods for future compatability.
  5164.  
  5165. PAUSE        1
  5166. PLAY        2
  5167. REWIND        12
  5168. FASTFORWARD    13
  5169. STOP        14
  5170. RESUME        15
  5171.  
  5172. Select is replied to with 'ok RESULT' where result =1 when the trigger method 
  5173. was supported and result=0 when it is not supported.
  5174.  
  5175. NOTE: Trigger method 14 (stop) appears to be broken under ADOS 3.x and can 
  5176. hang the system. It should not use it at present.
  5177.  
  5178. FreeSound
  5179.  
  5180. FreeSound will dispose of the sound object. Under ADOS 3.1 the command may 
  5181. wait until the sound finishes playing. Under ADOS 3.5 the sound is stopped 
  5182. immedaitly and the object freed.
  5183.  
  5184. Sound objects are disposed of automaticaly when the GUI host is closed. Uses 
  5185. this function when it is better to free the sound object sooner.
  5186.  
  5187.  
  5188.  
  5189.  
  5190. ------------------------------------------------------------------------------
  5191.                                   4.3 Events                                  
  5192. ------------------------------------------------------------------------------
  5193.  
  5194. EVENT TYPES
  5195. -------------
  5196. Gadget hit     "gadget GID [gadget specific data]"
  5197.  Read gadget information for specifics.
  5198.  
  5199. Help           "help GID MOUSEX MOUSEY<cr>"
  5200.  The mouse is over the gadget specified. The mouse location is useful in 
  5201. determining where to open a help window.
  5202.  
  5203. Keystroke      "key KEYCODE QUALIFIER<cr>"
  5204.  The user hit a key. Raw keycodes are returned along with the current 
  5205. qualifier.
  5206.  
  5207. Qualifier      "qual QUALIFIER<cr>"
  5208.  
  5209.  A change in the current qualifier is detected. Not all qualifier changes 
  5210. will cause events. HOWEVER the last qualifier event will ALWAYS be correct 
  5211. for the event(s) that follow it.
  5212.  
  5213. Close          "close CLOSESOURCE<cr>"
  5214.  The window has been closed.
  5215.  CLOSESOURCE=0        WindowClose Gadget
  5216.  CLOSESOURCE=-1       Closed by CTRL-BackSlash
  5217. else CLOSESOURCE=GID  Closed by GID
  5218.  
  5219. Commodity    "cx TYPE [SUBTYPE]"
  5220.  
  5221.  The Commodity object received a message.
  5222.  
  5223. AskClose   "askclose"
  5224.  
  5225.  User tried to close the GUI window. (not always used see window docs)
  5226.  
  5227. Refresh        "refresh"
  5228.  
  5229.  The window has been sized or altered and you should refresh any components 
  5230. you manually draw into the window. (You only ask for and watch these events 
  5231. if you use the 'Draw' modify command.)
  5232.  
  5233. Menu           "menu  MENU# ITEM# SUBITEM# CHECKED<cr>"
  5234.  
  5235.  Menu selected.
  5236. checked=0 Item is not checked
  5237. checked=1 Item is checked
  5238.  
  5239.  Be careful of false (undefined) menu hits.
  5240.  
  5241. Window Active  "active 0|1<cr>"
  5242.  0= window inactive
  5243.  1= window active
  5244.  
  5245. Application  "app FILENAME <cr>"
  5246.  
  5247.  An icon has been dropped on the window.
  5248.  
  5249. Iconify  "iconify MODE<cr>"
  5250.  
  5251. mode 0 = uniconify
  5252. mode 1 = iconify
  5253.  
  5254. Iconify events are only sent if modify is turned on. You must manually 
  5255. iconify or uniconify the window in this case. See window.doc.
  5256.  
  5257. If modify is not turned on the iconification is automatic and no iconify 
  5258. events are sent.
  5259.  
  5260. ARexx command  "arexx FID len <cr> command"
  5261.  
  5262.  You must first read the arexx event, the read len additional characters.
  5263.  
  5264. See the  docs for each gadget type for more information.
  5265.  
  5266.  
  5267. ------------------------------------------------------------------------------
  5268.                                   4.4 Modify                                  
  5269. ------------------------------------------------------------------------------
  5270.  
  5271. Modifying the GUI Window and its gadgets
  5272. =========================================
  5273.  
  5274. See the documentation for each gadget type for information on modifying that 
  5275. type of gadget type. This document exlains many 'special commands' that can 
  5276. be used to modify the GUI in general. It also has some commands that can be 
  5277. used on any gadget type.
  5278.  
  5279. Most modify commands are replied to with either 'ok' or 'error'. If more than 
  5280. one gadget parameter is changed by the modify command the reply can be 'ok ok 
  5281. ...' .  A reply of a blank line means the modify command was not understood 
  5282. and was ignored.
  5283.  
  5284. Modify commands that change gadget parameters begin with 'id GID' Gadgets are 
  5285. modified with the following  line format
  5286.  
  5287. 'id GID parameter1[=value] parameter2[=value] parameter3[=value] ...
  5288.  
  5289. example 'id 2 gadgettext="new text" disable=1'
  5290.  
  5291. The parameters allowed depend on the type of gadget that GID refers to.
  5292.  
  5293. NOTE: When modifying gadgets on a clicktab page, you should add the page 
  5294. parameter to the modify line.
  5295.  
  5296. NOTE: At times you may want to modify a GUI after is is created, but BEFORE 
  5297. the window is opened. Use the 'NoWindow' keyword in the window definition, 
  5298. create the GUI as usual. When you send 'open' the window does NOT open but 
  5299. you do go into modify mode. Modify the GUI then send 'id 0 s 64' to open the 
  5300. window after it has been modified.
  5301.  
  5302. Modify Parameters that can be used with all gadgets
  5303. (except menu, arexxhost, textattr, commodity...)
  5304. ------------------------------
  5305.  
  5306. page="GID"
  5307.  
  5308.  Specify the clicktab gadget that controls the page containing the gadget to 
  5309. be modified. Most gadgets seem to modify fine without this being set, but it 
  5310. must be used for string gadgets. It should probably be used when modifying 
  5311. all gadgets on clicktab pages to ensure future compatability.
  5312.  NOTE: you supply the Gadget ID of the clicktab, NOT the number of the page 
  5313. inside the clicktab.
  5314.  
  5315. set
  5316.  
  5317.  'Set' sets gadget parameters from the supplied tag list. Both 'set' and 
  5318. 'tags' must be used to do this.
  5319.  
  5320. tags="tags|data[|tag|data...]|0
  5321.  
  5322.  A list of tag and value pairs in HEX. Do not forget the trailing null !
  5323.  
  5324. Refresh (ref)
  5325.  
  5326.  Refresh the entire GUI when used alone, or refresh a specific object when 
  5327. used with a GID.
  5328.  
  5329. Informational Gadget modify instructions
  5330. ----------------------------------------
  5331.  
  5332. read
  5333.  
  5334.   Read must not be used with other parameters besides GID.
  5335.  'id GID read' Reads the gadget specified by GID. The pipe returns the same 
  5336. information as when a user hits a gadget but without the leading 'gadget 
  5337. gid'. In the case of GID=0 read returns the windows 'left top width height' 
  5338. settings.
  5339.  
  5340. bounds
  5341.  
  5342.  Read the size and location of object associated with the GID. This modify 
  5343. command MUST be ' id GID bounds' and returns 'LEFT TOP WIDTH HEIGHT'
  5344.  
  5345. address
  5346.  
  5347.  Read the address of object associated with the GID and information about the 
  5348. gadget type. This modify command MUST be ' id GID address' and returns 
  5349. 'ADDRESS GADGETTYPE'
  5350.  
  5351.  An address of 0 means no object is associated with the GID.
  5352.  
  5353. mouse
  5354.  
  5355.  Get the position of the pointer. This returns the both the position relative 
  5356. to the window and relative to the screen.
  5357.  
  5358. 'windowX windowY screenX screenY'
  5359.  
  5360. Get="hexvalue"
  5361.  
  5362.  This special modify command lets you read a value associated with a gadget 
  5363. The pipe replies with 'ok value' when successful, a blank line if it fails.
  5364.  
  5365.  example 'id 3 get xxxxxxxx'
  5366.  
  5367.  This reads the selected color in a palette gadget (whose GID is 3).
  5368.  
  5369. Gadget interconnection modify
  5370. -----------------------------
  5371.  
  5372.  This function may only be useful to programmers already familiar with 
  5373. interconnection who have registered CA documentation.
  5374.  
  5375. Target="gadget_ID"  (tar=)
  5376.  
  5377.  The gadget to be interconnected with.
  5378.  
  5379. tags="tagsource|tagdest[|tagsource|tagdest..]|0
  5380.  
  5381.  The list of tags for interconnection in HEX. Tags must be in pairs, and do 
  5382. not forget the trailing null!
  5383.  
  5384.  example. 'id 3 target 2  tags="5001005|5001005|0" '
  5385.  
  5386.  Selections made on chooser gadget 3 are connected to chooser gadget 2.
  5387.  
  5388.  
  5389. Modify Control instructions
  5390. ----------------------------
  5391.  
  5392.  Some modify commands do not actually modify any gadgets.
  5393.  
  5394. pointer
  5395.  
  5396.  Set the pointer for the window, if pointerdata is not specified set the 
  5397. pointer to default pointer. I pointer data is given see below.
  5398.  
  5399. pointerdata="height|width|hotx|hoty|data1|data2|..."  (pd=)
  5400.  
  5401.  Pointer data is the definition for a pointer. For more information see the 
  5402. intuition call SetPointer(). Pointerdata="" is a special case setting the 
  5403. pointer to a null (invisible) pointer.
  5404.  
  5405. specialchar="character" (sc=)
  5406.  
  5407.  'Character' is a single character that replaces '|', in use as a separator 
  5408. inside parameters like chooserlabels, tags, penmapdata, ...
  5409.  
  5410.  You should usually use this alone on a modify line, used inside modify 
  5411. commands like add node it will cause an extra 'ok' in the response line.
  5412.  
  5413. Quiet  (q)
  5414.  
  5415.  Tell the pipe not to reply to the modify commands. This is actually a toggle 
  5416. switch turning replies off and on. SOME modify commands are ALWAYS replied 
  5417. to. (addnode and getfile selected 0|1)
  5418.  
  5419. refresh (ref)
  5420.  
  5421.  Refresh the gadget referenced by GID. The refresh command can be combined 
  5422. with any other modify command and is always executed last. GID=0 will refresh 
  5423. the windows root layout, this is the best way to refresh all gadgets.
  5424.  
  5425.  Refresh without a GID specified will refresh the entire window, usually it 
  5426. is better to refresh the root class as described above.
  5427.  
  5428. close
  5429.  
  5430.  Close the CA window. Dispose of window and end the pipe connection to the 
  5431. GUI host.
  5432.  
  5433. tick=number
  5434.  
  5435.  End the modify conversation, Reply with a tick event after number/100 
  5436. seconds.
  5437.  
  5438. Continue (con)
  5439.  
  5440.  End the modify conversation.
  5441.  
  5442. Modifyoff (m)
  5443.  
  5444.  End the modify conversation AND turn modify off. (do not start any new 
  5445. modify conversations). Note there will be no way to turn modify back on.
  5446.  
  5447. Beep=num
  5448.  
  5449.  Beep the display. If num =0 beep all screens , else beep the GUI's screen.
  5450.  
  5451.  
  5452. Bubble Help
  5453. ------------
  5454.  
  5455. Help="num"
  5456.  
  5457.  If num =0 turn help events off, if num!=0 then turn help events on.
  5458.  
  5459.  Each GUI can only show one bubble help window at a time.
  5460.  
  5461. bubble top=numx left=numy gt="Help Text"
  5462.  
  5463.  This opens a bubble showing the help text. Top and left are mouse location 
  5464. for the help (as sent to you in the help event you are responding to). Any 
  5465. previous help window will be closed.
  5466.  
  5467.  'bubble' sent with no parameters will close the bubble with out opening a 
  5468. new one.
  5469.  
  5470. Image Functions
  5471. ----------------
  5472.  
  5473. FreeImage="num"  fi=
  5474.  
  5475.  if num=-1 Dispose of a previously defined image without using it. Else free 
  5476. the root bitmap image in buffer num. Be careful not to do this while images 
  5477. still exist that reference this root bitmap.
  5478.  
  5479. Draw="num" top="num" left="num" [target=GID][nozz][noclip]
  5480.  
  5481.  Draw an image into the gui. Num is the number of the predefined image to be 
  5482. drawn. You MUST set 'top' and 'left' and can also set
  5483.  
  5484. target=GID
  5485.  
  5486.  Reference (clip & offset) drawing to inside the object specified by GID. If 
  5487. target is not given drawing is refrenced to inside the borders of the GUI.
  5488.  
  5489.  nozz
  5490.  
  5491.  Make top and left relative to the whole window rather than the inner panel 
  5492. or specified target.
  5493.  
  5494. noclip
  5495.  
  5496.  Allow images to overwrite the entire window, borders and all.
  5497.  
  5498.  The image number relates to images you have created but not used in your 
  5499. GUI.
  5500.  For example...
  5501.  
  5502.  You create an image 'bitmap fn="cat.gif"'  it is image 0.
  5503.  You create another image 'bitmap fn="dog.gif"' it is image 1.
  5504.  You create another image 'bitmap fn="bird.gif"' it is image 2.
  5505.  
  5506.  You create a BUTTON using the last image created 'button useimage', the
  5507.  button used the bird image so it is no longer in the image list.
  5508.  
  5509.  You create another image 'bitmap fn="frog.gif"' it is image 2.
  5510.  
  5511.  You now have 3 images available to draw
  5512.  
  5513.  0 cat
  5514.  1 dog
  5515.  2 frog
  5516.  
  5517.  Drawing images DOES NOT remove images from the image list. Incorporating 
  5518. images directly in your GUI DOES remove images from the image list. The image 
  5519. number is NOT related to the buffer number in the bitmap image parameters.
  5520.  
  5521.  
  5522. GID 0
  5523. -------
  5524.  
  5525. GID 0 is used to specify the GUI window itself. It can be used to control 
  5526. certain aspects of the window. (see window docs)
  5527.  
  5528. Defining new gadgets during modify
  5529. ------------------------------------
  5530.  
  5531. define
  5532.  
  5533.  This causes the current line to be used as a Gadget definition statement 
  5534. rather than modify. You can add or replace gadgets in the already opened 
  5535. window. You may need to send a refresh modify command to make the changes 
  5536. visible.
  5537.  
  5538. replace="GID"
  5539.  
  5540.  The newly defined gadget replaces the existing gadget specified by GID. The 
  5541. pipe tries to free the resources used by the previous gadget right away, but 
  5542. some memory is not freed until the pipe is closed.
  5543.  
  5544.  WHEN USING REPLACE DO NOT ASSUME WHAT THE RESULTING GID OF THE NEW GADGET 
  5545. WILL BE. The usual sequence of allocated gadget ID's is not followed. 
  5546. Replacing a layout group frees all gadgets in the group as well as the layout 
  5547. itself. Replacing a listbrowser frees its nodes.
  5548.  
  5549.  You MUST keep track and not try to access gadgets that no longer exist.
  5550.  
  5551.  It may be better to close the window and open a new one rather than using 
  5552. replace or define. On the other hand some pretty neat thing can be done using 
  5553. define and replace. ;-D
  5554.  
  5555.  
  5556.  
  5557. ------------------------------------------------------------------------------
  5558.                                4.5 GUI Tutorial                               
  5559. ------------------------------------------------------------------------------
  5560.  
  5561.  
  5562. ------------------------------------------------------------------------------
  5563.                                  4.5.1 Design                                 
  5564. ------------------------------------------------------------------------------
  5565.  
  5566.  Working through these tutorials in order is the best way to learn to build 
  5567. GUI's with AWNPipe. A few minutes here will save you hours of development 
  5568. time later.
  5569.  
  5570.  TUTORIAL 1
  5571. -----------
  5572.  
  5573. Building GUIs can be VERY easy, This first tutorial will develop a simple 
  5574. GUI.
  5575.  
  5576. Create a simple 4 line text file called first.gui. (You can use drag 
  5577. selection and Right-Amiga-C to copy text from these docs.)
  5578.  
  5579.  title "My first GUI" defaultgadgets
  5580.  button gadgettext "YES"
  5581.  button gt "NO"
  5582.  open
  5583.  
  5584. Now, in a shell, type 'copy first.gui awnpipe:/xc'.
  5585.  
  5586. That was easy. You already guessed that gt was a short form for gadgettext.
  5587.  
  5588. Now we want to see what events the GUI sends. We can direct the events to a 
  5589. con by adding 'wcon:' to the end of the pipe name. Try
  5590.  
  5591. 'copy first.gui awnpipe:/xcwcon:'
  5592.  
  5593. Look at the output in the con:. Notice that the pipe replies to each line of 
  5594. the definition file, as well as sending events.
  5595.  
  5596. Now add a little text to the gui. We will also provide keyboard shortcuts for 
  5597. the gadgets.
  5598.  
  5599.  title "My first GUI" defaultgadgets
  5600.  label  gt " Select YES or NO "
  5601.  button gadgettext "_YES"
  5602.  button gadgettext "_NO"
  5603.  open
  5604.  
  5605. That worked, but it looks a little UGLY. Let's try a vertical layout instead 
  5606. of the default horizontal layout.
  5607.  
  5608.  title "My first GUI" defaultgadgets  vertical
  5609.  label  gt " Select YES or NO "
  5610.  button gadgettext "_YES"
  5611.  button gadgettext "_NO"
  5612.  open
  5613.  
  5614. The GUI is starting to look better, but we really want the two gadgets 
  5615. side-by-side. To do that, we will use a layout group. ("le" is short for 
  5616. "layout end".)
  5617.  
  5618.  title "My first GUI" defaultgadgets  vertical
  5619.  label  gt " Select YES or NO "
  5620.  layout
  5621.  button gadgettext "_YES"
  5622.  button gadgettext "_NO"
  5623.  le
  5624.  open
  5625.  
  5626. That is much better! The GUI looks good, but it would be nicer if the window 
  5627. closed after the user selected yes or no. (You should also notice that the 
  5628. layout received a GID number, so yes and no are now gadget 2 and 3.)
  5629.  
  5630.  title "My first GUI" defaultgadgets  vertical
  5631.  label  gt " Select YES or NO "
  5632.  layout
  5633.  button gadgettext "_YES" close
  5634.  button gadgettext "_NO" c
  5635.  le
  5636.  open
  5637.  
  5638. It's done and it might even be useful.
  5639.  
  5640. Since we have a working GUI, let's use it to see a few other types of events 
  5641. the GUI can generate.
  5642.  
  5643.  title "My first GUI" defaultgadgets  vertical  sendkeys sendqual help state
  5644.  label  gt " Select YES or NO "
  5645.  layout
  5646.  button gadgettext "_YES" close
  5647.  button gadgettext "_NO" c
  5648.  le
  5649.  open
  5650.  
  5651. Activate and deactivate the window. Hold the mouse over each gadget. Type a 
  5652. few keys. Try the shift, alt etc.
  5653.  
  5654.  
  5655.  
  5656. ------------------------------------------------------------------------------
  5657.                                4.5.2 Operation                                
  5658. ------------------------------------------------------------------------------
  5659.  
  5660. This tutorial has two versions, Arexx and 'C'. The 'C' tutorial is after the 
  5661. Arexx one.
  5662.  
  5663. Before reading further, take a moment to run the tutorial so you understand 
  5664. what the program does.
  5665.  
  5666. TUTORIAL 2 ARexx
  5667. ----------------
  5668.  
  5669.  Now that we know how to designed a GUI we want to be able to operate one. To 
  5670. follow this example you need a basic knowledge of ARexx. Have a look at the 
  5671. file Tutorial2.rx in the demos drawer.
  5672.  
  5673.  The program flow is straight forward. 3 simple steps.
  5674.  
  5675. 1. Default values are set. These are the values of the gadgets when the GUI 
  5676. opens.
  5677.  
  5678. 2. A routine (buildgui) is called to write the GUI definition to the pipe. 
  5679. (More on this routine later)
  5680.  
  5681. 3. Events are read from the pipe and processed until the stream of events 
  5682. ends.
  5683.  
  5684. BUILDGUI
  5685.  
  5686.  The 'buildgui' routine contains the information defining the GUI window and 
  5687. its gadgets. The data is sent line by line to the 'topipe' routine which 
  5688. sends the data to the pipe, checks for errors, and returns the GID returned 
  5689. by the pipe. (more on 'topipe' later.)
  5690.  
  5691.  For most lines sent with 'topipe' the response is ignored. For gadget 
  5692. definitions however the return value is stored so we can identify gadget 
  5693. events later on.
  5694.  
  5695. TOPIPE
  5696.  
  5697.  This routine takes a line of text and writes it to the pipe. The pipes 
  5698. response is read. If everything is ok the second parameter of the response is 
  5699. returned. This is the GID if a gadget is defined and a null string in most 
  5700. other cases. If an error occurs the problem line is output and the script 
  5701. exits.
  5702.  
  5703.  You should use this routine or one like it when writing your own script for 
  5704. AWNPipe. It will help avoid common errors and make debugging much easier.
  5705.  
  5706. EVENT HANDLING
  5707.  
  5708.  The main loop reads an event from the pipe and parses it into its parts. The 
  5709. first word of an event always tells the event type. This information is used 
  5710. to call a routine for that type of event.
  5711.  
  5712. CLOSE EVENT
  5713.  
  5714. If a close event is received write a little text and then exit the script.
  5715.  
  5716. GADGET EVENT
  5717.  
  5718.  We check the second word of the event to see which gadget sent the event. 
  5719. For most gadgets we store event information and return. If the cancel gadget 
  5720. is the cause of the event we output some text and exit. If it was the done 
  5721. gadget we output the information for each gadget and exit. If it was the 
  5722. reset gadget we close the pipe, then create the gui again to restore the 
  5723. default values.
  5724.  
  5725. MENU EVENT
  5726.  
  5727.  The second word of a menu event is the menu number, the third word id the 
  5728. item number, and the forth the subitem number. This information is used to 
  5729. determine what action should be taken in response to an event.
  5730.  
  5731.  Almost any GUI can be operated using this approach demonstrated in this 
  5732. tutorial. Use these functions as building blocks in your own scripts.
  5733.  
  5734. TUTORIAL 2 in C
  5735. ----------------
  5736.  
  5737. The files tutorial2.c and tutorial2 can be found in in the demos drawer.
  5738.  
  5739.  Now that we know how to designed a GUI we want to be able to operate one. To 
  5740. follow this example you need a basic knowledge of 'C'. Have a look at the 
  5741. file Tutorial2.c in the demos drawer. We will examine each of the functions 
  5742. in detail since they will be useful building blocks for making other GUIs. 
  5743. There is only 1 interesting structure.
  5744.  
  5745. struct GUIpipe myGP
  5746.  
  5747. This structure is used to manage the GUI. It contains the GUIs file handle, 
  5748. error status,and read buffer. It as has storage for some useful data parsed 
  5749. from replies or events.
  5750.  
  5751.  int main( int argc, char *argv[]);
  5752.  
  5753.  The program flow is straight forward. Default values are set. We call a 
  5754. routine to build the GUI and operate the gui if we built it successfully. To 
  5755. operate the GUI we simply read events and react to them. Before we exit we 
  5756. make sure the GUIs filehandle is closed.
  5757.  
  5758.  int getline(struct GUIpipe * GP);
  5759.  
  5760.  We need to handle text one line at a time when operating the GUI. This 
  5761. routine reads the pipe making a sure a full line is available before 
  5762. returning. It will remove the previous line from the buffer first if there 
  5763. was one. We delimit the line with a null byte so we can use it as a string in 
  5764. other functions.
  5765.  
  5766.  __stdargs int topipe(struct GUIpipe * GP, UBYTE * data,...)
  5767.  
  5768.  Again and Again you will need to write a line to the pipe and read the 
  5769. response. This routine does that for you. It writes data to the pipe and then 
  5770. reads a reply from the pipe. The reply line is parsed, and an error is 
  5771. flagged if the first part of the reply is not 'ok'. We return the value of 
  5772. the second reply part if all is ok, return 0 if an error occurred.
  5773.  
  5774.  topipe allows Printf like formatting of data written to the pipe (VFPrintf 
  5775. is used). The regular Printf formats are supported. This is not needed in 
  5776. this example but it will be very useful as we expand the program in the other 
  5777. tutorials.
  5778.  
  5779.  int buildgui(struct GUIpipe * GP);
  5780.  
  5781.  All the information that defines the GUI is contained in this function. It 
  5782. opens a filehandle on the AWNPipe device and returns an error if this fails. 
  5783. The window and gadget definitions are written to the pipe and the returned 
  5784. gadget ID's are stored. If all gadgets are created ok the window is opened. 
  5785. The final error status of the GUI is returned.
  5786.  
  5787. int getevent(struct GUIpipe * GP);
  5788.  
  5789.  This routine reads a line from the pipe and parses it storing information 
  5790. about the event. It returns the error status of the pipe.
  5791.  
  5792.  int gadgets(struct GUIpipe * GP);
  5793.  int menu(struct GUIpipe * GP);
  5794.  
  5795.  These routines look at the information parsed from the last event and take 
  5796. appropriate action depending which gadget or menu item was selected. Some 
  5797. times the gadget state information from the event is stored. Other times 
  5798. information is output to the user.
  5799.  
  5800.  int gperror(struct GUIpipe * GP,int error);
  5801.  
  5802.  When an error is detected while reading or writing to the pipe this routine 
  5803. is called. It sets the error status and alerts the user an error has 
  5804. occurred.
  5805.  
  5806.  UBYTE * eventstr(struct GUIpipe * GP, int num);
  5807.  
  5808. Some fields in events , like string gadget contents, can contain spaces. This 
  5809. functions returns a pointer to the 'num' word of the event. Since the line is 
  5810. delimited by a null you can treat this as a string pointer. If the 'num' word 
  5811. is not found NULL is returned. The pointer is only valid until the next call 
  5812. to getline(), getevent(), or topipe().
  5813.  
  5814.  Almost any GUI can be operated using this approach demonstrated in this 
  5815. tutorial.
  5816.  
  5817. ------------------------------------------------------------------------------
  5818.                               4.5.3 Modification                              
  5819. ------------------------------------------------------------------------------
  5820.  
  5821.  Before reading this section take a moment and run tutorial 3, knowing what 
  5822. the GUI does will help in understanding the code behind it.
  5823.  
  5824. This tutorial has two versions, Arexx and 'C'. The 'C' tutorial is after the 
  5825. Arexx one.
  5826.  
  5827. TUTORIAL 3 AREXX
  5828. ---------------
  5829.  
  5830.  This tutorial deals with modifying a GUI after it has been opened. You 
  5831. should make sure you understand tutorial 2 before reading further.
  5832.  
  5833.  Three new gadgets have added to the gui. The load and save gadgets on the 
  5834. lower left, and a get file gadget that you do not see. The getfile gadget is 
  5835. unattached (ua) so it is not displayed in the gui. More on the getfile gadget 
  5836. later.
  5837.  
  5838.  The window definition line (in buildGUI:) has the modify option added to it. 
  5839. This means the pipe will look for modify commands after you fist open the 
  5840. window, and after each event is sent. Any number of modify commands can be 
  5841. written to the pipe, including 0 (none). After writing the modify commands 
  5842. 'continue' must be sent to the pipe to tell it to start sending events. After 
  5843. you get an event the pipe starts waiting for modify commands again.
  5844.  
  5845.  Only two changes are made in the program flow.
  5846.  
  5847. 1.  After BUILDGUI is called to build and open the window we send a modify 
  5848. command to the pipe.
  5849.  
  5850. topipe('id 'savegad' dis 1 ref')
  5851.  
  5852.  The id specifies the save gadget, 'dis 1' disables it, and 'ref' refreshes 
  5853. it so the changes will show. (we want the save gadget disabled because the 
  5854. name gadget is empty at start up, and we need a name before we can save).
  5855.  
  5856. 2. In the mail loop a 'continue' is written to the pipe BEFORE we wait for an 
  5857. event. This tells to pipe to stop looking for modify commands and send an 
  5858. event.
  5859.  
  5860.  After an event is read from the pipe it automatically starts looking for 
  5861. more modify events. This means that modify commands can be used immediately 
  5862. after receiving an event from the pipe.
  5863.  
  5864.  RESETFORM
  5865.  
  5866.  In tutorial 2 we had to close then open the GUI to reset its contents. With 
  5867. modify commands we can do this with the gui remaining open. The function 
  5868. resetform is near the end of tutorial3.rx.
  5869.  
  5870.  This function sends a modify command for each of the gadgets resetting them 
  5871. to the default values. It also disables the save gadget.
  5872.  
  5873.  SAVEFORM
  5874.  
  5875.  This function is called when the user hits the save gadget. It writes the 
  5876. forms contents to a file in 't:'. The files name is the text from the name 
  5877. gadget with '.formdemo' appended to it. The save gadget is disabled unless 
  5878. the name gadget contains text. See the handling of namegad in the GADGET: 
  5879. routine.
  5880.  
  5881.  LOADFORM
  5882.  
  5883.  This function makes use of the unattached GETFILE gadget. A modify command 
  5884. is used to set the file name in the file requester, and to open the requester 
  5885. itself. The pattern used in the file requester was set when the gadget was 
  5886. created in the BUILDGUI routine.
  5887.  
  5888. call writeln(ca,'id 'getfilegad' fn "t:" s 1')
  5889.  
  5890. 'fn "t:"' sets the file requester to the drawer T:. 's 1' opens the 
  5891. requester.
  5892.  
  5893.  The return from the pipe to this modify command is read and parsed to get 
  5894. the file selected and to test if the user selected a file or aborted the 
  5895. requester. The reply from the pipe is ...
  5896.  
  5897. SUCCESS ["filename"]
  5898.  
  5899.  Success is 0 if the user aborts the file requester, non zero if a file is 
  5900. selected. The file name is always returned in quotes since multiple files can 
  5901. be selected in some situations. (but not this situation).
  5902.  
  5903.  If the user selected a file, it is opened and the contents placed in the 
  5904. GUI. No error checking is done on the file in order to keep the tutorial 
  5905. clear and easy to understand.
  5906.  
  5907. TUTORIAL 3 in C
  5908. ---------------
  5909.  
  5910.  This tutorial deals with modifying a GUI after it has been opened. You 
  5911. should make sure you understand tutorial 2 before reading further.
  5912.  
  5913.   int buildgui(struct GUIpipe * GP);
  5914.  
  5915. The window definition line (in buildgui()) has the modify option added to it. 
  5916. This means the pipe will look for modify commands after you fist open the 
  5917. window, and after each event is sent. Any number of modify commands can be 
  5918. written to the pipe, including 0 (none). After writing the modify commands 
  5919. 'continue' must be sent to the pipe to tell it to send an event. After you 
  5920. get an event the pipe starts waiting for modify commands again.
  5921.  
  5922.  Three new gadgets have added to the gui. The load and save gadgets on the 
  5923. lower left, and a get file gadget that you do not see. The getfile gadget is 
  5924. unattached (ua) so it is not displayed in the gui. More on the getfile gadget 
  5925. later.
  5926.  
  5927.  int main( int argc, char *argv[]);
  5928.  
  5929.  Only two changes are made in the program flow.
  5930.  
  5931. 1.  After buildgui() is called to build and open the window we send a modify 
  5932. command to the pipe.
  5933.  
  5934.      topipe(GP,"id %ld dis 1 ref\n",savegad);
  5935.  
  5936.  The id specifies the save gadget, 'dis 1' disables it, and 'ref' refreshes 
  5937. it so the changes will show. (we want the save gadget disabled because the 
  5938. name gadget is empty at start up, and we need a name before we can save).
  5939.  
  5940. 2. In the main loop a 'continue' is written to the pipe BEFORE we wait for an 
  5941. event. This tells to pipe to stop looking for modify commands and send an 
  5942. event.
  5943.  
  5944.  After an event is read from the pipe it automatically starts looking for 
  5945. more modify events. This means that modify commands can be used immediately 
  5946. after receiving an event from the pipe.
  5947.  
  5948.  int gadgets(struct GUIpipe * GP);
  5949.  
  5950.  The 'loadgad' and 'savegad' gadgets are recognised, and the handling of 
  5951. 'namegad' and 'resetgad' have changed.
  5952.  
  5953.  In tutorial 2 we had to close then open the GUI to reset its contents. With 
  5954. modify commands we can do this with the gui remaining open. We set our 
  5955. default form information and call updategui().
  5956.  
  5957.  Namegad enables or disables the savegad. If no name is set we can not 
  5958. generate a filename to save the information to.
  5959.  
  5960. int updategui(struct GUIpipe * GP);
  5961.  
  5962.  This routine updates the GUI to show the values we have stored internaly. A 
  5963. modify line is sent for each gadget. The function updateform is near the end 
  5964. of tutorial3.rx.
  5965.  
  5966.  int saveform(VOID);
  5967.  
  5968.  This function is called when the user hits the save gadget. It writes the 
  5969. forms contents to a file in 't:'. The files name is the text from the name 
  5970. gadget with '.formdemo' appended to it. The save gadget is disabled unless 
  5971. the name gadget contains text. See the handling of namegad in the gadget() 
  5972. routine.
  5973.  
  5974.  int loadform(struct GUIpipe * GP);
  5975.  
  5976.  This function makes use of the unattached GETFILE gadget. A modify command 
  5977. is used to set the file name in the file requester, and to open the requester 
  5978. itself. The pattern used in the file requester was set when the gadget was 
  5979. created in the BUILDGUI routine.
  5980.  
  5981.    FPrintf(GP->file,"id %ld fn \"t:\" s 1\n",getfilegad);
  5982.    if (getevent(GP)) return(1);
  5983.  
  5984.  
  5985. 'fn "t:"' sets the file requester to the drawer T:. 's 1' opens the 
  5986. requester.
  5987.  
  5988.  The return from the pipe to this modify command is read and parsed as an 
  5989. event since it does not return the usual 'ok'. The reply from the pipe is ...
  5990.  
  5991. SUCCESS ["filename"]
  5992.  
  5993.  Success is 0 if the user aborts the file requester, non zero if a file is 
  5994. selected. The file name is always returned in quotes since multiple files can 
  5995. be selected in some situations. (but not this situation).
  5996.  
  5997.  If the user selected a file, it is opened and the contents parsed into out 
  5998. internal form information. Then updategui() is called.. No error checking is 
  5999. done on the file in order to keep the tutorial clear and easy to follow.
  6000.  
  6001.  
  6002.  __stdargs int topipe(struct GUIpipe * GP, UBYTE * data,...);
  6003.  int getline(struct GUIpipe * GP);
  6004.  int gperror(struct GUIpipe * GP,int error);
  6005.  int getevent(struct GUIpipe * GP);
  6006.  int menu(struct GUIpipe * GP);
  6007.  UBYTE * eventstr(struct GUIpipe * GP, int num);
  6008.  VOID setdefaults(VOID);
  6009.  
  6010.  These routines have not been changed from Tutorial 2.
  6011.  
  6012.  
  6013. ------------------------------------------------------------------------------
  6014.                                  4.5.4 Extras                                 
  6015. ------------------------------------------------------------------------------
  6016.  
  6017.  If you have read the first three tutorials, but not tried building a GUI of 
  6018. your own, you should try writing a simple gui of your own before reading 
  6019. further. Tutorial 4 will be simpler to understand once you have gained a 
  6020. little experience with AWNP.
  6021.  
  6022.  Before reading this section take a moment and run tutorial 4, knowing what 
  6023. the GUI does will help in understanding the code behind it.
  6024.  
  6025.  Although Tutorial 4 is available in 'C' or Arexx the discussion is kept 
  6026. general and it applies to both.
  6027.  
  6028. TUTORIAL 4
  6029. -----------
  6030.  
  6031.  This tutorial deals with adding some of the finishing touches to AWNP GUI's. 
  6032. You should make sure you understand tutorial 3 before reading further.
  6033.  
  6034.  A few simple changes are made in the GUI. It has an iconify gadget and can 
  6035. be resized. This is done by adding 'ig' iconfygadget, 'sg' sizegadget and 
  6036. 'ii' iconimage. 'ii' specifys the file (without the .info) whose icon is used 
  6037. when iconfying the GUI, it can be omitted and default icon will be displayed. 
  6038. The 'fh' fixheight limits the sizing gadget to changing the GUI's width.
  6039.  
  6040.  Another change has been made in the GUI, it is set as an app window 
  6041. 'app'.Now when an icon is dropped on the gui (or its iconified image) an 
  6042. event is generated passing the file name of the icon that was dropped. The 
  6043. event is 'app path:filename'.
  6044.  
  6045.  We respond to the app event by uniconifying the GUI (if necessary) and 
  6046. loading the file that was dropped. Try saving some info then dropping the 
  6047. icon of the saved info on the GUI.
  6048.  
  6049.  The iconify gadget also produces a special event. 'iconify MODE' where 
  6050. MODE=1 means the user wants to iconify the GUI, and 0 means it should be 
  6051. uniconified. A simple modify line does this.
  6052.  
  6053. 'id 0 s 32' to iconify
  6054. 'id 0 s 64' to uniconify
  6055.  
  6056.  The menu now has options to snapshot the window. The windows size and 
  6057. location are read with
  6058.  
  6059. 'id 0 read' the pipe responds with
  6060. 'TOP LEFT WIDTH HEIGHT'   not with 'ok'
  6061.  
  6062.  The information is stored in ENV(ARC): . Before the GUI is opened we check 
  6063. for the information and use it in the window definition line if its 
  6064. available.
  6065.  
  6066.  The about item in the menu now opens a separate GUI. It is a simple window 
  6067. with no gadgets just a label used to display some text. Although the routine 
  6068. used to build the about GUI is trivial it has an interesting ability. It can 
  6069. be made to close automatically after a specific delay.
  6070.  
  6071.  A gui window will close automatically if it tries to read a modify command 
  6072. and you have already closed your end of the pipe. We open the GUI then send a 
  6073. 'tick' modify command to the pipe. This works like 'continue' except the pipe 
  6074. will send back our tick as an event weather the user hits a gadget or not. 
  6075. After sending us the tick event back AWNP tries to read a modify command and 
  6076. THEN discovers we have closed the pipe. If the delay is set as 0 we simply 
  6077. turn modify off and the GUI waits until the close gadget is hit.
  6078.  
  6079.  The data menu items now display information the same way the about requester 
  6080. does.
  6081.  
  6082.  
  6083.  
  6084. ------------------------------------------------------------------------------
  6085.                                 4.5.5 Advanced                                
  6086. ------------------------------------------------------------------------------
  6087.  
  6088.  Tutorial 5 adds new functions, Bubble Help, an arexx host, tooltypes and 
  6089. commodity. Although they are advanced features by now it should be easy for 
  6090. you to follow the logic. They work in very similar ways to the other objects 
  6091. you have learned to deal with. Adding these sort of features to your own 
  6092. GUI's will help make them Quality programs.
  6093.  
  6094.  Before reading this section take a moment and run tutorial 5, knowing what 
  6095. the GUI does will help in understanding the code behind it.
  6096.  
  6097.  Tutorial 5 is only available in Arexx for now, the discussion is kept 
  6098. general and it applies to both 'C' and ARexx.
  6099.  
  6100. TUTORIAL 5
  6101. -----------
  6102.  
  6103.  Most users only scan documentation at best. To allow users to quickly 
  6104. understand your programs Bubble help is very useful.
  6105.  
  6106.  A few simple changes are made in the window definition. It now tells the GUI 
  6107. to send help and window activation events.This is done by adding 'help' and 
  6108. 'state' keywords.
  6109.  
  6110.  A menu option has been added to turn the help bubbles on or off.
  6111.  
  6112.  A change has been made in the main loop, we send 'tick 50' rather than 
  6113. continue when we want to get an event from the pipe. Like continue this ends 
  6114. the modify command part of the conversation and tells the GUI to send us an 
  6115. event. It also forces the GUI to send us a 'tick' event after 50/100 of a 
  6116. second. We use these tick events to delay the displaying of help bubbles.
  6117.  
  6118.  Tick events have other uses, like returning control back to your code after 
  6119. a set delay so it does not wait forever for an event. For now we will just 
  6120. look at the help delay.
  6121.  
  6122.  Each time an event is read in the main loop we check a delay counter. If the 
  6123. counter counts down to 0 we open a help bubble (using some previously stored 
  6124. information). The HELPX and HELPY are used to determine a position for the 
  6125. bubble and MUST be given.
  6126.  
  6127. 'bubble top HELPX left HELPY gt "HELP TEXT"'
  6128.  
  6129.  We also must handle new events, help, arexx, cx and active.
  6130.  
  6131.  We respond to the help event by calling the bubble routine. This routine 
  6132. checks to see if the help event is the same as the last one. If yes we do 
  6133. nothing. If it changed we close the old help window, if we had one, by 
  6134. sending a bubble modify command with no parameters.
  6135.  
  6136. 'bubble'
  6137.  
  6138.  If the event was gadget 0 or -1 we have nothing more to do since they 
  6139. represent the mouse not being over a valid gadget. If the gadget number is 
  6140. valid we store the mouse position that is returned in the help event and the 
  6141. gadget number. We start the delay counter and return.
  6142.  
  6143.  If we receive any activation event, or iconify the gui, we call bubble(0) to 
  6144. close any open bubble help. This needed in case our window becomes inactive 
  6145. due to another window being opened.
  6146.  
  6147.  An arexx host has been added to the GUI. The ARexx host name is 'TUTORIAL5'. 
  6148. This allows a few things.
  6149.  
  6150.  topipe(' arexx gt "TUTORIAL5|age|sex|knowledge|front|quit"')
  6151.  
  6152.  If upon startup the host already exists we know tutorial 5 is already 
  6153. running so the already running gui and brought to front rather than a second 
  6154. occurrence of tutorial 5 being opened.
  6155.  
  6156.  The following arexx commands are supported.
  6157.  
  6158.  front -bring the window to front.
  6159.  quit  -quit tutorial5
  6160.  age [#]  -read or set the age
  6161.  sex [#]  -read or set the sex
  6162.  knowledge [#] -read or set knowledge
  6163.  (See the rxhst: routine)
  6164.  
  6165.  Tutorial 5 is also a commodity.
  6166.  
  6167. topipe('commodity cxname Demo5 cxtitle="AWNPipe demo 5" cxdesc="Disable 
  6168. Enable ignored..." cxhotkey="ctrl alt 5"')
  6169.  
  6170. It supports a hotkey (ctrl alt 5), show or hide the gui, and remove. 
  6171. Enable/disable are ignored as they make no sense in the context of Tutorial 5 
  6172. ...
  6173. (See the commodity: routine)
  6174.  
  6175. TOOLTYPES
  6176.  
  6177.  Tooltype reading is actually not part of the AWNPipe GUI host, its a 
  6178. completely different host inside AWNPipe. Since tooltypes are desirable for 
  6179. almost all programs it has been added to this tutorial. You find the function 
  6180. simple to use.
  6181.  
  6182. Reading tooltypes
  6183.  
  6184.  The tooltypes are read by a function called tooltypes:. First the path to 
  6185. our program is found using 'parse source'. Then a special pipe is opened 
  6186. 'awnpipe:name/xtPATH:PROGRAM'. A line containing the tooltype we wish to 
  6187. check is written to this pipe. If the tool type is found we will read back 
  6188. from the pipe 'ok VALUE' where VALUE is the value associated with the tool 
  6189. type we asked for. If the tooltype is not found we read back a <cr> (empty 
  6190. line).
  6191.  
  6192.  When all the tooltypes have been checked we simply close the pipe connection 
  6193. to the tooltype host.
  6194.  
  6195.  In tutorial5 the windows size/position and bubble help setting are now kept 
  6196. as a tooltype.
  6197.  
  6198. There are also tooltypes to preset the age, knowledge, sex and name. You can 
  6199. force the window to iconify after opening with the iconify tooltype.
  6200.  
  6201. Writing tooltypes
  6202.  
  6203.  
  6204. ------------------------------------------------------------------------------
  6205.                                   4.5.6 Tips                                  
  6206. ------------------------------------------------------------------------------
  6207.  
  6208.  A few quick hints about building and debugging AWNP applications.
  6209.  
  6210. Before writing an AWNP GUI application prototype the GUI with a simple text 
  6211. file (mygui). Use
  6212. 'copy mygui awnpipe:pipename/xcwcon:'
  6213.  
  6214. This speeds up testing of layout changes! Also note you can comment out lines 
  6215. in your file by starting them with ';'. Any line with a semicolon in the 
  6216. first position is ignored.
  6217.  
  6218. --
  6219.  
  6220.  NAME YOUR PIPES !
  6221.  
  6222.  Rather than opening 'awnpipe:/xc' provide a unique name. Use 
  6223. 'awnpipe:PipeName/xc'.
  6224.  
  6225.  A common problem when developing an AWNP application is to find the pipe 
  6226. conversation hangs. Usually this means your program is trying to read data 
  6227. from the pipe, and the pipe is trying to read data from your application. (a 
  6228. read is pending on both ends of the pipe).
  6229.  
  6230.  This can be cleared by issuing a simple shell command.
  6231.  
  6232. 'echo >awnpipe:PipeName/a'
  6233.  
  6234.  Both reads are aborted and AWNP usually notices a problem and exits cleanly.
  6235.  
  6236. --
  6237.  
  6238.  Some times it will be useful to trace the conversation your program has with 
  6239. AWNP. Again this can be done with a simple shell command.
  6240.  
  6241. 'type awnpipe:PipeName/t/i'
  6242.  
  6243.  All data passing either way through the pipe will be output. When your 
  6244. program exits the type command will return. ( this is not limited to to GUI 
  6245. applications. It works for ALL awnp connections!)
  6246.  
  6247.  You can also use
  6248.  
  6249. 'copy awnpipe:PipeName/t/i mylogfile'
  6250.  
  6251.  This saves the conversation to the logfile of course.
  6252.  
  6253.  You can use both at the same time, in fact you can 'twin' the data stream as 
  6254. many times as you like.
  6255.  
  6256.  Some times during testing you might create a GUI with no close gadget, you 
  6257. can usually close ANY GUI with 'control backslash' like you can with a con:.
  6258.  
  6259. --
  6260.  
  6261.  In general you can not assume that you can modify all the parameters you can 
  6262. define for objects. Also in some cases the parameter names or usage may be 
  6263. different in the modify command when compared to the definition line.
  6264.  
  6265. ------------------------------------------------------------------------------
  6266.                                    5 Demos                                    
  6267. ------------------------------------------------------------------------------
  6268.  
  6269.  Several GUIs of example gadgets can be viewed by running the Gadgets# in the 
  6270. demos drawer inside AWNP-Docs. To generate these GUIs a simple text file is 
  6271. being copied to a GUI generating pipe. The 'wcon:300//200/200/PipeEvents' at 
  6272. the end of the pipe name simply sends the output of the pipe to a con so you 
  6273. can see what is going on.
  6274.  
  6275.  Some example scripts using pipe generated GUIs are also in the demo drawer. 
  6276. These demos are mostly ARexx or ADOS scripts. Load them in your text editor 
  6277. and take a look at them. I think you will find they are very simple script 
  6278. considering the powerful GUIs they create. Reading the comments in the 
  6279. scripts should help you when learning to build and operate your own AWNPipe 
  6280. GUIs.
  6281.  
  6282. ---
  6283.  
  6284.  CAList is an ADOS script. It is graphical wrapper for the standard list 
  6285. command. It is a VERY simple script. Put it in 'C:' with its script bit set 
  6286. if you like it enough to make regular use of it. Use 'calist ?' to get a 
  6287. usage display.
  6288.  
  6289.  This script gives a good example of how to build a simple gui. It shows how 
  6290. much can be accomplished  in a short script.
  6291.  
  6292. ---
  6293.  
  6294.  Form is an ADOS script that displays a form. Use 'execute Form' or set the 
  6295. script bit for the file and simply type 'form'.
  6296.  
  6297.  This gui is truly interactive and requires the name to be set before the 
  6298. form is accepted. It allows resting of the form and knows when the user 
  6299. aborts.Its rather extreme for an ADOS script but is included to show you just 
  6300. how much can be accomplished with ADOS and AWNPipe working together. ADOS 
  6301. wizards may find the handling of the event file and environment variables 
  6302. interesting.
  6303.  
  6304. ---
  6305.  
  6306.  Fonttoy is an ADOS script to play with fonts. Use 'execute FontToy' or set 
  6307. the script bit for the file and simply type 'fonttoy'.
  6308.  
  6309.  This script creates a very simple gui. However it uses gadget 
  6310. interconnection to do some magic that only experienced GUI developers are 
  6311. likely to understand. It also uses numerical tag values, you will likely 
  6312. never do this. Note that numerical tags CAN be used with defining AWNPipe 
  6313. GUIs and this means you will be able to access new CA/Reaction features as 
  6314. they come out without changes to AWNPipe.
  6315.  
  6316. ---
  6317.  
  6318.  Dict-thesar.rx is an arexx script. It is run from its icon or shell. words 
  6319. are search in the Merriam Webster site so you must be online. The menu will 
  6320. start and control miami if you have it installed. Bubble help is provided and 
  6321. it is simple to use so no real docs are needed.
  6322.  
  6323. You should find this tool useful enough to keep installed on your system.
  6324.  
  6325. ---
  6326.  
  6327.  xo.rx is an arexx script. Use 'rx xo.rx' to run it. You must 'cd' into the 
  6328. demo drawer first so it can find its image file (xo.gif). It does not play 
  6329. against you so you must  play both sides of the game. (click in the squares).
  6330.  
  6331.  It changes the button images in a operating GUI. It shows how to create 
  6332. multiple images from a single source image. It also lets you see how to 
  6333. modify a gui after it has been opened. An additional gadget is even added to 
  6334. the GUI after it has been opened. Take a look at xo.gif in an image viewer, 
  6335. you may be surprised to see how small the image is.
  6336.  
  6337.  
  6338. ---
  6339.  
  6340.  DropBox.rx can be run from its icon or by typing 'rx dropbox.rx' in a shell. 
  6341. Looking at the tooltypes of Drop box should help you understand what is going 
  6342. on. You set tooltypes to tell the program what to do with files or drawers 
  6343. that are dropped on it. I hope it is something you will keep around and be 
  6344. able to make use of. With a little modification it could be very powerful 
  6345. indeed.
  6346.  
  6347.  The gui is so simple it almost unbelievable, however it is an app window. 
  6348. That makes it very special. The script also makes heavy use of AWNPipes 
  6349. ability to do pattern matching. Finally the script will also teach you how to 
  6350. read tooltypes using AWNPipe.
  6351.  
  6352. Possible tool types.
  6353.  
  6354. pat (pattern)=YourCommandText
  6355.  
  6356. This tells dropbox  to execute your command for any files that match the 
  6357. pattern you have set. '%f' in the command is replaced by the name of the file 
  6358. that was dropped on dropbox.
  6359.  
  6360. pat (pattern)=drawer
  6361.  
  6362. Tells DropBox to use its default drawer handling for that pattern.
  6363.  
  6364. pat (pattern)=image
  6365.  
  6366. Tells DropBox to use its default image handling for that pattern.
  6367.  
  6368. pat (pattern)=text
  6369.  
  6370. Tells DropBox to use its default text handling for that pattern.
  6371.  
  6372. bin BinaryPattern=YourCommandText
  6373.  
  6374. This tells dropbox  to execute your command for any files whose first 12 
  6375. bytes match the binarypattern you have set. '?' is the only wildcard allowed 
  6376. in the BinaryPattern. '%f' in the command is replaced by the name of the file 
  6377. that was dropped on dropbox. iconify
  6378.  
  6379. A tooltype of 'iconify' tells DropBox to iconify itself as soon as it is run. 
  6380. You can still drop files on the iconified window to have dropbox process 
  6381. them.
  6382.  
  6383. multi
  6384.  
  6385. A tooltype of 'multi' tells DropBox to allow files dropped on it to have more 
  6386. than one command run for them. The default is for dropbox only to only 
  6387. respond once to each file dropped.
  6388.  
  6389. ---
  6390.  
  6391.  The first real projects to use AWNPipe GUIs were some aweb utilities.
  6392.  
  6393. CacheControl.awebrx allows you to micro manage AWebs caching of websites.
  6394.  
  6395. Put the script and CacheControl_doc.html in AWeb3:plugins, it may be called 
  6396. directly from the ARexx menu or from an AWeb button.
  6397.  
  6398. GUI Button
  6399. name            CCtrl
  6400. command         run awebpath:plugins/cachecontrol.awebrx
  6401.  
  6402. ARexx Menu
  6403. title           CacheControl
  6404. macro           awebpath:plugins/cachecontrol.awebrx
  6405.  
  6406. ---
  6407.  
  6408. AWebModes.awebrx allows you to easily control many of AWebs settings. 
  6409. Gabriele Favrin has kindly allowed a version of it to be included here. Put 
  6410. the script and AWebModes_Doc.html in AWeb3:plugins, it may be called directly 
  6411. from the ARexx menu or from an AWeb button.
  6412.  
  6413. GUI Button
  6414. name            Modes
  6415. command         run awebpath:plugins/AwebModes.awebrx
  6416.  
  6417. ARexx Menu
  6418. title           AWebModes
  6419. macro           awebpath:plugins/AWebModes.awebrx
  6420.  
  6421. ---
  6422.  
  6423. DropZone.awebrx opens an appwindow on WB so you can drag and drop files to be 
  6424. displayed in AWeb, even while aweb is on its own screen. Put the script and 
  6425. DropZone_Doc.html in AWeb3:plugins. It may be called directly from the ARexx 
  6426. menu or from an AWeb button.
  6427.  
  6428. GUI Button
  6429. name            DZone
  6430. command         run awebpath:plugins/DropZone.awebrx
  6431.  
  6432. ARexx Menu
  6433. title           ChangeModes
  6434. macro           awebpath:plugins/DropZone.awebrx
  6435.  
  6436.