This document, the Wimp Demo application, the template files and the two sets of supplied code are Public Domain. There is no copyright, no fee for distribution and no restriction on who may use it.
Introduction
------------
This is basically a set of programs to help in-experienced programmers program the WIMP. I have provided a demo application, some template files and two sets of program code. One of these uses extension modules, the other uses only the WIMP.
WimpDemo
--------
This is a simple application that demonstrates some of the features of the WIMP. It has three windows, the main window (Click select on the icon bar), the pane window (Click adjust on the icon bar) and the info window (click menu on the icon bar and move to the info option). The programs needs no further explanation.
Template files
--------------
These template files contain several window and icon definitions that comply with Acorn's Style Guide. You need a template editor to use these files, We recommend TemplEd which is available from most PD libraries or we can send you a copy. We recommend that you use these window definitions as it saves having to make your own, but feel free to edit them in ay way you like.
Code files
----------
These are two shell WIMP programs for you to adapt and use. Before you start you need to know how a WIMP program works.
There are three stages to a WIMP program.
Initialisation
This is where templates are loaded, menus defined, memory claimed, sprites loaded and your task registered with the Task Manager & any other extension modules.
Polling
This is where you tell the wimp that your program is finished what it was doing and is ready for the user to do something. Generally your program will have a polling loop that goes on until your program is asked to quit. When you call Wimp_Poll the WIMP returns a reason code, this could be:
0 No reason
1 Redraw window
2 Open window
3 Close window
4 Pointer leaving window
5 Pointer entering window
6 Mouse click
7 User drag box
8 Key pressed
9 Selection of menu item
10 Window scroll request
11 Lose the caret
12 Gain the caret
17 User message
18 User message
Each reason fills the WIMP block with the relevant data, this is described in the programs REM statements.
Your program should do a CASE .. OF .. WHEN ..OTHERWISE loop to determine what the reason code was and then call a procedure to handle this.
CloseDown
If your task suffers a fatal error, ot the users wants it quit then your program must de-register with the Task Manager and any extension modules and then call OS_Exit.
Using the programs
------------------
To use the programs you must go through the code looking for any references to Task Name or Icon Name and <Your$Dir> and replace these with the appropriate names for your program. You must also supply a template file with the templates in the right order.
In the menu building procedure of the second code, your info window won't be in the same place in the file so replace hand%!0 with hand%!x where x is the position from the start of the file (0) multiplied by 4.
Also you must re write the mouse click handling procedure because the window numbers and icon numbers will be different for your templates.
This document contains no-where as much information as the Programmers Reference Manual so I would suggest that you buy this. If your budget doesn't stretch to £90 then get a copy of the Free Ware !StrongHelp program which runs in the desktop (unlike the PRM's!!!) and is absolutely brilliant.
For editing code you can't beat !Zap, which is also Free Ware & was written by Dominic Symes, this and !StrongHelp can be obtained from most PD libraries or we can supply them for you.
If you have any problems with this software, using the code in your own programs, bug reports, comments or ideas for new programs then please write to:
Software7
15 Stewarton Drive
Cambuslang
Glasgow
Scotland
G72 8DF
Any problems with the Wimp Extension module or the Menu Utils module should be send to Jon Ribbens & Alex Petrov respectively (Not me)