Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

QFitItem.cpp

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "QFitItem.h"
00017 
00018 #include "Riostream.h"
00019 
00020 #include "qstring.h"
00021 
00022 #include "TObject.h"
00023 #include "TGo4FitPanel.h"
00024 
00025 QFitItem::QFitItem(TGo4FitPanel* panel, QFitItem* parent, TObject* iObj, int iObjectType, int iWidgetType, int iPopupMenuType, int iGraphType, int iTag ) :
00026    QListViewItem (parent, QString::null, QString::null)
00027 {
00028    fxPanel = panel;
00029    fxObj = iObj;
00030    fiObjectType = iObjectType;
00031    fiWidgetType = iWidgetType;
00032    fiPopupMenuType = iPopupMenuType;
00033    fiGraphType = iGraphType;
00034    fiTag = iTag;
00035    if (fxPanel) fxPanel->UpdateItem(this, FALSE);
00036 }
00037 
00038 QFitItem::QFitItem(TGo4FitPanel* panel, QListView * parent, TObject* iObj, int iObjectType, int iWidgetType, int iPopupMenuType, int iGraphType, int iTag) :
00039    QListViewItem (parent, QString::null, QString::null)
00040 {
00041    fxPanel = panel;
00042    fxObj = iObj;
00043    fiObjectType = iObjectType;
00044    fiWidgetType = iWidgetType;
00045    fiPopupMenuType = iPopupMenuType;
00046    fiGraphType = iGraphType;
00047    fiTag = iTag;
00048    if (fxPanel) fxPanel->UpdateItem(this, FALSE);
00049 }
00050 
00051 QFitItem::~QFitItem()
00052 {
00053    if (fxPanel) fxPanel->FitItemDeleted(this);
00054 }
00055 
00056 TObject* QFitItem::Object()
00057 {
00058   return fxObj;
00059 }
00060 
00061 void QFitItem::SetObject(TObject* obj)
00062 {
00063   fxObj = obj;
00064 }
00065 
00066 int QFitItem::ObjectType() {
00067   return fiObjectType;
00068 }
00069 
00070 int QFitItem::WidgetType() {
00071   return fiWidgetType;
00072 }
00073 
00074 int QFitItem::PopupMenuType() {
00075   return fiPopupMenuType;
00076 }
00077 
00078 int QFitItem::GraphType() {
00079   return fiGraphType;
00080 }
00081 
00082 int QFitItem::Tag() {
00083   return fiTag;
00084 }
00085 
00086 QFitItem* QFitItem::Parent() {
00087   return dynamic_cast<QFitItem*> (parent());
00088 }
00089 
00090 QFitItem* QFitItem::DefineWidgetItem() {
00091   QFitItem* item = this;
00092 
00093   while (item!=0) {
00094     if (item->WidgetType()!=-1) return item;
00095     item = item->Parent();
00096   }
00097   return 0;
00098 }
00099 
00100 QFitItem* QFitItem::DefineGraphItem() {
00101   QFitItem* item = this;
00102 
00103   while (item!=0) {
00104     if (item->GraphType()!=-1) return item;
00105     item = item->Parent();
00106   }
00107   return 0;
00108 }
00109 
00110 bool QFitItem::FindInParents(QFitItem* item) {
00111    QFitItem* i = this;
00112    i = i->Parent();
00113 
00114    while (i!=0) {
00115      if (i==item) return TRUE;
00116      i = i->Parent();
00117    }
00118 
00119   return FALSE;
00120 }
00121 
00122 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:13 2008 for Go4-v3.04-1 by  doxygen 1.4.2