3 #include "TPCSector2DEditor.h"
4 #include <Alieve/TPCSector2D.h>
7 #include <TGComboBox.h>
9 using namespace Alieve;
11 //______________________________________________________________________
15 ClassImp(TPCSector2DEditor)
17 TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p,
18 Int_t width, Int_t height,
19 UInt_t options, Pixel_t back) :
20 TGedFrame(p, width, height, options | kVerticalFrame, back),
22 fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
24 MakeTitle("TPCSector2D");
27 TGHorizontalFrame* f = new TGHorizontalFrame(this);
28 fShowMax = new TGCheckButton(f, "ShowMax");
29 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
30 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
31 fAverage = new TGCheckButton(f, "Average");
32 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
33 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
37 TGHorizontalFrame* f = new TGHorizontalFrame(this);
38 fUseTexture = new TGCheckButton(f, "UseTexture");
39 f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
40 fUseTexture->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
41 fPickEmpty = new TGCheckButton(f, "PickEmpty");
42 f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
43 fPickEmpty->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoPickEmpty()");
47 TGHorizontalFrame* f = new TGHorizontalFrame(this);
48 TGLabel* lab = new TGLabel(f, "PickMode");
49 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
50 fPickMode = new TGComboBox(f);
51 fPickMode->AddEntry("Print", 0);
52 fPickMode->AddEntry("1D histo", 1);
53 fPickMode->AddEntry("2D histo", 2);
54 TGListBox* lb = fPickMode->GetListBox();
55 lb->Resize(lb->GetWidth(), 3*18);
56 fPickMode->Resize(80, 20);
57 fPickMode->Connect("Selected(Int_t)", "Alieve::TPCSector2DEditor", this, "DoPickMode(Int_t)");
58 f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
63 TPCSector2DEditor::~TPCSector2DEditor()
66 /**************************************************************************/
68 void TPCSector2DEditor::SetModel(TObject* obj)
70 fM = dynamic_cast<TPCSector2D*>(obj);
72 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
75 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
76 fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
77 fPickMode->Select(fM->fPickMode, kFALSE);
80 /**************************************************************************/
82 void TPCSector2DEditor::DoShowMax()
84 fM->SetShowMax(fShowMax->IsOn());
89 void TPCSector2DEditor::DoAverage()
91 fM->SetAverage(fAverage->IsOn());
95 void TPCSector2DEditor::SetupAverage()
98 fAverage->SetEnabled(kFALSE);
100 fAverage->SetEnabled(kTRUE);
101 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
105 /**************************************************************************/
107 void TPCSector2DEditor::DoUseTexture()
109 fM->fUseTexture = fUseTexture->IsOn();
113 void TPCSector2DEditor::DoPickEmpty()
115 fM->fPickEmpty = fPickEmpty->IsOn();
119 void TPCSector2DEditor::DoPickMode(Int_t mode)
121 fM->fPickMode = mode;