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

/Go4FitGUI/QFitItem.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 <qstring.h>
00017 
00018 #include "TObject.h"
00019 #include "QFitItem.h"
00020 #include "TGo4FitPanelSlots.h"
00021 
00022 QFitItem::QFitItem(TGo4FitPanelSlots* iSlots, QFitItem* parent, TObject* iObj, int iObjectType, int iWidgetType, int iPopupMenuType, int iGraphType, int iTag ) :
00023    QListViewItem (parent, QString::null, QString::null) {
00024    fxSlots = iSlots;
00025    fxObj = iObj;
00026    fiObjectType = iObjectType;
00027    fiWidgetType = iWidgetType;
00028    fiPopupMenuType = iPopupMenuType;
00029    fiGraphType = iGraphType;
00030    fiTag = iTag;
00031    if (fxSlots) fxSlots->UpdateItem(this, FALSE);
00032 }
00033 
00034 QFitItem::QFitItem(TGo4FitPanelSlots* iSlots, QListView * parent, TObject* iObj, int iObjectType, int iWidgetType, int iPopupMenuType, int iGraphType, int iTag) :
00035    QListViewItem (parent, QString::null, QString::null) {
00036    fxSlots = iSlots;
00037    fxObj = iObj;
00038    fiObjectType = iObjectType;
00039    fiWidgetType = iWidgetType;
00040    fiPopupMenuType = iPopupMenuType;
00041    fiGraphType = iGraphType;
00042    fiTag = iTag;
00043    if (fxSlots) fxSlots->UpdateItem(this, FALSE);
00044 }
00045 
00046 QFitItem::~QFitItem() {
00047    if (fxSlots) fxSlots->FitItemDeleted(this);
00048 }
00049 
00050 TObject* QFitItem::Object() {
00051   return fxObj;
00052 }
00053 
00054 void QFitItem::SetObject(TObject* obj) {
00055   fxObj = obj;
00056 }
00057 
00058 int QFitItem::ObjectType() {
00059   return fiObjectType;
00060 }
00061 
00062 int QFitItem::WidgetType() {
00063   return fiWidgetType;
00064 }
00065 
00066 int QFitItem::PopupMenuType() {
00067   return fiPopupMenuType;
00068 }
00069 
00070 int QFitItem::GraphType() {
00071   return fiGraphType;
00072 }
00073 
00074 int QFitItem::Tag() {
00075   return fiTag;
00076 }
00077 
00078 QFitItem* QFitItem::Parent() {
00079   return dynamic_cast<QFitItem*> (parent());
00080 }
00081 
00082 QFitItem* QFitItem::DefineWidgetItem() {
00083   QFitItem* item = this;
00084 
00085   while (item!=0) {
00086     if (item->WidgetType()!=-1) return item;
00087     item = item->Parent();
00088   }
00089   return 0;
00090 }
00091 
00092 QFitItem* QFitItem::DefineGraphItem() {
00093   QFitItem* item = this;
00094 
00095   while (item!=0) {
00096     if (item->GraphType()!=-1) return item;
00097     item = item->Parent();
00098   }
00099   return 0;
00100 }
00101 
00102 bool QFitItem::FindInParents(QFitItem* item) {
00103    QFitItem* i = this;
00104    i = i->Parent();
00105 
00106    while (i!=0) {
00107      if (i==item) return TRUE;
00108      i = i->Parent();
00109    }
00110 
00111   return FALSE;
00112 }
00113 
00114 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:57 2005 for Go4-v2.10-5 by doxygen1.2.15