2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 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 "AliEveTPCSector2DEditor.h"
11 #include <EveDet/AliEveTPCSector2D.h>
14 #include <TGComboBox.h>
18 //______________________________________________________________________________
20 // Editor for AliEveTPCSector2D.
22 ClassImp(AliEveTPCSector2DEditor)
24 AliEveTPCSector2DEditor::AliEveTPCSector2DEditor(const TGWindow *p,
25 Int_t width, Int_t height,
26 UInt_t options, Pixel_t back) :
27 TGedFrame(p, width, height, options | kVerticalFrame, back),
29 fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
33 MakeTitle("AliEveTPCSector2D");
36 TGHorizontalFrame* f = new TGHorizontalFrame(this);
37 fShowMax = new TGCheckButton(f, "ShowMax");
38 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
39 fShowMax->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoShowMax()");
40 fAverage = new TGCheckButton(f, "Average");
41 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
42 fAverage->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoAverage()");
46 TGHorizontalFrame* f = new TGHorizontalFrame(this);
47 fUseTexture = new TGCheckButton(f, "UseTexture");
48 f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
49 fUseTexture->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoUseTexture()");
50 fPickEmpty = new TGCheckButton(f, "PickEmpty");
51 f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
52 fPickEmpty->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoPickEmpty()");
56 TGHorizontalFrame* f = new TGHorizontalFrame(this);
57 TGLabel* lab = new TGLabel(f, "PickMode");
58 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
59 fPickMode = new TGComboBox(f);
60 fPickMode->AddEntry("Print", 0);
61 fPickMode->AddEntry("1D histo", 1);
62 fPickMode->AddEntry("2D histo", 2);
63 TGListBox* lb = fPickMode->GetListBox();
64 lb->Resize(lb->GetWidth(), 3*18);
65 fPickMode->Resize(80, 20);
66 fPickMode->Connect("Selected(Int_t)", "AliEveTPCSector2DEditor", this, "DoPickMode(Int_t)");
67 f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
72 /******************************************************************************/
74 void AliEveTPCSector2DEditor::SetModel(TObject* obj)
78 fM = dynamic_cast<AliEveTPCSector2D*>(obj);
80 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
83 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
84 fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
85 fPickMode->Select(fM->fPickMode, kFALSE);
88 /******************************************************************************/
90 void AliEveTPCSector2DEditor::DoShowMax()
94 fM->SetShowMax(fShowMax->IsOn());
99 void AliEveTPCSector2DEditor::DoAverage()
103 fM->SetAverage(fAverage->IsOn());
107 void AliEveTPCSector2DEditor::SetupAverage()
109 // Setup Average button according to mode.
112 fAverage->SetEnabled(kFALSE);
114 fAverage->SetEnabled(kTRUE);
115 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
119 /******************************************************************************/
121 void AliEveTPCSector2DEditor::DoUseTexture()
123 // Slot for UseTexture.
125 fM->fUseTexture = fUseTexture->IsOn();
129 void AliEveTPCSector2DEditor::DoPickEmpty()
131 // Slot for PickEmpty.
133 fM->fPickEmpty = fPickEmpty->IsOn();
136 void AliEveTPCSector2DEditor::DoPickMode(Int_t mode)
138 // Slot for PickMode.
140 fM->fPickMode = mode;