]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/PointSetArrayEditor.cxx
Separate import of standard macros into a special function so that
[u/mrichter/AliRoot.git] / EVE / Reve / PointSetArrayEditor.cxx
1 // $Header$
2
3 #include "PointSetArrayEditor.h"
4 #include <Reve/PointSet.h>
5 #include <Reve/RGValuators.h>
6
7 #include <TVirtualPad.h>
8 #include <TColor.h>
9
10 #include <TGLabel.h>
11 #include <TGButton.h>
12 #include <TGNumberEntry.h>
13 #include <TGColorSelect.h>
14 #include <TGDoubleSlider.h>
15
16 using namespace Reve;
17
18 //______________________________________________________________________
19 // PointSetArrayEditor
20 //
21
22 ClassImp(PointSetArrayEditor)
23
24 PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
25                                          Int_t width, Int_t height,
26                                          UInt_t options, Pixel_t back) :
27   TGedFrame(p,width, height, options | kVerticalFrame, back),
28   fM(0),
29   fRange(0)
30 {
31   fM = 0;
32   MakeTitle("PointSetArray");
33
34   fRange = new RGDoubleValuator(this,"Range", 200, 0);
35   fRange->SetNELength(6);
36   //fRange->SetLabelWidth(labelW);
37   fRange->Build();
38   fRange->GetSlider()->SetWidth(224);
39   fRange->Connect("ValueSet()",
40                  "Reve::PointSetArrayEditor", this, "DoRange()");
41   AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
42 }
43
44 PointSetArrayEditor::~PointSetArrayEditor()
45 {}
46
47 /**************************************************************************/
48
49 void PointSetArrayEditor::SetModel(TObject* obj)
50 {
51   fM = dynamic_cast<PointSetArray*>(obj);
52
53   // printf("FullRange(%f, %f) Selected(%f,%f)\n",
54   //        fM->GetMin(), fM->GetMax(), fM->GetCurMin(), fM->GetCurMax());
55
56   fRange->SetLimits(fM->fMin, fM->fMax, TGNumberFormat::kNESRealTwo);
57   fRange->SetValues(fM->fCurMin, fM->fCurMax);
58 }
59
60 /**************************************************************************/
61
62 void PointSetArrayEditor::DoRange()
63 {
64   fM->SetRange(fRange->GetMin(), fRange->GetMax());
65   Update();
66 }