Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

bmtprwin.cpp

Go to the documentation of this file.
00001 // $Id$
00002 
00003 //**********************************************************************
00004 //                                                                     *
00005 //    Description:   Window to allow user to beat bell codes.          *
00006 //                                                                     *
00007 //    Author:        Chris White (whitecf@bcs.org.uk)                  *
00008 //                                                                     *
00009 //    Copyright (C) 2002  Monitor Computing Services Ltd.              *
00010 //                                                                     *
00011 //    This program is free software; you can redistribute it and/or    *
00012 //    modify it under the terms of the GNU General Public License      *
00013 //    as published by the Free Software Foundation; either version 2   *
00014 //    of the License, or any later version.                            *
00015 //                                                                     *
00016 //    This program is distributed in the hope that it will be useful,  *
00017 //    but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00018 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00019 //    GNU General Public License for more details.                     *
00020 //                                                                     *
00021 //    You should have received a copy of the GNU General Public        *
00022 //    License (http://www.gnu.org/copyleft/gpl.html) along with this   *
00023 //    program; if not, write to:                                       *
00024 //       The Free Software Foundation Inc.,                            *
00025 //       59 Temple Place - Suite 330,                                  *
00026 //       Boston, MA  02111-1307,                                       *
00027 //       USA.                                                          *
00028 //                                                                     *
00029 //**********************************************************************
00030 //                                                                     *
00031 //    Notes:                                                           *
00032 //                                                                     *
00033 //**********************************************************************
00034 
00035 #include <cstring.h>
00036 
00037 #define Uses_TButton
00038 #define Uses_TEvent
00039 #define Uses_TRect
00040 #define Uses_TStaticText
00041 
00042 #include <mytrace.h>
00043 
00044 #include <tapper.h>
00045 
00046 #include "bmtprwin.h"
00047 
00048 
00049 using namespace Monitor::BellMaster;
00050 
00051 
00052 
00053 TapperWin::TapperWin(Tapper&    newTapper) :
00054     TDialog(TRect(0, 0, 12, 8), 0),
00055     TWindowInit(&TapperWin::initFrame),
00056     tapper(newTapper)
00057 {
00058     _USEMYTRACE_("TapperWin::TapperWin")
00059 
00060     options |= ofCentered;
00061 
00062     insert(
00063         new TButton(
00064             TRect(1, 5, 10, 7),
00065             "Close",
00066             cmCancel,
00067             bfNormal));
00068     insert(
00069         new TButton(
00070             TRect(1, 2, 9, 4),
00071             "~B~eat",
00072             cmDefault,
00073             bfDefault));
00074 }
00075 
00076 
00077 
00078 void
00079 TapperWin::handleEvent(TEvent&    event)
00080 {
00081     TDialog::handleEvent(event);
00082 
00083     if (event.what == evCommand)
00084     {
00085         switch (event.message.command)
00086         {
00087         case cmDefault:
00088             clearEvent(event);
00089             tapper.beat();
00090             break;
00091         default:
00092             return;
00093         }
00094     }
00095 }
00096 

Generated on Wed Oct 29 20:55:43 2003 for Bellmaster BC Turbo Vision by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002