]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveTOFStripEditor.cxx
bcf16a1178e55c6cba5e3dbb52ac2dfc63fd047d
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTOFStripEditor.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 "AliEveTOFStripEditor.h"
11 #include <EveDet/AliEveTOFStrip.h>
12
13 #include <TVirtualPad.h>
14 #include <TColor.h>
15 #include <TEveGValuators.h>
16
17 #include <TGLabel.h>
18 #include <TGButton.h>
19 #include <TGNumberEntry.h>
20 #include <TGColorSelect.h>
21 #include <TGSlider.h>
22 #include <TGDoubleSlider.h>
23
24 //______________________________________________________________________________
25 // AliEveTOFStripEditor
26 //
27
28 ClassImp(AliEveTOFStripEditor)
29
30 AliEveTOFStripEditor::AliEveTOFStripEditor(const TGWindow *p, Int_t width, Int_t height,
31                                            UInt_t options, Pixel_t back) :
32   TGedFrame(p, width, height, options | kVerticalFrame, back),
33   fM         (0),
34   fThreshold (0),
35   fMaxVal    (0)
36   // Initialize widget pointers to 0
37 {
38   MakeTitle("AliEveTOFStrip");
39
40   // Create widgets
41   // fXYZZ = new TGSomeWidget(this, ...);
42   // AddFrame(fXYZZ, new TGLayoutHints(...));
43   // fXYZZ->Connect("SignalName()", "AliEveTOFStripEditor", this, "DoXYZZ()");
44
45   fThreshold = new TEveGValuator(this, "Threshold", 200, 0);
46   fThreshold->SetNELength(4);
47   fThreshold->SetLabelWidth(60);
48   fThreshold->Build();
49   fThreshold->GetSlider()->SetWidth(120);
50   fThreshold->SetLimits(0,250);
51   fThreshold->Connect("ValueSet(Double_t)",
52                       "AliEveTOFSectorEditor", this, "DoThreshold()");
53   AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
54
55   fMaxVal = new TEveGValuator(this,"MaxVal", 200, 0);
56   fMaxVal->SetNELength(4);
57   fMaxVal->SetLabelWidth(60);
58   fMaxVal->Build();
59   fMaxVal->GetSlider()->SetWidth(60);
60   fMaxVal->SetLimits(0, 500);
61   fMaxVal->Connect("ValueSet(Double_t)",
62                    "AliEveTOFSectorEditor", this, "DoMaxVal()");
63   AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
64
65 }
66
67 /******************************************************************************/
68
69 void AliEveTOFStripEditor::SetModel(TObject* obj)
70 {
71   fM = dynamic_cast<AliEveTOFStrip*>(obj);
72
73   // Set values of widgets
74   // fXYZZ->SetValue(fM->GetXYZZ());
75 }
76
77 /******************************************************************************/
78 void AliEveTOFStripEditor::DoThreshold()
79 {
80   fM->SetThreshold((Short_t) fThreshold->GetValue());
81   fThreshold->SetValue(fM->GetThreshold());
82   Update();
83 }
84
85 void AliEveTOFStripEditor::DoMaxVal()
86 {
87   fM->SetMaxVal((Int_t) fMaxVal->GetValue());
88   fMaxVal->SetValue(fM->GetMaxVal());
89   Update();
90 }
91
92 // Implements callback/slot methods
93
94 // void AliEveTOFStripEditor::DoXYZZ()
95 // {
96 //   fM->SetXYZZ(fXYZZ->GetValue());
97 //   Update();
98 // }