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,
26 Int_t width, Int_t height,
27 UInt_t options, Pixel_t back) :
28 TGedFrame(p, id, width, height, options | kVerticalFrame, back),
30 fShowMax(0), fAverage(0), fUseTexture(0)
32 MakeTitle("TPCSector2D");
34 fUseTexture = new TGCheckButton(this, "UseTexture");
35 AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
37 ("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
40 TGHorizontalFrame* f = new TGHorizontalFrame(this);
41 fShowMax = new TGCheckButton(f, "ShowMax");
42 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
43 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
44 fAverage = new TGCheckButton(f, "Average");
45 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
46 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
47 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
50 // Register the editor.
51 TClass *cl = TPCSector2DEditor::Class();
52 TGedElement *ge = new TGedElement;
55 cl->GetEditorList()->Add(ge);
58 TPCSector2DEditor::~TPCSector2DEditor()
61 /**************************************************************************/
63 void TPCSector2DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t )
68 if (!obj || !obj->InheritsFrom(TPCSector2D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
76 fM = dynamic_cast<TPCSector2D*>(fModel);
78 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
81 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
86 /**************************************************************************/
88 void TPCSector2DEditor::DoShowMax()
90 fM->SetShowMax(fShowMax->IsOn());
95 void TPCSector2DEditor::DoAverage()
97 fM->SetAverage(fAverage->IsOn());
101 void TPCSector2DEditor::SetupAverage()
104 fAverage->SetEnabled(kFALSE);
106 fAverage->SetEnabled(kTRUE);
107 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
111 /**************************************************************************/
113 void TPCSector2DEditor::DoUseTexture()
115 fM->fUseTexture = fUseTexture->IsOn();