///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//         This example code is from the book:
//
//           Object-Oriented Programming with C++ and OSF/Motif, 2nd Edition
//         by
//           Douglas Young
//           Prentice Hall, 1995
//           ISBN 0-13-20925507
//
//         Copyright 1995 by Prentice Hall
//         All Rights Reserved
//
//  Permission to use, copy, modify, and distribute this software for 
//  any purpose except publication and without fee is hereby granted, provided 
//  that the above copyright notice appear in all copies of the software.
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////
// Stopwatch.C: Group subcomponents into one stopwatch component
/////////////////////////////////////////////////////////////////
#include "Stopwatch.h"
#include <Xm/Xm.h>
#include <Xm/RowColumn.h>
#include "StopwatchTimer.h"
#include "Face.h"
#include "Control.h"

Stopwatch::Stopwatch ( Widget parent, char *name ) : 
              BasicComponent ( name )
{
    // Create a manager widget to hold all components
    
    _w = XmCreateRowColumn ( parent, _name, NULL, 0 );
    
    // Instantiate the three sub-components of the stopwatch
    
    _face  = new Face ( _w, "face" );
    _timer = new StopwatchTimer ( XtWidgetToApplicationContext ( parent ), 
			_face, 
			1000 );
    _control = new Control ( _w, "control", this, _timer );
    
    // Manage the two user interface sub-components
    
    _face->manage();
    _control->manage();
}

Stopwatch::~Stopwatch ( )
{
    delete _face;
    delete _timer;
    delete _control;
}

void Stopwatch::timerStarted()
{
    // Empty
}

void Stopwatch::timerStopped()
{
    // Empty
}



