Window Writer 2

by Alan Wrigley


Window Writer 2 is part of the Wimp Topics feature in this month's magazine (7:3). It demonstrates the techniques of displaying text in windows. An earlier version was published on the RISC User 7:1 magazine disc; this new version has been updated to include a demonstration of how to select a block of text by dragging. By studying how the program works, you should be able to make use of similar techniques in your own programs.

USING THE PROGRAM
Running the application installs an icon on the icon bar. The icon bar menu has two options, Info and Quit, which perform their usual functions.

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. 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. 

The program is fully commented to allow you to see the processes taking place. For a fuller description, see the Wimp Topics article in this month's RISC User magazine.


 Copyright RISC User 1994
