2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveEventManagerEditor.h"
11 #include "AliEveEventManager.h"
13 #include "TVirtualPad.h"
16 #include <TEveGValuators.h>
18 #include <TGTextView.h>
21 //______________________________________________________________________________
22 // GUI editor for AliEveEventManager.
25 ClassImp(AliEveEventManagerEditor)
27 //______________________________________________________________________________
28 AliEveEventManagerEditor::AliEveEventManagerEditor(const TGWindow *p, Int_t width, Int_t height,
29 UInt_t options, Pixel_t back) :
30 TGedFrame(p, width, height, options | kVerticalFrame, back),
40 MakeTitle("AliEveEventManager");
44 fAutoLoadTime = new TEveGValuator(this, "Autoload time:", 110, 0);
45 fAutoLoadTime->SetShowSlider(kFALSE);
46 fAutoLoadTime->SetNELength(4);
47 fAutoLoadTime->Build();
48 fAutoLoadTime->SetLimits(0, 1000);
49 fAutoLoadTime->SetToolTip("Automatic event loading time in seconds");
50 fAutoLoadTime->Connect("ValueSet(Double_t)",
51 "AliEveEventManagerEditor", this, "DoSetAutoLoadTime()");
53 fAutoLoad = new TGCheckButton(fAutoLoadTime,"Autoload");
54 fAutoLoad->SetToolTipText("Automatic event loading (online)");
55 fAutoLoadTime->AddFrame(fAutoLoad, new TGLayoutHints(kLHintsLeft, 12, 0, 2, 0));
56 fAutoLoad->Connect("Toggled(Bool_t)",
57 "AliEveEventManagerEditor", this, "DoSetAutoLoad()");
58 AddFrame(fAutoLoadTime);
61 TGHorizontalFrame* f = new TGHorizontalFrame(this);
62 fPrevEvent = new TGTextButton(f, "Previous Event");
63 f->AddFrame(fPrevEvent, new TGLayoutHints(kLHintsExpandX, 0,4,0,0));
64 fPrevEvent->Connect("Clicked()",
65 "AliEveEventManagerEditor", this, "DoPrevEvent()");
66 fNextEvent = new TGTextButton(f, "Next Event");
67 f->AddFrame(fNextEvent, new TGLayoutHints(kLHintsExpandX, 4,0,0,0));
68 fNextEvent->Connect("Clicked()",
69 "AliEveEventManagerEditor", this, "DoNextEvent()");
70 AddFrame(f, new TGLayoutHints(kLHintsExpandX, 8,8,8,0));
74 TGVerticalFrame* f = new TGVerticalFrame(this);
76 TGLabel *eventInfoLabel = new TGLabel(f, "Event Information:");
77 f->AddFrame(eventInfoLabel, new TGLayoutHints(kLHintsNormal, 0,0,6,2));
79 fEventInfo = new TGTextView(f, 200, 200);
80 f->AddFrame(fEventInfo, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
82 AddFrame(f, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
87 /******************************************************************************/
89 //______________________________________________________________________________
90 void AliEveEventManagerEditor::SetModel(TObject* obj)
94 fM = dynamic_cast<AliEveEventManager*>(obj);
96 // Set values of widgets
97 fAutoLoadTime->SetValue(fM->GetAutoLoadTime());
98 fAutoLoadTime->SetEnabled(fM->GetAutoLoad());
99 fAutoLoad->SetState(fM->GetAutoLoad() ? kButtonDown : kButtonUp);
101 fPrevEvent->SetEnabled(!fM->GetIsOnline());
103 fEventInfo->LoadBuffer(fM->GetEventInfo());
106 /******************************************************************************/
108 // Implements callback/slot methods
110 //______________________________________________________________________________
111 void AliEveEventManagerEditor::DoSetAutoLoad()
113 // Set the auto-load flag
115 fM->SetAutoLoad(fAutoLoad->IsOn());
119 //______________________________________________________________________________
120 void AliEveEventManagerEditor::DoSetAutoLoadTime()
122 // Set the auto-load time in seconds
124 fM->SetAutoLoadTime(fAutoLoadTime->GetValue());
125 fM->SetAutoLoad(fAutoLoad->IsOn());
129 //______________________________________________________________________________
130 void AliEveEventManagerEditor::DoPrevEvent()
132 // Load previous event
136 //______________________________________________________________________________
137 void AliEveEventManagerEditor::DoNextEvent()