home *** CD-ROM | disk | FTP | other *** search
- ///////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- // This example code is from the book:
- //
- // Object-Oriented Programming with C++ and OSF/Motif
- // by
- // Douglas Young
- // Prentice Hall, 1992
- // ISBN 0-13-630252-1
- //
- // Copyright 1991 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 "Timer.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 Timer ( 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
- }
-
-
-
-