Steve Turnbull investigates how useful WimpWorks really is
WimpWorks is yet another aid to Basic programming for the RISC OS Desktop but that in itself is a little unfair because this time it's not grossly huge and it manages to present at least some benefit to the programmer beyond just providing some pre-written routines.
What the system does is provide a complete Wimp shell plus an interface for creating procedures to be executed when specific system events occur. You create the proceudres, plus any subsidiary ones using the built-in editor, the program can be saved and then run so that you can test it as you go along.
What's particularly clever about the system is the pseudo-keywords that it provides in addition to the usual Basic keywords, for example you can have
GROUPSTATE, which returns the current setting of a particular set of radio buttons in a window, or
REDRAW to force the redrawing of a window.
These extra keywords get translated into function and procedure calls when you save the program and yet, curiously, the fact that they're ther in capitals produces a different effect than if they were presented as just another set of Basic routines.
All the commands have online help which supplies the parameters for the command and a brief description of what it does. The program makes extensive use of the PD WimpExt module and many of the additional commands are basic interfaces on to the WimpExt ones.
I tried out the system to create a simple application that runs the boot file of any application dragged to its iconbar icon. The resulting program took just twenty minutes to create, and that time was only due to getting to grips with the program.
Creating the windows
If you're going to be using windows - which most applications will - you obviously have to create them, the package is supplied with a copy of the PD program !TemplEd, although you can use any window editor.
Creating a program is achieved through a set of editors, the one for windows has already been mentioned. The task editor allows you to modify what will appear in the Info box, which sprite to use for the iconbar icon, whether the icon is on the left or right and whether to set some text under the icon.
The procedure (or subroutine) editor is the one that'll be accessed the most. Using it you can create three types of routine: A normal one which is simply named and will be called from somewhere else; a call every procedure which, curiously enough, is called at regular intervals, down to centiseconds.
The final, most important type is the Respond to which means the routine will be called whenever one of thirteeen events occurs.
The exact procedure is that you create a new procedure by giving its name, which is stored separately, specify the type, and switch into the editor which brings up a standard edit window in your usual text editor. The name you chose will be the name of the routine and any parameters will already have been set up.
All the routines are held as separate files within a directory which does lead to the problem of only 77 files being permitted at one time, however you can put more than one routine into one "module" so the problem can be avoided.
If it becomes a problem one alternative would be to change the OLE directory to, say, an ArcFS directory which allows any number of entries.
The menu editor is quite comprehensive and can produce all the varieties that are usually needed. Menu items can be set up to be intially ticked or shaded, lead to sub-menus, run a procedure when clicked or lead to the default Info or Save boxes.
A totaly of thirteen mnu options can be set up which is enough for most purposes, and the thirteen doesn't include any dotted separation lines - any menu more complex should probably have sub-menus.
The menu identifier becomes a global variable within the program which contains the handle of the menu.
One of the more interesting features of WimpWorks is the ability to add WEMs - WimpWorks Extension Modules - which add additional keywords complete with their online help messages so, for example, a complete library of database handling commands could be designed and added, or a library for drawfile editing.
WimpWorks is excellent for creating small applications very quickly, and it could be useful for taking the first few steps on the ladder to learning Wimp programming. All that's needed now is a version that runs with the Toolbox and a new resouce editor.
This is a review of WimpWorks v1. In 1998, WimpWorks version 2 was released which continued the same pattern for developing applications, but dropped the use of WimpExt and came with a new resource editor; the ability to have any number of menu items in a menu; improved integration with OLE (meaning the 77 file limit on older machines wasn't an issue) and more examples. It was also given a glowing review by Acorn User.