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

bmcdlvw.cpp

Go to the documentation of this file.
00001 // $Id$
00002 
00003 //**********************************************************************
00004 //                                                                     *
00005 //    Description:   'Bell Master' TurboVision view to display a bell  *
00006 //                   code list.                                        *
00007 //                                                                     *
00008 //    Author:        Chris White (whitecf@bcs.org.uk)                  *
00009 //                                                                     *
00010 //    Copyright (C) 2003  Monitor Computing Services Ltd.              *
00011 //                                                                     *
00012 //    This program is free software; you can redistribute it and/or    *
00013 //    modify it under the terms of the GNU General Public License      *
00014 //    as published by the Free Software Foundation; either version 2   *
00015 //    of the License, or any later version.                            *
00016 //                                                                     *
00017 //    This program is distributed in the hope that it will be useful,  *
00018 //    but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00019 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00020 //    GNU General Public License for more details.                     *
00021 //                                                                     *
00022 //    You should have received a copy of the GNU General Public        *
00023 //    License (http://www.gnu.org/copyleft/gpl.html) along with this   *
00024 //    program; if not, write to:                                       *
00025 //       The Free Software Foundation Inc.,                            *
00026 //       59 Temple Place - Suite 330,                                  *
00027 //       Boston, MA  02111-1307,                                       *
00028 //       USA.                                                          *
00029 //                                                                     *
00030 //**********************************************************************
00031 //                                                                     *
00032 //    Notes:                                                           *
00033 //                                                                     *
00034 //**********************************************************************
00035 
00036 #define Uses_TRect
00037 #define Uses_TScrollBar
00038 
00039 #include "bellcode.h"
00040 #include "bclist.h"
00041 #include "mytrace.h"
00042 
00043 #include "bmcdlvw.h"
00044 
00045 
00046 using namespace Monitor::BellMaster;
00047 
00048 
00049 
00050 CodeListView::CodeListView(const BellCodeList&    newBellCodes,
00051                            const TRect&           bounds,
00052                            TScrollBar             *aVScrollBar) :
00053     TListViewer(bounds, 1, 0, aVScrollBar), bellCodes(newBellCodes)
00054 {
00055     _USEMYTRACE_("CodeListView::CodeListView")
00056 
00057 
00058     growMode = gfGrowHiX | gfGrowHiY;
00059     options = options | ofFramed;
00060     setRange(bellCodes.size());
00061 }
00062 
00063 
00064 
00065 void
00066 CodeListView::getText(char     *dest, short    item, short    maxLen)
00067 {
00068     _USEMYTRACE_("CodeListView::getText")
00069 
00070 
00071     dest[0] = '\0';
00072 
00073     if ((0 <= item) && (bellCodes.size() > item))
00074     {
00075         strncpy(dest, bellCodes[item].getDescription().c_str(), maxLen);
00076         dest[maxLen] = '\0';
00077     }
00078 }
00079 
00080 
00081 
00082 BellCode*
00083 CodeListView::getSelectedBellCode()
00084 {
00085     _USEMYTRACE_("CodeListView::getSelectedBellCode")
00086 
00087 
00088     BellCode    *selectedBellCode = 0;
00089 
00090     if ((0 <= focused) && (bellCodes.size() > focused))
00091     {
00092         selectedBellCode = &(bellCodes[focused]);
00093     }
00094 
00095     return selectedBellCode;
00096 }
00097 

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