00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4QFitterItem.h"
00017
00018 #include "Go4Fit/TGo4Fitter.h"
00019 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00020 #include "Go4FitGUI/TGo4FitPanel.h"
00021 #include "Go4GUI/TGo4MainWindow.h"
00022 #include "Go4GUI/TGo4PreviewPanel.h"
00023
00024 TGo4QFitterItem::TGo4QFitterItem( QListViewItem* parent, const QString & text, const QString & text1, const QString & text2)
00025 : TGo4QDragDrop(parent, "fitter.png", text, text1, text2)
00026 {
00027 }
00028
00029 TGo4QFitterItem::TGo4QFitterItem( QListView* parent, const QString & text, const QString & text1, const QString & text2)
00030 : TGo4QDragDrop(parent, "fitter.png", text, text1, text2)
00031 {
00032 }
00033
00034 TGo4QFitterItem::~TGo4QFitterItem()
00035 {
00036 }
00037
00038 void TGo4QFitterItem::ItemDBkLocal()
00039 {
00040 TGo4FitPanel* fpanel = GetFitPanel();
00041 if (fpanel!=0)
00042 fpanel->ActivateByFitter(dynamic_cast<TGo4Fitter*>(GetWorkObject()));
00043 }
00044
00045
00046 TGo4FitPanel *TGo4QFitterItem::GetFitPanel()
00047 {
00048 TGo4MainWindow *fxPanel= dynamic_cast <TGo4MainWindow *> (fxTGo4GUIRegistry->GetMainWindow());
00049 TGo4FitPanel *FitPanel=fxPanel->FitPanelSlot();
00050 FitPanel->raise();
00051 FitPanel->show();
00052 return FitPanel;
00053 }
00054
00055
00056 void TGo4QFitterItem::DropAction(QWidget *Recvr)
00057 {
00058 TGo4PreviewPanel* panel = dynamic_cast<TGo4PreviewPanel *>(Recvr);
00059 if (panel==0) return;
00060
00061 TGo4Fitter* fitter = dynamic_cast<TGo4Fitter*>(GetWorkObject());
00062 if (fitter==0) return;
00063
00064 TGo4FitPanel* fpanel = GetFitPanel();
00065 if (fpanel!=0)
00066 fpanel->DropFitterOnPanel(fitter, panel);
00067 }
00068
00069