3 #include "TPCSector2DEditor.h"
4 #include <Alieve/TPCSector2D.h>
7 #include <TGComboBox.h>
11 using namespace Alieve;
13 //______________________________________________________________________
17 ClassImp(TPCSector2DEditor)
19 TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p,
20 Int_t width, Int_t height,
21 UInt_t options, Pixel_t back) :
22 TGedFrame(p, width, height, options | kVerticalFrame, back),
24 fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
26 MakeTitle("TPCSector2D");
29 TGHorizontalFrame* f = new TGHorizontalFrame(this);
30 fShowMax = new TGCheckButton(f, "ShowMax");
31 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
32 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
33 fAverage = new TGCheckButton(f, "Average");
34 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
35 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
39 TGHorizontalFrame* f = new TGHorizontalFrame(this);
40 fUseTexture = new TGCheckButton(f, "UseTexture");
41 f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
42 fUseTexture->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
43 fPickEmpty = new TGCheckButton(f, "PickEmpty");
44 f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
45 fPickEmpty->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoPickEmpty()");
49 TGHorizontalFrame* f = new TGHorizontalFrame(this);
50 TGLabel* lab = new TGLabel(f, "PickMode");
51 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
52 fPickMode = new TGComboBox(f);
53 fPickMode->AddEntry("Print", 0);
54 fPickMode->AddEntry("1D histo", 1);
55 fPickMode->AddEntry("2D histo", 2);
56 TGListBox* lb = fPickMode->GetListBox();
57 lb->Resize(lb->GetWidth(), 3*18);
58 fPickMode->Resize(80, 20);
59 fPickMode->Connect("Selected(Int_t)", "Alieve::TPCSector2DEditor", this, "DoPickMode(Int_t)");
60 f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
65 TPCSector2DEditor::~TPCSector2DEditor()
68 /**************************************************************************/
70 void TPCSector2DEditor::SetModel(TObject* obj)
72 fM = dynamic_cast<TPCSector2D*>(obj);
74 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
77 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
78 fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
79 fPickMode->Select(fM->fPickMode, kFALSE);
82 /**************************************************************************/
84 void TPCSector2DEditor::DoShowMax()
86 fM->SetShowMax(fShowMax->IsOn());
91 void TPCSector2DEditor::DoAverage()
93 fM->SetAverage(fAverage->IsOn());
97 void TPCSector2DEditor::SetupAverage()
100 fAverage->SetEnabled(kFALSE);
102 fAverage->SetEnabled(kTRUE);
103 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
107 /**************************************************************************/
109 void TPCSector2DEditor::DoUseTexture()
111 fM->fUseTexture = fUseTexture->IsOn();
115 void TPCSector2DEditor::DoPickEmpty()
117 fM->fPickEmpty = fPickEmpty->IsOn();
121 void TPCSector2DEditor::DoPickMode(Int_t mode)
123 fM->fPickMode = mode;