home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsd / evntshell / Docs / Manual-F < prev    next >
Encoding:
Text File  |  1995-11-11  |  58.6 KB  |  1,344 lines

  1.       Interim User Manual For EvntShell
  2.       ---------------------------------
  3.       
  4.       1  Introduction                          
  5.       2  Creating A New Application
  6.       3  A Tutorial
  7.       4  A General Overview
  8.           1.  Dynamic Windows
  9.           2.  Static Windows
  10.           3.  Resources
  11.                1. Templates
  12.                2. Sprites
  13.                3. Message Files
  14.                4. Modules
  15.           4.  Menus
  16.           5.  Saving Files
  17.           6.  Loading Files
  18.           7.  Compressing EvntShell Applications
  19.           8.  The RunTime Library
  20.           9.  The !EvntShell Application
  21.           10. Handling Panes
  22.           11. Outline Fonts
  23.           12. Interactive Help
  24.           13. User Redraws
  25.                1. Simple cases
  26.                2. Drawing into a sprite
  27.           14. Complex Icon Types
  28.                1. Bump Icons
  29.                2. Slider Icons
  30.                3. Popup Menus
  31.           15. Memory Management
  32.           16. Error Handling
  33.           17. Draw Files
  34.           18. OLE
  35.           19. Popup Dialogs
  36.       5  The Tools
  37.           1. !AppBuild
  38.           2. !ShellDBug
  39.           3. Other Tools
  40.               1. !BasShrink/!BasShrink_PD
  41.               2. !BLibII
  42.               3. !TemplEd
  43.               4. !StrongEd2
  44.               5. !StrongHlp
  45.               6. !ThrowBack
  46.       6  Distributing EvntShell Applications
  47.       7  Debugging
  48.       8  The Credits
  49.       9  Future Enhancements
  50.  
  51.     
  52.       1. Introduction
  53.  
  54.       A 'Shell' program is a starting point for developing your own 
  55.       applications that run under the RISC-OS wimp system. The 
  56.       EvntShell library contains code to handle most of the 'Events' 
  57.       (i.e. opening a menu, closing a window etc) that can occur, and 
  58.       all your application has to do is inform the library what it 
  59.       should do when certain events occur. For example a menu can be 
  60.       attached to a window or to an icon - the library will open the 
  61.       menu for you (in the correct position!) when the <MENU> button on 
  62.       the mouse is used. 
  63.  
  64.       PROCshell_AttachModeChangeHandler is another very simple example 
  65.       which calls a function in the 'User Application' (this is the bit 
  66.       you write, starting with a 'Shell' created by the AppBuild tool 
  67.       or by modifying one of the examples) when the screen mode 
  68.       changes. A more complicated example is PROCshell_AttachPane which 
  69.       allows the attachment of pane windows to a parent window. All 
  70.       opening and closing of windows and panes is handled totally by 
  71.       the library code. 
  72.  
  73.       Normally writing a wimp application is a very complex business, 
  74.       involving much reading of the Programmers Reference Manuals, 
  75.       magazine articles and examining other applications. The aim of 
  76.       the EvntShell library is to reduce the need for this and to 
  77.       enable the speedy creation of easily maintained and robust 
  78.       applications. 
  79.  
  80.       Another important reason for using this Shell is that it attempts 
  81.       to ensure that any application written using it follows the RISC 
  82.       OS 3 Style Guide which defines how applications should look and 
  83.       behave. For example menus attached to icons ('popup' menus) 
  84.       appear to the right of the icon they are attached to and the 
  85.       mouse pointer is repositioned appropriately. Implementing the 
  86.       Style Guide recommendations is not easy and at the moment very 
  87.       few of the necessary changes to the library code have been made, 
  88.       however, this will improve in future releases. 
  89.  
  90.       In order to use the library it is necessary to have a reasonable 
  91.       understanding of how to use an Archimedes and the programs 
  92.       supplied with it. Some experience in BASIC is also of course 
  93.       required. This manual does not cover how to use tools like the 
  94.       Template editor which has its own instructions and may not have 
  95.       been supplied with your copy of the EvntShell library. 
  96.  
  97.       2. Creating An Example Application 
  98.  
  99.       The easiest way to create a new application is to use the 
  100.       AppBuild tool. Run this and drag the application icon from the 
  101.       AppBuild window to a directory display. The various options 
  102.       available using AppBuild will be discussed later, but for now 
  103.       just quit AppBuild and run the newly created application. You 
  104.       should see a blank icon appear on the icon bar and clicking 
  105.       <MENU> over this will bring up the usual icon bar menu including 
  106.       the items 'Info' and 'Quit'. 'Info' leads to the normal 'About 
  107.       This Program' window (the icons of which are blank at the moment) 
  108.       and 'Quit' which stops the application and removes it from the 
  109.       icon bar - don't quit it just yet. 
  110.  
  111.       Clicking <SELECT> on the iconbar icon will open a window which 
  112.       has the usual controls and may be scrolled and moved around the 
  113.       screen. Keep the application you have just created handy as in 
  114.       the next section we'll look at the program code and see how to 
  115.       change it to suit your own needs. 
  116.  
  117.       As you can see it is very easy to create a new shell application 
  118.       - even if this particular one doesn't do anything useful yet! 
  119.  
  120.       3. A Tutorial 
  121.  
  122.       The first few lines of any EvntShell program initialise the 
  123.       memory management, set up error handlers and load any resources 
  124.       (templates, message files, sprites etc) required by the program. 
  125.       This code should not need editing. PROCapp_init determines what 
  126.       happens when the application starts, in this case an iconbar icon 
  127.       is created and various 'events' are attached to it. The code 
  128.       created by !AppBuild is as shown below, although the REMs have 
  129.       been added for this manual. Try defining other windows and menus 
  130.       and see what happens. 
  131.  
  132.       
  133.       DEF PROCapp_init
  134.       PROCSetUp_Menus   :REM set up iconbar menu
  135.       PROCSetUp_Windows :REM set up main window
  136.       PROCSetUp_IconBar :REM put icon on the iconbar and attach events
  137.       ENDPROC 
  138.       :
  139.       REM ===== Menu_Setup routines ===================================
  140.       
  141.       DEF PROCSetUp_Menus
  142.       LOCAL void%
  143.       REM Construct the iconbar menu..
  144.       MenuHandle_IconBar% = FNshell_MenuNew( "NewApp", "Menu_IBar", 2 )
  145.       MenuItem_Info%      = FNshell_MenuAdd( 0, "Info", "" )
  146.       void%               = FNshell_MenuAdd( 0, "Quit", 
  147.       "_MenuSelect_Quit" )
  148.       REM Attach the 'About this program' dialog box to the 'Info'
  149.       REM item of the menu. Call FN_PreOpenInfo before opening it so
  150.       REM that the icons can be filled in, don't call a FN after
  151.       REM opening it.
  152.       PROCshell_AttachMenuDBox( MenuItem_Info%, "progInfo",
  153.       "_PreOpenInfo", "" )
  154.       ENDPROC
  155.       :
  156.       
  157.       REM ===== Window_SetUp routines =================================
  158.       
  159.       DEF PROCSetUp_Windows
  160.       REM create a window from the template called 'mainw', place the
  161.       REM window handle in mainw%
  162.       PROCshell_CreateWindowStatic( "mainw", mainw% )
  163.       ENDPROC
  164.       :
  165.       
  166.       REM ===== IconBar_SetUp routines ================================
  167.       
  168.       DEF PROCSetUp_IconBar
  169.       REM sicon is the handle of the icon. -1 means right side of
  170.       REM iconbar, -2 would be left side. The name of the sprite for
  171.       REM the icon is the same as the application directory. A menu
  172.  
  173.       REM with the handle 'MenuHandle_IconBar%' is attached.
  174.       sicon=FNshell_Iconbar(-1,"!"+FNshell_GetAppName,"",120,
  175.       MenuHandle_IconBar%,0,0,0)
  176.       REM attach a help tag for the icon, this will send the text
  177.       REM following 'iconbar:' to the !Help application. See the
  178.       REM 'Messages' file for this.
  179.       PROCshell_AttachHelpTag(-1,sicon,"iconbar")
  180.       REM lastly attach the clickselect event. When <SELECT> is
  181.       REM clicked over the icon call FN_clickiconbar
  182.       PROCshell_AttachClickSelect(-1,sicon,"_ClickSelect_IconBar")
  183.       ENDPROC
  184.       :
  185.       
  186.       REM ===== Dialog_PreOpen routines ===============================
  187.       
  188.       DEF FN_PreOpenInfo(h%)
  189.       REM fill in icons. Try editing the 'Messages' file to make text
  190.       REM appear in the icons (just add the text after progInfo0: etc).
  191.       REM h% is the handle of the window.
  192.       PROCshell_IconPutData(h%,0,FNshell_MessageNoArgs("progInfo0"),0)
  193.       PROCshell_IconPutData(h%,1,FNshell_MessageNoArgs("progInfo1"),0)
  194.       PROCshell_IconPutData(h%,2,FNshell_MessageNoArgs("progInfo2"),0)
  195.       PROCshell_IconPutData(h%,3,FNshell_MessageNoArgs("progInfo3"),0)
  196.       =0
  197.       :
  198.       
  199.       REM ===== Dialog_PostOpen routines ==============================
  200.       
  201.       REM ===== Click_Select routines =================================
  202.       
  203.       DEF FN_ClickSelect_IconBar(wh%,icon%)
  204.       REM open the window with the handle mainw% when a click of
  205.       REM <SELECT> is received on the iconbar icon. wh% is the handle
  206.       REM of the window over which the click occured (the iconbar) and
  207.       REM icon% is the handle of the iconbar icon
  208.       PROCshell_OpenWindowStatic(mainw%)
  209.       =0
  210.       :
  211.       
  212.       REM ===== Menu_Select routines ==================================
  213.       
  214.       DEF FN_MenuSelect_Quit(blk%)
  215.       _closedown%=TRUE
  216.       =0
  217.       :
  218.       
  219.       REM ===== Menu_Warning routines =================================
  220.       
  221.       REM ===== Data_Load routines ====================================
  222.       
  223.       REM ===== Data_Save routines ====================================
  224.       
  225.       
  226.       Let us now look at how events should be attached to a window. It 
  227.       is important to always do this just before the window opens (i.e. 
  228.       in the PreOpen routine) because a static window and a dynamic 
  229.       window can be created from the same template but they will of 
  230.       course have different handles. The following example shows how 
  231.       this should be handled (we are assuming the template in question 
  232.       is called 'xfer' and the program is called 'MyApp'). 
  233.  
  234.       
  235.       DEF PROCapp_init
  236.       ...
  237.       PROCSetUp_Windows
  238.       PROCSetUp_Menus
  239.       
  240.       PROCshell_AttachHotKey("F3",FALSE,FALSE,FALSE,"",xfer%,"_PreOpen_Xfer","")
  241.       ...
  242.       ENDPROC
  243.       :
  244.       DEF PROCSetUp_Windows
  245.       ...
  246.       PROCshell_CreateWindowStatic("xfer",xfer%)
  247.       ...
  248.       ENDPROC
  249.       :
  250.       DEF PROCSetUp_Menus
  251.       ...
  252.       MenuHandle_IconBar%=FNshell_MenuNew("MyApp")
  253.       MenuItem_Save%     =FNshell_MenuAdd(0,"Save","")
  254.       PROCshell_AttachMenuDBox(MenuItem_Save%,"xfer","_PreOpen_Xfer",
  255.       "_PostOpen_Xfer")
  256.       ...
  257.       ENDPROC
  258.       :
  259.       DEF FN_PreOpen_Xfer(h%)
  260.       ...
  261.       REM OK icon is 0, Filename icon is 2, File icon is 3, Filetype is 
  262.       &344..
  263.       PROCshell_IconPutData(h%,2,filename$),FALSE)
  264.       PROCshell_AttachDataSave(h%,3,100,&344,2,"_DataSave_Xfer")
  265.       PROCshell_AttachClickSelect(h%,0,"_ClickSelect_XferOK")
  266.       ...
  267.       =0
  268.       :
  269.       DEF FN_PostOpen_Xfer(h%)
  270.       ...
  271.       PROCshell_WindowCentreOnPointer(h%)
  272.       ...
  273.       =0
  274.       :
  275.       
  276.       
  277.       The xfer window will open when F3 is pressed (assuming one of the 
  278.       open windows has the 'grab hot keys' bit set) and also when the 
  279.       sub menu on the 'Save' menu item is opened. In each case 
  280.       FN_PreOpen_Xfer will be called to attach the events and fill in 
  281.       the filename icon. 
  282.  
  283.       4. General Overview 
  284.  
  285.       This section explains the various elements of an application 
  286.       using the EvntShell library, and any limitations and assumptions 
  287.       made by me. 
  288.  
  289.       4.1 Dynamic Windows 
  290.  
  291.       Dynamic windows are those created by moving the pointer over a 
  292.       submenu pointer arrow (i.e the normal 'About this program' window 
  293.       produced by the 'Info' entry on the iconbar menu) or optionally 
  294.       when a 'hot key' is pressed (for example F3 in most applications 
  295.  
  296.       opens a save box). They are opened with a call to 
  297.       PROCshell_OpenWindowDynamic. 
  298.  
  299.       When writable icons exist in the dynamic window up/down cursor 
  300.       and TAB/SHIFT TAB keypresses move the caret between the icons 
  301.       using the icon handles to determine where to move next. You 
  302.       should ensure therefore that the order of the icon handles is a 
  303.       logical progression through the dialog box. Icons which are 
  304.       unselectable (i.e. greyed out) will be ignored. Pressing the 
  305.       <RETURN> key causes icon 0 to be pressed (normally a 'default 
  306.       action' icon with an extra border) and the menu/dialog box to be 
  307.       closed. Actually clicking <SELECT> on icon 0 of a dynamic dialog 
  308.       box will cause the shell library to close the window as well. 
  309.  
  310.       When a 'hot key' is pressed you have the option of opening a 
  311.       dynamic dialog box which will disappear when a mouse click is 
  312.       made outside it or the <ESC> key is pressed, or as a 'Static' 
  313.       dialog box which must be explicitly closed by the user 
  314.       application program. 
  315.  
  316.       Do not attempt to close a dynamic dialog box with a call to 
  317.       PROCshell_CloseWindow or PROCshell_DeleteWindow as this will 
  318.       cause an error when the shell library tries to close or delete 
  319.       the window. 
  320.  
  321.       All windows used by the user application are assumed to be 
  322.       defined in the 'Templates' file and edited using FormEd or one of 
  323.       the Public Domain/ShareWare equivalents. 
  324.  
  325.       4.2 Static Windows 
  326.  
  327.       These are opened with a call to PROCshell_OpenWindowStatic and 
  328.       respond to cursor,TAB and <RETURN> keypresses like dynamic dialog 
  329.       boxes except that pressing <RETURN> will not close the window. 
  330.       Static windows must be created with a call to 
  331.       PROCshell_CreateWindowStatic. 
  332.  
  333.       Closing these windows is the responsibility of the application 
  334.       program (use PROCshell_CloseWindow) except in the case of a click 
  335.       on the 'Close' icon in the title bar icon (if present). 
  336.  
  337.       You would use a static window for the main window of an 
  338.       application, or perhaps for a save box as in the case of the 
  339.       !WinSave2 example. The advantage of using a static window in this 
  340.       case is that this allows the user to open directory viewers or 
  341.       start other applications while keeping the save box on the 
  342.       screen. 
  343.  
  344.       4.3 Resources 
  345.  
  346.       'Resources' is a general term for additional files needed by an 
  347.       application. There will (almost) always be some of these, such as 
  348.       sprite files. Others, for example message files may not be 
  349.       required. 
  350.  
  351.       The EvntShell library now supports ResFind which allows the 
  352.       selection of the desired language for message files etc much 
  353.       easier. Briefly explained it checks the currently configured 
  354.       language of the computer it is running on and sets up a path to 
  355.       the resource files. This would normally be <App$Dir>.Resources.UK 
  356.       for a UK configured computer, or <App$Dir>.Resources.Germany for 
  357.  
  358.       a German one. This is handled for you if you use !AppBuild to 
  359.       create the application. 
  360.  
  361.       AppBuild now offers to place the resources in the appropriate 
  362.       directories for you when you create a new application, and to 
  363.       place a call to ResFind in the !Run file. 
  364.  
  365.       Using ResFind is optional and EvntShell applications will 
  366.       function equally well if you don't use it. It does make the 
  367.       production of applications that can be easily used in any country 
  368.       much easier, however, and this should be encouraged. Most of the 
  369.       programming tools and modules used during the development of this 
  370.       library were written outside the UK. 
  371.  
  372.       The author would appreciate help in translating the ShellMsgs 
  373.       file and the documentation into other languages. 
  374.  
  375.       The full ResFind documentation supplied with the library contains 
  376.       further details on how it works and the advantages to be gained 
  377.       by using it. As a taster, here is the part of the documentation 
  378.       intended to be distributed with applications using ResFind. 
  379.  
  380.       (Base for the application's documentation - please replace 
  381.       <ProgName> by the name of your application without the !) 
  382.  
  383.       !<ProgName> adapts automatically to the configured language if 
  384.       the corresponding messages etc. are available. For this purpose a 
  385.       Resources directory is contained in the application in which a 
  386.       subdirectory for each language supported resides. If the language 
  387.       you need isn't in there, please feel free to duplicate any of 
  388.       these language directories and translate the contents. 
  389.  
  390.       When you run the program a utility called ResFind is called which 
  391.       reads the language your computer is configured to and then looks 
  392.       for the corresponding language directory. If this fails the 
  393.       program will run in English (UK). By setting several system 
  394.       variables (best done in your system's !Boot file) you can change 
  395.       the language looked for. With this you can make sure a program 
  396.       runs in a certain language, e.g. to avoid a weird translation. 
  397.       Furthermore it is possible to name several languages you prefer 
  398.       to English. 
  399.  
  400.       This is controlled by three system variables: 
  401.  
  402.       
  403.       <ProgName>$Language, ResFind$LanguagesPref and 
  404.       ResFind$Languages$Suff.
  405.       
  406.       
  407.       When running the application ResFind looks for the first language 
  408.       supported along the following list of languages: 
  409.  
  410.       
  411.        1. Contents of the variable <ProgName>$Language
  412.        2. Contents of the variable ResFind$LanguagesPref
  413.        3. The configured language
  414.        4. Contents of the variable ResFind$LanguagesSuff
  415.        5. UK
  416.       
  417.       
  418.       Take a Norwegian user for example (lots of great programs come 
  419.  
  420.       from there) whose computer is configured to 'Norway'. Since this 
  421.       language isn't too common in Europe most programs won't support 
  422.       it - except for Norwegian ones. But our user is pretty good in 
  423.       German and French but not too fond of English. Therefore he 
  424.       prefers these languages to UK and would thus put the following 
  425.       line in his system's !Boot file: 
  426.  
  427.       
  428.       *Set ResFind$LanguagesSuff Germany,France
  429.       
  430.       
  431.       Running an applications (such as this one) using ResFind the list 
  432.       of languages looked for is 'Norway,Germany,France,UK'. 
  433.  
  434.       In case this user has an application called !Pete supporting the 
  435.       language 'Humorous' the line: 
  436.  
  437.       
  438.       *Set Pete$Language Humor
  439.       
  440.       
  441.       in the !Boot file makes sure !Pete will run humorous. 
  442.  
  443.       A brief description of the various resource files follows. 
  444.  
  445.       4.3.1 Templates 
  446.  
  447.       All windows used by programs based on the shell library would 
  448.       normally be defined using a template editor as this is far 
  449.       simpler than creating the windows/icons in the user program. This 
  450.       is not as inflexible as it may sound as windows and icons can be 
  451.       resized, moved or otherwise altered by shell library routines. 
  452.  
  453.       The template file must be called 'Templates' and be either in the 
  454.       application directory or in the appropriate language directory if 
  455.       ResFind is in use. Note that if you are using different templates 
  456.       for different languages you must use ResFind. In most cases, 
  457.       however, it is sufficient to have only one template file in the 
  458.       application directory and to insert the text taken from the 
  459.       message file in the language of choice into the icons. 
  460.  
  461.       A call to PROCshell_ResourcesInit will find the template file and 
  462.       load all the templates it contains allocating memory as required. 
  463.  
  464.       4.3.2 Sprites 
  465.  
  466.       The sprite file must be called 'Sprites' and be either in the 
  467.       application directory or in the appropriate language directory if 
  468.       ResFind is in use. A call to PROCshell_ResourcesInit will find 
  469.       the file if it exists and load all the sprites it contains 
  470.       allocating memory as required. 
  471.  
  472.       Optionally a second sprite file called 'Sprites22' containing 
  473.       high resolution sprites for users with multisync monitors may be 
  474.       present. If the application is started in a high resolution 
  475.       screen mode and 'Sprites22' is available it will be loaded 
  476.       instead of 'Sprites'. 
  477.  
  478.       The sprite area pointer for each loaded template will be set to 
  479.       point to the user sprite area, which put simply this means that 
  480.       all sprites displayed in windows must be present in the 'Sprites' 
  481.       and 'Sprites22' files. This may, however, be changed after 
  482.       loading with a call to FNshell_WindowSetSpriteArea. 
  483.  
  484.       4.3.3 Message Files 
  485.  
  486.       The message file is a normal ASCII file written using !Edit or 
  487.       similar that contains message strings preceeded by a message tag. 
  488.       The application program should find the messages as required by 
  489.       tag name which allows the production of foreign language versions 
  490.       (probably by someone else!). It is also far easier to edit the 
  491.       message file to change text displayed by the application than 
  492.       using !FormEd or similar. 
  493.  
  494.       The !Run file of the user application automatically loads a 
  495.       support module 'MsgTrans' if required (it is built in to RISC OS 
  496.       3) to provide this facility. 
  497.  
  498.       The message file must be called 'Messages' and be in the 
  499.       application directory or in the appropriate language directory if 
  500.       ResFind is in use. A call to PROCshell_ResourcesInit will find 
  501.       the file if it exists and load all the messages it contains 
  502.       allocating memory as required. 
  503.  
  504.       The messages issued by the library code are stored in a file 
  505.       called 'ShellMsgs' inside the !EvntShell.Resources.UK directory. 
  506.       If this file is present in the user application directory (or the 
  507.       application Resources directory) then it is loaded from there, if 
  508.       not it is loaded from !EvntShell. This is to aid the construction 
  509.       of stand alone applications. 
  510.  
  511.       4.3.4 Modules 
  512.  
  513.       Various Public Domain modules are used by the EvntShell library, 
  514.       these are stored in the !EvntShell application and loaded as 
  515.       required. A full list is: 
  516.  
  517.       
  518.       Interface   - 3D icon effects, changing pointer shapes etc
  519.       MenuUtils   - menu handling
  520.       FontMenu    - font menu handling
  521.       MsgTrans    - message files (supplied for Risc-OS 2
  522.                     compatability)
  523.       FontWindow  - handling outline fonts across mode changes (not
  524.                     used at the moment)
  525.       DrawFile    - used for rendering drawfiles (this module is
  526.                     copyright Acorn)
  527.       
  528.       
  529.       Note that in general no documentation is supplied for these 
  530.       modules, it is all available elsewhere (or why not write to the 
  531.       author?) 
  532.  
  533.       The EvntShell library makes the assumption that the interface 
  534.       module will always be used. The reason is that firstly that it is 
  535.       highly likely that some other PD program will have already loaded 
  536.       it, and secondly that the facilities it provides for changing 
  537.       pointer shapes over certain icons is extremely useful as a prompt 
  538.       for what the icon is for. Indeed RISC-OS 3 has this built in so 
  539.  
  540.       even Acorn are supporting 3D buttons etc.... 
  541.  
  542.       The module is loaded by the !Run file if not already loaded. 
  543.       Using a template editor that is 'Interface Aware' makes 
  544.       incorporating these effects into a user program easy as once the 
  545.       icons have been designed and placed the shell library handles all 
  546.       the redrawing automatically. 
  547.  
  548.       Note that windows containing 3d interface icons must have the 
  549.       'Auto Redraw' flag off, but if the template editor displays 
  550.       interface icons then the user application will as well. 
  551.  
  552.       4.4 Menus 
  553.  
  554.       Menus are now handled by MenuUtils which was written by Alex 
  555.       Petrov. Versions of the library prior to 1.20 used a menu editor 
  556.       to create a seperate menu template file, but I have now abandoned 
  557.       this as it was rather inflexible. 
  558.  
  559.       The use of MenuUtils has enabled me to remove large chunks of 
  560.       slow BASIC code and to provide many more features, such as 
  561.       creation and modification of menus under program control. The 
  562.       menus themselves appear more quickly as well (OK Cy?). 
  563.  
  564.       Menus may be created by calling functions in the user 
  565.       application, or from a menu command file. The file option is 
  566.       especially useful for lists of items that can be edited by the 
  567.       user - for example the new version of !VideoBase uses menu 
  568.       command files for lists of commonly used categories of recordings 
  569.       (Documentary, Action Film etc) a menu of which can be attached to 
  570.       an icon for easy access. As the command file is a simple text 
  571.       file it is very easy to edit to meet special requirements. 
  572.  
  573.       A demonstration application !TestMenu should have been supplied 
  574.       with the library code so that you can try out some of the 
  575.       possibilities yourself. 
  576.  
  577.       The appearance of the RISC OS 3 Style Guide has caused a few 
  578.       changes in the way that EvntShell handles 'popup' menus (menus 
  579.       attached to icons in windows other than the iconbar). Firstly 
  580.       they appear to the right of the icon they are attached to, the 
  581.       mouse pointer also moving to the recommended position, and 
  582.       secondly only SELECT and MENU will call up a popup menu. 
  583.  
  584.       Note that menus can only be attached to icons in static windows, 
  585.       because as far as RISC OS is concerned a dynamic window is a 
  586.       menu. 
  587.  
  588.       The support module is automatically loaded by the !Run file to 
  589.       provide the new menu handling SWIs used by the EvntShell library. 
  590.  
  591.       4.5 Saving Files 
  592.  
  593.       This is achieved by a call to PROCshell_AttachDataSave which 
  594.       specifies which filetype the saved file should be given, the name 
  595.       of a function which will actually perform the save and the 
  596.       window/icon handles the drag save event is associated with. It is 
  597.       therefore possible to have different drag save events attached to 
  598.       different icons in the same window. This is useful where it is 
  599.       possible to save the file as more than one type - you can have 
  600.       multiple filetype icons in the save window. 
  601.  
  602.       PROCshell_AttachDataSave also performs some checking when it is 
  603.       called. For example an error message is generated if the file 
  604.       icon is not a sprite icon. The button type of the file icon is 
  605.       also changed to Click/Drag to avoid the need to get this correct 
  606.       when editing the template file. 
  607.  
  608.       The EvntShell library supports RAM file transfer for speed when 
  609.       saving data to consenting applications. 
  610.  
  611.       See the !WinSave2 and !VBase2 example applications for how to use 
  612.       this routine. 
  613.  
  614.       4.6 Loading Files 
  615.  
  616.       This is achieved by a call to PROCshell_AttachDataLoad which 
  617.       tells the EvntShell library which filetypes the user application 
  618.       is interested in and the name of a function to call when a load 
  619.       event occurs. Multiple files may be loaded, but in the current 
  620.       release of the library it is up to the user application to keep 
  621.       track of where they are loaded and if they have been modified. 
  622.       This will change in a future release. 
  623.  
  624.       When the event is attached a check is made to see if the 
  625.       application was started by double clicking a file which 'belongs' 
  626.       to it. If the filetypes match then the file is loaded as if it 
  627.       had been dragged to the icon bar icon. A filetype is associated 
  628.       with an application by the inclusion of the line: 
  629.  
  630.       
  631.       Set Alias$@RunType_xxx Run <Obey$Dir>.!Run %%*0
  632.       
  633.       
  634.       where xxx is the filetype number. 
  635.  
  636.       If required the files can be loaded automatically into a reserved 
  637.       block of memory, or the user application can have total control 
  638.       over loading and processing the file. 
  639.  
  640.       The EvntShell library supports RAM file transfer for speed when 
  641.       loading data from consenting applications. 
  642.  
  643.       It is also possible to arrange for the user application to 
  644.       respond to a range of filetypes by attaching more than one 
  645.       handler. 
  646.  
  647.       An example application !DataLoad should have been included with 
  648.       the Library to demonstrate how to do this. 
  649.  
  650.       This is the code from !DataLoad used to achieve the load : 
  651.  
  652.       
  653.       PROCshell_AttachDataLoad(mainw%,0,&FEC,"_dataloadFEC",TRUE)
  654.       
  655.       
  656.       The first parameter, mainw% is the wimp window handle, the second 
  657.       is the icon handle. &FEC is the filetype to respond to and 
  658.       '_dataloadFEC' is the name of the function to call to actually 
  659.       load the file. The last parameter is TRUE to load the file 
  660.       automatically into a reserved block of memory or FALSE if you 
  661.       want to handle the loading yourself. In this case loading is 
  662.       automatic and the loading function is simply: 
  663.  
  664.       
  665.       DEF FN_dataloadFEC(loc%,type%,name$,file_size%)
  666.       void%=FNshell_MessageWindow("File '"+name$+"'",0,"DataLoad","")
  667.       =0
  668.       
  669.       
  670.       The data file (of type &FEC, template) has been loaded at 
  671.       location loc%, its type is in type% and the full path name of the 
  672.       file is in name$. All the function itself does is call another 
  673.       function to display a message window so that you can see that 
  674.       loading the file has worked. This is a useful debugging 
  675.       technique! 
  676.  
  677.       This method of loading a file works well for datafiles that are 
  678.       stored as one continuous block of data such as a text file which 
  679.       will be processed in some way. Suppose, however, you have a 
  680.       simple database type application which needs to load data into 
  681.       BASIC arrays. In this case you would simply use (assuming now the 
  682.       filetype is &205): 
  683.  
  684.       
  685.       PROCshell_AttachDataLoad(mainw%,0,&205,"_dataload205",FALSE)
  686.       
  687.       
  688.       FN_dataload205 receives the full pathname of the file which has 
  689.       been dragged to icon 0 (providing the filetype of the file was 
  690.       &205, otherwise the load will be ignored) which may now be opened 
  691.       and the data loaded as usual. If the 'no load' flag was set for 
  692.       this load event and the load was from another application the 
  693.       data is saved in a file called 'ScrapFile' in the user 
  694.       application directory. 
  695.  
  696.       4.7 Compressing EvntShell Applications 
  697.  
  698.       Due to the complex nature of the library code and the desire for 
  699.       it to do as much as possible to make a user application easy to 
  700.       write the ShellLib library file has expanded to around 150K. This 
  701.       is obviously undesirable especially if you are planning to send 
  702.       your finished program to a PD library. If you want people to be 
  703.       able to read your source code you can use the 'RunTime' version 
  704.       of the library which has been mildly compressed, but for the 
  705.       smallest possible program it is necessary to append the library 
  706.       (either version) to the end of the user application, remove the 
  707.       line which loads the library file and run the whole lot through a 
  708.       BASIC program compressor. 
  709.  
  710.       I recommend !BasShrink or !Shrink_PD (the Public Domain version 
  711.       of !BasShrink) by John Wallace although John's program is slow 
  712.       and not presently multitasking it does produce code that still 
  713.       runs! This is unfortunately not true of Cy Booker's otherwise 
  714.       superb !BC which will not work on the EvntShell library. However, 
  715.       if I or Cy can find out what the problem is we'll fix it. 
  716.  
  717.       Future versions of !BasShrink should be able to remove unused 
  718.       routines to save even more space, or alternatively BLibII can be 
  719.       used to pre-process the application to link in only the routines 
  720.       that are actually used. See the manual section 'Other Tools' for 
  721.       more details. 
  722.  
  723.       There is one important point to bear in mind when using the shell 
  724.       library and !BasShrink together - function names that are 
  725.       EVALuated by the shell library should begin with a '_' character 
  726.       and the 'Preserve names starting with' radio button in the 
  727.       !BasShrink window must be ON. In short if you are calling any 
  728.       shell library routine that has a function name as a parameter 
  729.       then that name must start with a '_'. Failure to observe this 
  730.       rule will result in a non-working compressed program! 
  731.  
  732.       Assuming you have !BasShrink 2.14 or later the EvntShell library 
  733.       can be compressed with all switches on except 'Shorten FN names', 
  734.       'Shorten PROC names' and 'Remove * comments'. If you are not 
  735.       going to use !BLibII you can switch on 'Remove * comments' to 
  736.       strip out the !BLibII commands. 
  737.  
  738.       If you append the EvntShell library to the user application 
  739.       manually or by using BLibII you can compress the complete program 
  740.       with all switches on. 
  741.  
  742.       4.8 The RunTime Library 
  743.  
  744.       This is a compressed version of the full library which should be 
  745.       used wherever possible as it will load and run faster. The only 
  746.       reason for using the uncompressed library would be to add extra 
  747.       debugging code or perhaps to modify the routines. In this case, 
  748.       however, it is better to just copy the uncompressed routine into 
  749.       the user application and edit it there. 
  750.  
  751.       The uncompressed version is called ShellLib, the compressed 
  752.       version is ShellLibRT. Both can be found inside the !EvntShell 
  753.       application directory. 
  754.  
  755.       The ShellLibRT file has had the BLibII commands stripped out to 
  756.       save space. 
  757.  
  758.       4.9 The !EvntShell Application 
  759.  
  760.       As large chunks of code are common to all EvntShell applications 
  761.       it makes sense to store it only once on the disk, hence 
  762.       !EvntShell which should be treated like the !System application. 
  763.       If you have a hard disk put it in the root directory (or ensure 
  764.       it is booted by your Boot file). If you have a floppy only system 
  765.       put it on all your disks (removing the ShellLib file and making 
  766.       sure all EvntShell applications use ShellLibRT will help save 
  767.       disk space). The system message file and various modules are also 
  768.       to be found here. 
  769.  
  770.       The name '!EvntShell' has been registered with Acorn as an 
  771.       official shared system resource. 
  772.  
  773.       4.10 Handling Panes 
  774.  
  775.       A pane window is a window attached to a parent window which has 
  776.       different properties to the parent. A well-known example is the 
  777.       'ToolBox' pane attached to a !Draw window which always appears at 
  778.       the top left of the parent window however the parent window is 
  779.       scrolled. Another example could be a parent window without 
  780.       scrollbars which has a scrolling pane attached to the work area 
  781.       which might be used in a 'FindFile' application to display a list 
  782.       of finds. 
  783.  
  784.       Panes are created using !FormEd or similar with the 'pane' flag 
  785.       set. A call to PROCshell_AttachPane specifies which pane is 
  786.       attached to which window and the position of the pane. Multiple 
  787.       panes may to attached to a parent window (see the example 
  788.       application !Panes). 
  789.  
  790.       The opening and closing of panes is handled totally by the shell 
  791.       library - a call to PROCshell_OpenWindow after attaching the 
  792.       panes will open the parent window and the panes together. 
  793.  
  794.       It is normally necessary for certain bits in the window 
  795.       definition block to be set up in a special way if a window is to 
  796.       be treated as a pane. This is not required when using the 
  797.       EvntShell library as the act of attaching the event makes the 
  798.       changes needed. 
  799.  
  800.       You should avoid attaching a pane to a parent window where it is 
  801.       possible to resize the parent in such a way that the pane lies 
  802.       outside the window it is attached to. This will cause (non-fatal) 
  803.       problems when the windows are redrawn. Most RISC OS programs also 
  804.       avoid this for the same reasons. 
  805.  
  806.       When attaching a pane it is possible to specify a 'pane flag' 
  807.       value which determines where the pane will be attached and to 
  808.       some extent how it will behave when the parent window is resized. 
  809.       The currently valid pane flags are: 
  810.  
  811.       
  812.         0 = attached to parent window work area
  813.         1 = attached to left edge outside parent
  814.         2 = attached to top edge
  815.         3 = attached to left edge inside parent
  816.         4 = attached to bottom edge
  817.         5 = attached to right edge
  818.       
  819.       
  820.       In cases 1-5 the library will attempt to stretch the pane window 
  821.       so that it will fill the whole width or depth of the parent 
  822.       window. 
  823.  
  824.       4.11 Outline Fonts 
  825.  
  826.       The EvntShell Library supports Outline Fonts in two ways at the 
  827.       moment. Firstly Joris Röling's FontMenu module is used to display 
  828.       a menu of all available fonts on the system, and secondly the 
  829.       window template loading routine allows icons and window titles to 
  830.       use fonts. 
  831.  
  832.       Routines are provided to attach a font menu to an existing menu 
  833.       as a submenu (PROCshell_AttachFontSubMenu), or to open the font 
  834.       menu as a menu in its own right (PROCshell_AttachFontMenu). If 
  835.       the user makes a valid font selection the font name can be 
  836.       retrieved (with FNshell_FontMenuGetLastSelectedFont) for use in 
  837.       the user application. Changes to the Font$Path variable such as 
  838.       adding or removing font directories are detected and the font 
  839.       menu rebuilt as necessary. 
  840.  
  841.       It will not, however, detect fonts being added or removed from an 
  842.       existing font directory while the EvntShell application is 
  843.       running. It appears that a re-boot is required to sort things out 
  844.       after the contents of the font directories have changed. Oh well, 
  845.  
  846.       it seems that a lot of other applications can't cope with this 
  847.       either! 
  848.  
  849.       The FontMenu module creates a menu in the relocatable module area 
  850.       which is shared between all applications wishing to use it. As a 
  851.       font menu potentially takes up a lot of space this is a very 
  852.       efficient way of handling it, especially as the menu is laid out 
  853.       so that it is easier to use than a straight list of fonts. 
  854.  
  855.       A help system containing the full FontMenu documentation is 
  856.       supplied with the EvntShell library as it is a requirement that 
  857.       the the module and its documentation must be supplied together. 
  858.       However, it is unlikely that the SWIs provided by the module will 
  859.       need to be called by the user application as the library code 
  860.       performs the necessary actions. 
  861.  
  862.       The example application !Redraw demonstrates the use of these 
  863.       routines. 
  864.  
  865.       4.12 Interactive Help 
  866.  
  867.       The EvntShell library supports Acorn's Interactive Help 
  868.       application !Help by searching icon validation strings for the 
  869.       'I' command (as recommended by the author of the Interface 
  870.       module) for a message tag. 
  871.  
  872.       The message belonging to the tag will be looked up and sent to 
  873.       !Help (if !Help is running). An example would be a validation 
  874.       string of "iMessTag01", where the file 'Messages' contains the 
  875.       line 'MessTag01:This is a test'. 'This is a test' would be the 
  876.       message displayed. 
  877.  
  878.       It is also possible to attach a message tag to a window or a 
  879.       window/icon using PROCshell_AttachHelpTag. A message tag is a 
  880.       string consisting of not more than 11 characters long and 
  881.       represents a message string to be found in the 'Messages' file. 
  882.  
  883.       Interactive help can be enabled or disabled by calls to the 
  884.       EvntShell library. It is useful to offer the option to disable 
  885.       interactive help for experienced users as the applications 
  886.       response times will be improved. 
  887.  
  888.       4.13 User Redraws 
  889.  
  890.       4.13.1 Simple Cases 
  891.  
  892.       By 'Simple Cases' I mean text, lines, arcs, filled shapes etc. In 
  893.       other words anything that it is easy for the program to redraw 
  894.       quickly - this excludes maps of the world and any kind of random 
  895.       display. For these cases it is much faster to redirect the screen 
  896.       output into a sprite (see the next section). 
  897.  
  898.       Using the example application you created earlier (or create a 
  899.       new one using AppBuild) add the following line to 
  900.       PROCSetUp_Windows: 
  901.  
  902.       
  903.       PROCshell_AttachUserRedraw(mainw%,"_redraw")
  904.       
  905.       
  906.       and add the following FN definition: 
  907.  
  908.       
  909.       DEF FN_redraw(blk%,x0%,y0%)
  910.       REM set colour for circle - colours are numbered 0-15!
  911.       REM draw the circle..
  912.       SYS "Wimp_SetColour",11
  913.       CIRCLE FILL x0%+200,y0%-200,120
  914.       REM set colour for text...
  915.       SYS "Wimp_SetColour",8 :REM colours are numbered 0-15!
  916.       MOVE x0%+80,y0%-340:PRINT "This is an example of"
  917.       MOVE x0%+40,y0%-380:PRINT "user drawn text and graphics"
  918.       MOVE x0%+95,y0%-420:PRINT "in a desktop window"
  919.       =0
  920.       
  921.       
  922.       The routine that attaches the redraw event also alters the 
  923.       'flags' of the window so that the 'Auto redraw' bit is set up 
  924.       correctly. When you run the application and open the main window 
  925.       now, a circle and some text will appear in the window. If another 
  926.       window is moved over this one, note that the window is correctly 
  927.       redrawn. 
  928.  
  929.       The parameters x0% and y0% for the redraw routine are the 
  930.       coordinates of the top left corner of the window. Note that y 
  931.       coordinates are negative! Try experimenting with other drawing 
  932.       commands and putting text in different places in the window to 
  933.       get the hang of this. 
  934.  
  935.       4.13.2 Drawing Into A Sprite 
  936.  
  937.       With a more complicated or random display you need to set up a 
  938.       sprite to draw into. The example application !Redraw2 shows how 
  939.       to do this. 
  940.  
  941.       Note in this case that the display within the window is animated 
  942.       by calling the plotting routine at every null event received. 
  943.       There also has to be two redrawing routines, one called when you 
  944.       want the display redrawn and one for when the wimp wants it 
  945.       redrawn (hence the call to PROCshell_AttachUserRedraw). In both 
  946.       cases it is necessary just to replot the sprite. 
  947.  
  948.       4.14 Complex Icons 
  949.  
  950.       4.14.1 Bump Icons 
  951.  
  952.       Bump icons are simply a pair of (usually!) arrow shaped icons 
  953.       that effect the value displayed in a third icon. The EvntShell 
  954.       library allows you to create this effect with one call to 
  955.       PROCshell_AttachBumpIconHandler. 
  956.  
  957.       Note that clicking on a bump icon which ADJUST has the opposite 
  958.       effect to using SELECT, i.e. ADJUST on the decrement icon 
  959.       actually increases the value. This is normal RISC OS behaviour 
  960.       and is intended to avoid unnecessary mouse movements. 
  961.  
  962.       See the !VBase2 demo application for an example of its use. 
  963.  
  964.       4.15 Memory Management 
  965.  
  966.       A crucial element of the EventShell library is the use of memory 
  967.       management routines originally published in Risc User magazine 
  968.       and used with permission. Many library routines require some 
  969.       memory workspace and they obtain this by calling 
  970.       FNshell_HeapBlockFetch(bytes_required) which returns the address 
  971.       of the allocated memory and release it when they are finished 
  972.       with PROCshell_HeapBlockReturn. 
  973.  
  974.       This is vital for avoiding 'side effects' caused by using the 
  975.       same block of memory for different purposes as most WIMP programs 
  976.       tend to do. Equally important is the fact that as the routines 
  977.       are written in ARM code they are extremely fast. 
  978.  
  979.       Another point to note is that this memory is claimed from the 
  980.       current wimp slot and not the RMA (Relocatable Module Area). This 
  981.       ensures that all of the memory claimed by the application is 
  982.       released back to the free pool when the application quits - this 
  983.       is not the case if memory is claimed from the RMA. It is only 
  984.       possible to reclaim RMA memory if the free space is at the top of 
  985.       the RMA which leads to the RMA allocation gradually growing as 
  986.       you run and quit applications. 
  987.  
  988.       Unfortunately (in the authors view!) the MenuUtils module uses 
  989.       the RMA for storage of indirected data and menu structures. 
  990.       Hopefully this data gets put in any small available blocks so 
  991.       that the RMA allocation does not increase. 
  992.  
  993.       You are strongly advised to use the supplied memory management 
  994.       routines in the user application should you require storage for 
  995.       data, or temporary blocks for use with SWI calls for example. The 
  996.       time penalty for doing this is very small and in any case results 
  997.       in a more reliable and easier to maintain application. 
  998.  
  999.       4.16 Error Handling 
  1000.  
  1001.       The EvntShell library sets up a default error handler for you if 
  1002.       you build the application with AppBuild. Since version 1.21 of 
  1003.       the library support has been provided for Joe Taylor's !ThrowBack 
  1004.       application which was on the September 1993 cover disk of 
  1005.       Archimedes World. This traps errors in the program and opens a 
  1006.       window showing the location and type of the error. Clicking on 
  1007.       the error line then loads the file into your editor with the 
  1008.       offending line highlighted which is a real timesaver. 
  1009.  
  1010.       It is not necessary to have !ThrowBack, if it is not present a 
  1011.       standard error window will pop up instead. 
  1012.  
  1013.       The user application can generate errors on purpose as a way of 
  1014.       aborting an operation. Control will then return to the wimp poll 
  1015.       loop. This is done with a call to PROCshell_OK which opens an 
  1016.       error box with a user defined message and an OK button. 
  1017.  
  1018.       Also note that the MenuUtils module appears to set up its own 
  1019.       error handler while calling the MenuSelect routine (the one you 
  1020.       specify will be called when a selection is made for a particular 
  1021.       menu item). This means that any errors in this routine appear to 
  1022.       be ignored - in fact the routine just aborts at the error 
  1023.       location without giving a message. This makes debugging these 
  1024.       routines impossible unless you add the line: 
  1025.  
  1026.       
  1027.       ON ERROR OFF
  1028.       
  1029.       
  1030.       at the start of the routine, i.e 
  1031.  
  1032.       
  1033.       DEF FN_MenuSelect_TID(blk%)
  1034.       LOCAL str$
  1035.       ON ERROR OFF
  1036.       str$=$(blk%!12)
  1037.       PROCshell_IconPutData(newrec%,4,str$,TRUE)
  1038.       PROCget_entries(file_loc%,(blk%!0)+1)
  1039.       =0
  1040.       :
  1041.       
  1042.       
  1043.       4.17 Draw Files 
  1044.  
  1045.       The standard method of creating and displaying vector graphics on 
  1046.       the Archimedes is the DrawFile, as created by the Acorn Draw 
  1047.       application. It is also possible to create a DrawFile under 
  1048.       program control using the routines in the supplied DrawLib 
  1049.       library - this is seperate from the main shell library as the 
  1050.       creation of DrawFiles is a specialised requirement. 
  1051.  
  1052.       A good example of the use of program generated DrawFiles would be 
  1053.       the production of a graph which could be loaded into a DTP or 
  1054.       word processing package. If you want to do something like this it 
  1055.       makes sense to use the existing standard of DrawFiles, indeed if 
  1056.       you want other applications to be able to load the data there is 
  1057.       really no choice. 
  1058.  
  1059.       EvntShell handles the creation of DrawFiles by creating the 
  1060.       necessary data in memory (hence memory availability limits the 
  1061.       size of DrawFile that can be created), first adding a 
  1062.       'pre-header' to the data. The purpose of the 'pre- header' is to 
  1063.       store data such as the current drawing colour, the width of the 
  1064.       lines etc without using global variables. Each DrawLib routine 
  1065.       requires the address of the buffer holding the DrawFile, enabling 
  1066.       several DrawFiles to be created in different buffers at the same 
  1067.       time. 
  1068.  
  1069.       Existing DrawFiles may be loaded, modified by the user 
  1070.       application and re- saved. Full control is provided over line 
  1071.       thicknesses, patterns, end caps, path and fill colours (stored as 
  1072.       24 bit values which RISC OS displays using dithering). 
  1073.  
  1074.       DrawFiles can contain lines, boxes, circles, ellipses and outline 
  1075.       font text at the moment which is not an exhaustive list but 
  1076.       should suffice for most needs. 
  1077.  
  1078.       An example of the use of the DrawLib routines is as follows: 
  1079.  
  1080.       
  1081.       LIBRARY "EvntShell:Extensions.DrawLib"
  1082.       buffer% = 0 : REM Just declare the variable
  1083.       PROCshell_DrawCreateFile(buffer%)
  1084.       PROCshell_DrawBox(buffer%,100,100,25,25)
  1085.       
  1086.       
  1087.  
  1088.       which creates a DrawFile and then adds a square at the location 
  1089.       x100 y100 (relative to the bottom left of the paper) with sides 
  1090.       25mm long. By default millimetres are used for measurements, but 
  1091.       drawing units may additionally be specified in centimeters, 
  1092.       inches, OS units or points. Drawing units can be mixed within 
  1093.       each file. 
  1094.  
  1095.       A demonstration application called TestDraw should have been 
  1096.       supplied with EvntShell to enable you to experiment. 
  1097.  
  1098.       Note that as displaying a DrawFile uses Acorn's DrawFile module 
  1099.       programs using it can only run on Risc OS 3 or later. 
  1100.  
  1101.       4.18 OLE 
  1102.  
  1103.       OLE is a technique whereby data can be sent from your application 
  1104.       to be edited by another and reloaded when it is saved by the 
  1105.       external application. The demo application OLE shows how this 
  1106.       works. 
  1107.  
  1108.       In addition the TestDraw application shows how a DrawFile can be 
  1109.       sent to Draw for editing and how when the Draw window is closed 
  1110.       the modified file is passed back for display. 
  1111.  
  1112.       5 The Tools 
  1113.  
  1114.       Various programming tools have been written by myself and others 
  1115.       to make producing wimp applications easier and faster. If you 
  1116.       obtained the EvntShell library or updates thereof from the author 
  1117.       you will have received all of the tools described here. If you 
  1118.       obtained it from a PD library the author has little or no control 
  1119.       over what else is supplied on the disk, so you may have to obtain 
  1120.       the missing tools from other disks in the PD library, or better 
  1121.       still send me a blank disk. 
  1122.  
  1123.       Only one of the tools (one of the many Template editors 
  1124.       available) is vital to the EvntShell Library, the others you can 
  1125.       do without but they do make life easier. 
  1126.  
  1127.       The following is a brief description of the tools supplied on 
  1128.       APDL disk B122, and some other software which may be useful for 
  1129.       developing applications 
  1130.  
  1131.       5.1 !AppBuild 
  1132.  
  1133.       Creates new application shells as 'stand alone' applications for 
  1134.       distribution, or ones that depend on !EvntShell. You can specify 
  1135.       a name for the application, and choose whether or not to make it 
  1136.       'Stand Alone' i.e if all the files required are copied into the 
  1137.       new application directory. If it is not a stand alone application 
  1138.       then modules, message files etc will be loaded from the 
  1139.       !EvntShell directory. 
  1140.  
  1141.       This application supports Acorn's !Help application. 
  1142.  
  1143.       5.2 !ShellDBug 
  1144.  
  1145.       A very simple debugger that displays trace output from the user 
  1146.       application and the library code. Note that currently this 
  1147.       application must be running before the application you want to 
  1148.       debug. 
  1149.  
  1150.       The EvntShell library outputs a commentary on what it is doing 
  1151.       into a tracefile, providing that PROCshell_TraceInit and 
  1152.       PROCshell_TraceOn have been called. The user application can also 
  1153.       place output in this file using PROCshell_Tracef0. 
  1154.  
  1155.       Outputting trace information will slow the user application 
  1156.       noticeably, especially when starting up as a lot of trace info is 
  1157.       generated by the call to PROCshell_ResourcesInit. Therefore it is 
  1158.       best to only turn on tracing when necessary, and of course make 
  1159.       sure that tracing is off on any applications you distribute! 
  1160.  
  1161.       5.3 Other Tools 
  1162.  
  1163.       There follows a brief description of some other PD/ShareWare 
  1164.       /Copyrighted programs which I have found useful when developing 
  1165.       EvntShell applications. 
  1166.  
  1167.       5.3.1 !BasShrink/!BasShrink_PD 
  1168.  
  1169.       Is a BASIC program compressor which has been proved to work with 
  1170.       EvntShell applications. !BasShrink_PD is Public Domain and 
  1171.       available from various PD libraries, !BasShrink cost £5.00 and 
  1172.       can be obtained from: 
  1173.  
  1174.       John Wallace, Architype Software, 54 Parkes Hall Road, 
  1175.       Woodsetton, Dudley, West Midlands, DY1 3SR ENGLAND 
  1176.  
  1177.       See the section on compressing EvntShell programs for guidance on 
  1178.       the options that can be used. 
  1179.  
  1180.       5.3.2 !BLibII 
  1181.  
  1182.       A BASIC Linker program available on APDL Disk B138. This builds a 
  1183.       program from the user application and the EvntShell library 
  1184.       containing only the routines that are actually needed. This is 
  1185.       very useful for distributing the final application as !BLibII and 
  1186.       !BasShrink used together will produce the minimum program size 
  1187.       possible. 
  1188.  
  1189.       Full instructions are provided with !BLibII, so I won't go into 
  1190.       details here except to note that the ShellLib library already 
  1191.       contains the extra information that !BLibII requires, although 
  1192.       the conditional linking bits are not yet in place. This means 
  1193.       that the linked program is bigger than it should be, but an 
  1194.       improvement over just appending the library code to the end of 
  1195.       the user application. This will improve in future releases. 
  1196.  
  1197.       Note that you should use the ShellLib library for linking with 
  1198.       BLibII because ShellLibRT has had the BLibII commands removed to 
  1199.       save space. 
  1200.  
  1201.       5.3.3 !TemplEd 
  1202.  
  1203.       Also on APDL disk B138 this is I believe the best Template editor 
  1204.       available anywhere. Forget !FormEd2 which was on some APDL B122 
  1205.       disks, !FormEd (Risc Squad version 2.84b on B053 or 2.87 also on 
  1206.       B138) and any Acorn versions. 
  1207.  
  1208.       5.3.4 !StrongEd 
  1209.  
  1210.       A text editor which used to be in the public domain and is now a 
  1211.       commercial program available from Stallion Software. The big 
  1212.       advantage this has over any other editor is the accompanying 
  1213.       !StrongHlp application as pressing F1 over a word in a program 
  1214.       known to !StrongHlp causes an hypertext information window to 
  1215.       open. 
  1216.  
  1217.       The Archimedes World August 1993 cover disk contained a crippled 
  1218.       version of !StrongEd (as the commercial version is known) which 
  1219.       can be used for evaluation purposes, and this may be available 
  1220.       from PD libraries. The PD/Demo version cannot create files and 
  1221.       only allows two files to be open at any one time although this is 
  1222.       not much of a problem for evaluation purposes. 
  1223.  
  1224.       5.3.5 !StrongHlp 
  1225.  
  1226.       A hypertext type application which almost removes the need for 
  1227.       the Reference Manuals. Files supplied with it detail most of the 
  1228.       SWIs available and much more information is provided on BASIC, 
  1229.       VDU calls, Filetypes etc. The full version of !StrongHlp is only 
  1230.       available as a 'free' add on with the commercial version of 
  1231.       !StrongED from Stallion Software, although a new PD version is 
  1232.       now available. The PD version does not contain the help data from 
  1233.       the full version, however, it is sufficient for viewing the help 
  1234.       files supplied with EvntShell. 
  1235.  
  1236.       The Archimedes World August 1993 cover disk also contained the PD 
  1237.       version of !StrongHlp. 
  1238.  
  1239.       The EvntShell library also has a few PROCs to interface with 
  1240.       StrongHlp to enable user applications to register help systems. 
  1241.  
  1242.       When a request is sent to StrongHlp the active applications on 
  1243.       the icon bar are checked to see if StrongHlp is running. If it is 
  1244.       not and its !Boot file has been 'seen' by the Filer then it will 
  1245.       be started automatically. If StrongHlp has not been 'seen' then 
  1246.       an error will be generated. 
  1247.  
  1248.       Note that for the above to work it is vital that the help system 
  1249.       directory has the same name as the application (minus the '!'). 
  1250.  
  1251.       5.3.6 !ThrowBack 
  1252.  
  1253.       This application appeared on the September 1993 cover disk of 
  1254.       Archimedes World and is copyright that magazine. It provides a 
  1255.       'throwback' window when an error occurs, and clicking on the 
  1256.       throwback window opens your program editor at the line where the 
  1257.       error occured. This is very useful when debugging a program. 
  1258.  
  1259.       The EvntShell library contains the necessary support code for 
  1260.       this. Note that for this to work properly you need the DDEUtils 
  1261.       module and an editor that supports throwback (such as !DeskEdit 
  1262.       or !StrongEd), although it will work after a fashion with !Edit 
  1263.       as well. 
  1264.  
  1265.       6 Distributing EvntShell Applications 
  1266.  
  1267.       It is probably best to copy ShellLibRT, ShellMsgs and the modules 
  1268.       into your application directory, not forgetting to alter the !Run 
  1269.       file and the LIBRARY statement in the runimage file to point to 
  1270.       the new location. That way you are sure that all the necessary 
  1271.       files are in one place for ease of copying. 
  1272.  
  1273.       AppBuild will do this for you automatically if you drag the 
  1274.       application to the iconbar icon, turn the 'Standalone' switch in 
  1275.       the main window on and click OK. 
  1276.  
  1277.       7 Debugging 
  1278.  
  1279.       A simple debugger (!ShellDBug) is supplied with the library to 
  1280.       display trace messages. You can also do wonders with a few VDU7 
  1281.       calls to check which parts of the application are actually being 
  1282.       executed.. 
  1283.  
  1284.       8 The Credits 
  1285.  
  1286.       Quite a few people have been (however unwittingly) involved in 
  1287.       this project such as: 
  1288.  
  1289.       David Breakwell (the original idea), Robert Seago (for using it 
  1290.       for things I wouldn't dream of attempting!), Cy Booker (various 
  1291.       helpful suggestions - I won't rewrite it in C or Assembler though 
  1292.       - RISC-OS 3 Documentation and the FontWindow module), Risc User 
  1293.       magazine (for permission to use its heap manager code), Joris 
  1294.       Röling (FontMenu module), Simon Huntingdon (Interface module), 
  1295.       Alex Petrov (MenuUtils), Jan-Herman Buining (WASP application 
  1296.       from which I worked out how to do RAM file transfers) and lastly 
  1297.       the wife (Hilke) for putting up with me pounding away at a 
  1298.       keyboard for hours when we could have been looking for new 
  1299.       furniture instead. 
  1300.  
  1301.       9 Future Enhancements 
  1302.  
  1303.       The software will become faster and be able to leap tall 
  1304.       buildings with a single bound. Bugs and limitations will become 
  1305.       fewer as well. 
  1306.  
  1307.       
  1308.       - Support for automatic handling of more
  1309.         complicated icon types, for example
  1310.         sliders, rotating knobs etc
  1311.         (steady now don't get carried away)
  1312.       - Inclusion of more debugging aids
  1313.       - More drag types
  1314.       - Autoscroll handler when object is
  1315.         dragged within a window
  1316.       - Automatic handling of non-icon text
  1317.         within a window (like C txt objects)
  1318.       - Playing of Maestro tunes (ArchWay does!)
  1319.       - Extending message file useage to icons/
  1320.         windows/menus
  1321.       - Replay Films (!!!)
  1322.       - Better multiple file buffers
  1323.       - Complete German message files
  1324.       - Choice of message file language from
  1325.         within program
  1326.       - Automatic attaching of 'hot key' events
  1327.         by examining menu text
  1328.  
  1329.       
  1330.       
  1331. Change History
  1332.  
  1333. 2.00    -    First release version 2
  1334.  
  1335. 2.01    -    Added documentation for interactive help routines
  1336.     -    Fixed MenuMaker routines
  1337.     -    Fixed OLE problems
  1338.  
  1339. 2.02    -    Added documentation for PROCshell_DrawSetPathNoColour
  1340.     -    Added documentation for PROCshell_DrawSetFillNoColour
  1341.     -    Added documentation for PROCshell_DrawDestroyFile
  1342.     -    Added documentation for PROCshell_DrawSetPathPattern
  1343.     -    Parameters changed for FNshell_MenuGetItemHandle
  1344.     -    Added routine PROCshell_AttachMenuHelpTag