StopWatch

This class captures the abstraction of a simple timing device that can be started and stopped. A simple elaspsed time value is maintained and drawn by the StopWatch. Two Buttons, named "Start" and "Stop" allow the timing to be halted or resumed. Stopping the StopWatch does NOT reset the internal elapsed time counter.

[ Index | Source | Summary | Member Functions ]

Quick Index


Class Summary

class StopWatch

{

public:
StopWatch(Frame& frame, Location where, int interval );
void ButtonPushed(char* buttonName);
void Tick();
int ElapsedTime();
~StopWatch();
}; // StopWatch

Back to the top of StopWatch


StopWatch(Frame& frame, Location where, int interval );

	  StopWatch(Frame& frame, Location where, 
		        int interval = 1000);

Back to the top of StopWatch


void ButtonPushed(char* buttonName);

Determine which of the two StopWatch's Buttons was pushed by the user. The name must match either the name of the Start button or the name of the Stop button.

	  void ButtonPushed(char* buttonName);

Back to the top of StopWatch


void Tick();

Increment the current value (the elapsed time) of the StopWatchby 1. This method is iDInvoked (indirectly) by the encapsulated Clock within the the StopWatch object. The Clock invokes the OnTimerEvent method which must be programmed to invoke this method.

	  void Tick();

Back to the top of StopWatch


int ElapsedTime();

Report the current value of the timer. Note: since the StopWatch may be stop and (re)started, the current value need not correspond to the true elapsed time since the StopWatch was first started.

	  int ElapsedTime();

Back to the top of StopWatch


~StopWatch();

Delete the internal components of the StopWatch when the StopWatch itself is deleted.

	  ~StopWatch();

Back to the top of StopWatch


Member Functions

public:
void ButtonPushed(char* buttonName);
void Tick();
int ElapsedTime();

Back to the top of StopWatch


Generated from source by the Cocoon utilities on Thu Apr 02 12:40:37 1998 .

Report problems to jkotula@unimax.com