3 #include "TPCSector2DEditor.h"
4 #include <Alieve/TPCSector2D.h>
6 #include <TVirtualPad.h>
11 #include <TGNumberEntry.h>
12 #include <TGColorSelect.h>
14 #include <TGDoubleSlider.h>
17 using namespace Alieve;
19 //______________________________________________________________________
23 ClassImp(TPCSector2DEditor)
25 TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height,
26 UInt_t options, Pixel_t back) :
27 TGedFrame(p, id, width, height, options | kVerticalFrame, back)
30 MakeTitle("TPCSector2D");
32 fUseTexture = new TGCheckButton(this, "UseTexture");
33 AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
35 ("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
38 TGHorizontalFrame* f = new TGHorizontalFrame(this);
39 fShowMax = new TGCheckButton(f, "ShowMax");
40 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
41 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
42 fAverage = new TGCheckButton(f, "Average");
43 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
44 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
45 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
48 // Register the editor.
49 TClass *cl = TPCSector2DEditor::Class();
50 TGedElement *ge = new TGedElement;
53 cl->GetEditorList()->Add(ge);
56 TPCSector2DEditor::~TPCSector2DEditor()
59 /**************************************************************************/
61 void TPCSector2DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t )
66 if (!obj || !obj->InheritsFrom(TPCSector2D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
74 fM = dynamic_cast<TPCSector2D*>(fModel);
76 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
79 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
84 /**************************************************************************/
86 void TPCSector2DEditor::DoShowMax()
88 fM->SetShowMax(fShowMax->IsOn());
93 void TPCSector2DEditor::DoAverage()
95 fM->SetAverage(fAverage->IsOn());
99 void TPCSector2DEditor::SetupAverage()
102 fAverage->SetEnabled(kFALSE);
104 fAverage->SetEnabled(kTRUE);
105 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
109 /**************************************************************************/
111 void TPCSector2DEditor::DoUseTexture()
113 fM->fUseTexture = fUseTexture->IsOn();