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