name:   Stopwatch
author: Martyn Fox (mfox@argonet.co.uk)
size:   3124 bytes
needs:  RISC OS 3
descr.: count up/count down timer

This program may be freely copied and distributed provided that no charge is
made other than the reasonable cost of copying and distribution and that
this text file accompanies all copies.

Stopwatch can, as its name implies, be used for manually timing an event or
for counting down through a preset interval. Timing is to an accuracy of one
tenth of a second and the maximum interval that may be timed is 100 hours.

The program displays an icon on the icon bar and all operation is by means
of mouse clicks. Some operations require a click on the numbers in the
centre of the icon and some on the border, the ends of which are widened to
make it easier to click on them.

The colour of the border indicates what the program is doing. When the
counter is counting up, the border is dark blue; when counting down, it is
dark green. When the count is paused, these colours are light blue and light
green respectively.

The starting point for the stopwatch (count up) operation is its zeroed
mode, when the border is red. The count down operation starts with the
pre-setting mode (yellow border), during which the individual digits may be
set to form the start of the countdown. This is followed by the countdown
pre-start mode (light green border) before the countdown actually starts.
When the countdown reaches zero, the border turns black and it starts
counting up again, beeping once per second until the mouse is clicked.

The combination of colours and mouse clicks may seem a bit daunting but
there is a logical sequence behind them. As already explained, the border
colour when the count (up or down) is paused is a lighter version of when it
is running. A click of the menu button anywhere at any time will always open
the menu. Apart from this, a click of either of the other two buttons on the
numbers will usually start the count and either button will stop it. What
happens when the count is resumed depends on which button is clicked. A
click of Select will resume the count as though it had never been stopped.
The count up, for example, will still show the time since it was first
started. When Adjust is clicked, however, the count will be resumed from the
number on the display, as though the counting had been stopped while the
display was frozen.

A click on the border usually has the effect of changing modes of operation.
Adjust, clicked at any time when the timer is not running, switches between
count up and count down operations.  In each case, the time is set to zero.
The two menu options, 'Count up' and 'Count down' have the same effect.

In the stopwatch zeroed mode, clicking Select on the border will start the
count. However, when the count up is stopped, clicking Select on the border
will switch the count back to zero, ready for a new count up.

In the count down pre-setting mode, clicking Select over a digit will
increase it and clicking Adjust will decrease it. This operation is brought
to an end by clicking Select on the border, putting the countdown into
pre-start mode. In this mode, a click on the numbers will start the count,
clicking Select on the border will switch it back to pre-setting mode and
clicking adjust will switch to stopwatch zeroed mode. These buttons have the
same effect when the countdown is paused.

Note that when the numbers have been preset, you have to move to the border
and click Select to enter the pre-start mode, then move back to the numbers
and click again to start the count.

When the countdown has timed out, the timer counts up, beeping once per
second. clicking either Select or Adjust stops the count and the noise and a
further click switches to stopwatch zeroed mode.

Note, by the way, that when counting down, the time remaining is a second
longer than the change in the seconds count may appear to indicate. This is
because the tenths are changing too fast to be read. As an example, the
moment when the seconds change from '10' to '9' is when the time remaining
changes from 10.0 seconds to 9.9 seconds. In other words, there are almost
10 seconds remaining, not 9.

The eight basic modes of operation are explained in more detail:

Stopwatch zeroed (red border)
================

Select clicked anywhere, or Adjust clicked on the centre, will start the
count up. Adjust clicked on the border will switch to countdown setting
mode.

Stopwatch running (dark blue border)
=================

A click anywhere will stop the count.

Stopwatch stopped (light blue border)
===================

Select clicked on the centre will resume the count up as though it had never
been stopped, i.e. showing the time since the count was first started.

Adjust clicked on the centre will resume the count up from the displayed
time, i.e. as though the count had been paused.

Select clicked on the border will revert to stopwatch zeroed mode and zero
the display. Adjust clicked on the border will switch to countdown setting
mode.

Countdown pre-setting (yellow border)
=====================

In this mode, hours, minutes, seconds and tenths may be preset. Clicking
Select on any digit will increase it and clicking Adjust will decrease it.

Select clicked on the border will switch to countdown pre-start mode, ready
to start counting down. Adjust clicked on the border will switch to
stopwatch zeroed mode and zero the display.

Countdown pre-start (light green border)
===================

A click on the centre will start the count down.

Select clicked on the border will revert to countdown setting mode. Adjust
clicked on the border will switch to stopwatch zeroed mode and zero the
display.

Countdown running (dark green border)
=================

A click anywhere will pause the count down.

Countdown paused (light green border)
================

A click on the centre will resume the count down. As in the case of
stopwatch stopped mode, Select will resume the count as though it had not
been stopped and Adjust will resume it from the displayed time.

Select clicked on the border will revert to countdown setting mode. Adjust
clicked on the border will switch to stopwatch zeroed mode and zero the
display.


Countdown timed out (black border)
===================

When the count down reaches zero, the timer switches to this mode and begins
counting up, beeping once a second. A click anywhere stops the count up and
the beep. A further click switches to stopwatch zeroed mode and zeros the
display.

The source code and an accompanying text file are contained in the 'more'
subdirectory.

Martyn Fox