00001 // $Id: TGo4CreateNewDynEntry.cpp 1134 2014-01-22 14:53:40Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TGo4CreateNewDynEntry.h" 00015 00016 #include "TGo4DynamicEntry.h" 00017 #include "TGo4TreeHistogramEntry.h" 00018 #include "TGo4HistogramEntry.h" 00019 00020 TGo4CreateNewDynEntry::TGo4CreateNewDynEntry( QWidget* parent ) 00021 : QDialog( parent) 00022 { 00023 setObjectName("Go4CreateNewDynEntry"); 00024 setupUi(this); 00025 setAcceptDrops(false); 00026 EntryName->setText("entry"); 00027 EntryTitle->setText("Dynamic entry title"); 00028 EntryType->setCurrentIndex(0); 00029 } 00030 00031 TGo4DynamicEntry* TGo4CreateNewDynEntry::MakeEntry() 00032 { 00033 TGo4DynamicEntry* entry = 0; 00034 00035 if (EntryType->currentIndex()==0) 00036 entry = new TGo4HistogramEntry(); 00037 else 00038 if (EntryType->currentIndex()==1) 00039 entry = new TGo4TreeHistogramEntry(); 00040 00041 if (entry!=0) { 00042 entry->EnableProcessing(kFALSE); 00043 entry->SetName(EntryName->text().toLatin1().constData()); 00044 entry->SetTitle(EntryTitle->text().toLatin1().constData()); 00045 } 00046 00047 return entry; 00048 }