]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/AliEveTPCSector2DEditor.cxx
Remove trailing whitespace.
[u/mrichter/AliRoot.git] / EVE / Alieve / AliEveTPCSector2DEditor.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
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  **************************************************************************/
9
10 #include "AliEveTPCSector2DEditor.h"
11 #include <Alieve/AliEveTPCSector2D.h>
12
13 #include <TGButton.h>
14 #include <TGComboBox.h>
15 #include <TGLabel.h>
16
17
18 //______________________________________________________________________
19 // AliEveTPCSector2DEditor
20 //
21
22 ClassImp(AliEveTPCSector2DEditor)
23
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),
28   fM(0),
29   fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
30 {
31   MakeTitle("AliEveTPCSector2D");
32
33   {
34     TGHorizontalFrame* f = new TGHorizontalFrame(this);
35     fShowMax = new TGCheckButton(f, "ShowMax");
36     f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
37     fShowMax->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoShowMax()");
38     fAverage = new TGCheckButton(f, "Average");
39     f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
40     fAverage->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoAverage()");
41     AddFrame(f);
42   }
43   {
44     TGHorizontalFrame* f = new TGHorizontalFrame(this);
45     fUseTexture = new TGCheckButton(f, "UseTexture");
46     f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
47     fUseTexture->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoUseTexture()");
48     fPickEmpty = new TGCheckButton(f, "PickEmpty");
49     f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
50     fPickEmpty->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoPickEmpty()");
51     AddFrame(f);
52   }
53   {
54     TGHorizontalFrame* f = new TGHorizontalFrame(this);
55     TGLabel* lab = new TGLabel(f, "PickMode");
56     f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
57     fPickMode = new TGComboBox(f);
58     fPickMode->AddEntry("Print", 0);
59     fPickMode->AddEntry("1D histo", 1);
60     fPickMode->AddEntry("2D histo", 2);
61     TGListBox* lb = fPickMode->GetListBox();
62     lb->Resize(lb->GetWidth(), 3*18);
63     fPickMode->Resize(80, 20);
64     fPickMode->Connect("Selected(Int_t)", "AliEveTPCSector2DEditor", this, "DoPickMode(Int_t)");
65     f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
66     AddFrame(f);
67   }
68 }
69
70 AliEveTPCSector2DEditor::~AliEveTPCSector2DEditor()
71 {}
72
73 /**************************************************************************/
74
75 void AliEveTPCSector2DEditor::SetModel(TObject* obj)
76 {
77   fM = dynamic_cast<AliEveTPCSector2D*>(obj);
78
79   fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
80   SetupAverage();
81
82   fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
83   fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
84   fPickMode->Select(fM->fPickMode, kFALSE);
85 }
86
87 /**************************************************************************/
88
89 void AliEveTPCSector2DEditor::DoShowMax()
90 {
91   fM->SetShowMax(fShowMax->IsOn());
92   SetupAverage();
93   Update();
94 }
95
96 void AliEveTPCSector2DEditor::DoAverage()
97 {
98   fM->SetAverage(fAverage->IsOn());
99   Update();
100 }
101
102 void AliEveTPCSector2DEditor::SetupAverage()
103 {
104   if(fM->fShowMax) {
105     fAverage->SetEnabled(kFALSE);
106   } else {
107     fAverage->SetEnabled(kTRUE);
108     fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
109   }
110 }
111
112 /**************************************************************************/
113
114 void AliEveTPCSector2DEditor::DoUseTexture()
115 {
116   fM->fUseTexture = fUseTexture->IsOn();
117   Update();
118 }
119
120 void AliEveTPCSector2DEditor::DoPickEmpty()
121 {
122   fM->fPickEmpty = fPickEmpty->IsOn();
123   // Update();
124 }
125
126 void AliEveTPCSector2DEditor::DoPickMode(Int_t mode)
127 {
128   fM->fPickMode = mode;
129   // Update();
130 }