Drag Demo

by Alan Wrigley


This application is designed to illustrate the techniques covered in the Wimp Topics article in this month's issue of RISC User (7:4).

Running the application installs an icon on the icon bar. The icon bar menu has just two options: Info and Quit, both of which perform their usual functions.

Clicking with Select or Adjust on the icon bar icon opens a window which initially contains a small black rectangle. Clicking with Select or Adjust anywhere over the rectangle selects it, This will change the rectangle outline to a dotted red line with a small ear attached to the bottom right-hand corner. Once the rectangle is selected, the rectangle itself can be dragged with the mouse anywhere within the current visible area of the window. Dragging the ear results in the rectangle changing shape and/or size, with the bottom right-hand corner following the pointer. Clicking anywhere outside the rectangle or releasing the buttons after a drag will deselect it.

Alongside the window is a toolbox containing two icons. The upper one selects rectangle mode which has just been described. The lower icon selects line mode. In this mode, clicking anywhere within the visible area will mark the start point of a line to be drawn with the pointer. Dragging the pointer around the window will result in the end of the line following the pointer. This technique is known as rubber-banding. Releasing the mouse button fixes the end point of the line at the pointer position when released.

The program is fully documented to help you to understand the techniques involved. For further details, see the Wimp Topics article in this month's RISC User magazine.

 Copyright RISC User 1994
