2 // Author: Stefano Carrazza 2010
4 /**************************************************************************
5 * Copyright(c) 1998-2009, 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 "AliEveBeamsInfoEditor.h"
11 #include "AliEveBeamsInfo.h"
13 #include "TVirtualPad.h"
16 // Cleanup these includes:
19 #include "TGNumberEntry.h"
20 #include "TGColorSelect.h"
21 #include "TGDoubleSlider.h"
23 #include "TGComboBox.h"
27 //______________________________________________________________________________
28 // GUI editor for AliEveBeamsInfo.
31 ClassImp(AliEveBeamsInfoEditor)
33 //______________________________________________________________________________
34 AliEveBeamsInfoEditor::AliEveBeamsInfoEditor(const TGWindow *p, Int_t width, Int_t height,
35 UInt_t options, Pixel_t back) :
36 TGedFrame(p, width, height, options | kVerticalFrame, back),
45 MakeTitle("AliEveBeamsInfo");
48 fEventSelection = new TGGroupFrame(this, "Event selection:", kHorizontalFrame);
50 fShowEvents = new TGCheckButton(fEventSelection, new TGHotString("&Show info "));
51 fShowEvents->SetState(kButtonDown);
52 fShowEvents->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowEventSelection()");
53 fEventSelection->AddFrame(fShowEvents, new TGLayoutHints(kLHintsLeft | kLHintsTop));
55 fSelect = new TGComboBox(fEventSelection,-1,kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground);
56 fSelect->AddEntry("All events",0);
57 fSelect->AddEntry("Beam 1",1);
58 fSelect->AddEntry("Beam 2",2);
59 fSelect->AddEntry("Beams 1 & 2",3);
60 fSelect->Resize(102,22);
62 fEventSelection->AddFrame(fSelect, new TGLayoutHints(kLHintsRight | kLHintsExpandX));
64 fSelect->Connect("Selected(Int_t)", "AliEveBeamsInfoEditor", this, "SelectEventSelection(Int_t)");
66 AddFrame(fEventSelection, new TGLayoutHints(kLHintsExpandX));
70 TGHorizontalFrame *h = new TGHorizontalFrame(this);
72 fButtonPrev = new TGTextButton(h, "Previous event");
73 h->AddFrame(fButtonPrev, new TGLayoutHints(kLHintsLeft | kLHintsCenterY | kLHintsExpandX));
74 fButtonPrev->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowPrevEvent()");
76 fButtonNext = new TGTextButton(h, "Next event");
77 h->AddFrame( fButtonNext, new TGLayoutHints(kLHintsRight | kLHintsNormal | kLHintsExpandX));
78 fButtonNext->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowNextEvent()");
80 AddFrame(h, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY));
84 //______________________________________________________________________________
85 void AliEveBeamsInfoEditor::SetModel(TObject* obj)
88 fM = dynamic_cast<AliEveBeamsInfo*>(obj);
91 //______________________________________________________________________________
92 void AliEveBeamsInfoEditor::ShowEventSelection()
94 fM->ShowEventSelection();
97 //______________________________________________________________________________
98 void AliEveBeamsInfoEditor::SelectEventSelection(Int_t id)
100 fM->SelectEventSelection(id);
103 //______________________________________________________________________________
104 void AliEveBeamsInfoEditor::ShowPrevEvent()
109 //______________________________________________________________________________
110 void AliEveBeamsInfoEditor::ShowNextEvent()
115 /******************************************************************************/