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 //!!! create the widgets here ...
34 // Register the editor.
35 // TClass *cl = TPCSector2D::Class();
36 // TGedElement *ge = new TGedElement;
37 // ge->fGedFrame = this;
39 // cl->GetEditorList()->Add(ge);
41 fUseTexture = new TGCheckButton(this, "UseTexture");
42 AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
44 ("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
47 TGHorizontalFrame* f = new TGHorizontalFrame(this);
48 fShowMax = new TGCheckButton(f, "ShowMax");
49 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
50 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
51 fAverage = new TGCheckButton(f, "Average");
52 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
53 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
54 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
57 // Register the editor.
58 TClass *cl = TPCSector2DEditor::Class();
59 TGedElement *ge = new TGedElement;
62 cl->GetEditorList()->Add(ge);
65 TPCSector2DEditor::~TPCSector2DEditor()
68 /**************************************************************************/
70 void TPCSector2DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t )
75 if (!obj || !obj->InheritsFrom(TPCSector2D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
83 fM = dynamic_cast<TPCSector2D*>(fModel);
85 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
88 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
93 /**************************************************************************/
95 void TPCSector2DEditor::DoShowMax()
97 fM->SetShowMax(fShowMax->IsOn());
102 void TPCSector2DEditor::DoAverage()
104 fM->SetAverage(fAverage->IsOn());
108 void TPCSector2DEditor::SetupAverage()
111 fAverage->SetEnabled(kFALSE);
113 fAverage->SetEnabled(kTRUE);
114 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
118 /**************************************************************************/
120 void TPCSector2DEditor::DoUseTexture()
122 fM->fUseTexture = fUseTexture->IsOn();