Window Writer 4

by Alan Wrigley


Window Writer 4 is designed to accompany the Wimp Topics article in this month's RISC User magazine. It demonstrates the techniques of displaying text in windows using the configured desktop font when using RISC OS 3.5 or later. The program is based on an earlier version of Window Writer which was written to illustrate earlier Wimp Topics articles on displaying text in windows (RISC User 7:1), marking and selecting text (7:3) and printing in text mode (8:2). The new version has been updated using the routines described in this month's article.

Running the application installs an icon on the icon bar. The icon bar menu has three options, of which Info and Quit perform their usual functions. The third option Print, is initially greyed out.

Clicking Select over the icon bar icon opens the application's main window. Initially this will be empty, but dragging any text file (filetype &FFF) to the icon bar icon or into the window, will display the contents of the file in the window, using the configured desktop font if you are running the program under RISC OS 3.5 or later. The text will be wordwrapped to the width of the window.

Once a text file is displayed in the window, a section of text can be marked by clicking on a line with Select, or dragging over it with Select pressed. The marked section will be shown in inverted colours, i.e. white on black instead of black on white. To keep the demonstration simple, text can only be marked below the starting position of the drag. In other words, once you have pressed Select to start the drag, you can only move the pointer below your original starting point. You can drag up and down, and see the marked area change while you do so, but you cannot continue the drag above the point where you started. Starting a fresh drag, or simply clicking on a line, will clear any previous marked section before marking the new area.

Once a text file has been loaded, the Print option on the icon bar menu becomes active. Choosing this option will cause the text to be printed in text mode via the RISC OS printer manager. If the printer manager is not installed, an error will be given.

The desktop font display routines are fully described in the accompanying article on page 20 of this month's magazine. If you are interested in the techniques used to display and mark the text, or to print in text mode, you should refer to the earlier articles mentioned above.


 Copyright RISC User 1995
