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

SIG_IndividualView.cpp

00001 #include <qlabel.h>
00002 #include <qmultilineedit.h>
00003 
00004 #include "SIGEL_MasterGUI/SIG_IndividualView.h"
00005 
00006 #include "SIGEL_Tools/SIG_IO.h"
00007 
00008 namespace SIGEL_MasterGUI
00009 {
00010 
00011 /* 
00012  *  Constructs a SIG_IndividualView which is a child of 'parent', with the 
00013  *  name 'name' and widget flags set to 'f' 
00014  */
00015 SIG_IndividualView::SIG_IndividualView( QWidget* parent,  const char* name, WFlags fl )
00016     : SIG_IndividualViewBase( parent, name, fl )
00017 {
00018 }
00019 
00020 SIG_IndividualView::SIG_IndividualView( QWidget* parent,  const char* name, WFlags fl, SIGEL_GP::SIG_GPIndividual *theGPIndividual )
00021     : SIG_IndividualViewBase( parent, name, fl )
00022 {
00023   textlabelShowName->setText( theGPIndividual->getName() );
00024   QString age = QString::number( theGPIndividual->getAge() );
00025   textlabelShowAge->setText( age );
00026   QString fitness = QString::number( theGPIndividual->getFitness() );
00027   textlabelShowFitness->setText( fitness );
00028   QString programCode;
00029   theGPIndividual->getProgramPointer()->printToString( programCode );
00030   multilineeditProgramCode->setText( programCode );
00031   QString history = theGPIndividual->getHistory().join( "\n" );
00032   multilineeditHistory->setText( history );
00033 }
00034 
00035 /*  
00036  *  Destroys the object and frees any allocated resources
00037  */
00038 SIG_IndividualView::~SIG_IndividualView()
00039 {
00040   // no need to delete child widgets, Qt does it all for us
00041 }
00042 
00043 void SIG_IndividualView::clear()
00044 {
00045   textlabelShowName->setText( QString::null );
00046   textlabelShowAge->setText( QString::null );
00047   textlabelShowFitness->setText( QString::null );
00048   multilineeditProgramCode->clear();
00049   multilineeditHistory->clear();
00050 };
00051 
00052 /* void SIG_IndividualView::closeEvent( QCloseEvent *e )
00053 {
00054   QWidget::closeEvent( e );
00055   delete this;
00056 }; */
00057 
00058 }

Generated at Mon Sep 3 01:32:25 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000