ClassImp(TPCSector3DEditor)
-TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height,
+TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p,
+ Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
- TGedFrame(p, id, width, height, options | kVerticalFrame, back)
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM(0),
+ fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0)
{
- fM = 0;
MakeTitle("TPCSector3D");
Int_t labelW = 60;
"Alieve::TPCSector3DEditor", this, "DoPointFrac()");
AddFrame(fPointFrac, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
- // Register the editor.
- TClass *cl = TPCSector3D::Class();
- TGedElement *ge = new TGedElement;
- ge->fGedFrame = this;
- ge->fCanvas = 0;
- cl->GetEditorList()->Add(ge);
+ fPointSize = new RGValuator(this,"Point size", 200, 0);
+ fPointSize->SetLabelWidth(labelW);
+ fPointSize->SetShowSlider(kFALSE);
+ fPointSize->SetNELength(4);
+ fPointSize->Build();
+ //fPointSize->GetSlider()->SetWidth(101 + 16);
+ fPointSize->SetLimits(0.1, 32.0, 1, TGNumberFormat::kNESRealOne);
+ fPointSize->SetToolTip("Size of displayed points");
+ fPointSize->Connect("ValueSet(Double_t)",
+ "Alieve::TPCSector3DEditor", this, "DoPointSize()");
+ AddFrame(fPointSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
}
TPCSector3DEditor::~TPCSector3DEditor()
/**************************************************************************/
-void TPCSector3DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t /*event*/)
+void TPCSector3DEditor::SetModel(TObject* obj)
{
- fModel = 0;
- fPad = 0;
-
- if (!obj || !obj->InheritsFrom(TPCSector3D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
- SetActive(kFALSE);
- return;
- }
-
- fModel = obj;
- fPad = pad;
-
- fM = dynamic_cast<TPCSector3D*>(fModel);
+ fM = dynamic_cast<TPCSector3D*>(obj);
fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp);
fDriftVel->SetValue(fM->fDriftVel);
fPointFrac->SetValue(fM->fPointFrac);
-
- SetActive();
+ fPointSize->SetValue(fM->fPointSize);
}
/**************************************************************************/
Update();
}
+void TPCSector3DEditor::DoPointSize()
+{
+ fM->SetPointSize(fPointSize->GetValue());
+ Update();
+}
+