]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Header$ |
2 | ||
3 | #include "PointSetArrayEditor.h" | |
4 | #include <Reve/PointSet.h> | |
a3912979 | 5 | #include <Reve/RGValuators.h> |
5a5a1232 | 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 | ||
e9ef1a49 | 24 | //______________________________________________________________________________ |
a8600b56 | 25 | PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p, |
26 | Int_t width, Int_t height, | |
27 | UInt_t options, Pixel_t back) : | |
28 | TGedFrame(p,width, height, options | kVerticalFrame, back), | |
265ecb21 | 29 | fM(0), |
30 | fRange(0) | |
5a5a1232 | 31 | { |
e9ef1a49 | 32 | // Constructor. |
33 | ||
5a5a1232 | 34 | fM = 0; |
35 | MakeTitle("PointSetArray"); | |
36 | ||
a3912979 | 37 | fRange = new RGDoubleValuator(this,"Range", 200, 0); |
38 | fRange->SetNELength(6); | |
39 | //fRange->SetLabelWidth(labelW); | |
40 | fRange->Build(); | |
41 | fRange->GetSlider()->SetWidth(224); | |
42 | fRange->Connect("ValueSet()", | |
43 | "Reve::PointSetArrayEditor", this, "DoRange()"); | |
44 | AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); | |
5a5a1232 | 45 | } |
46 | ||
e9ef1a49 | 47 | //______________________________________________________________________________ |
5a5a1232 | 48 | PointSetArrayEditor::~PointSetArrayEditor() |
e9ef1a49 | 49 | { |
50 | // Destructor. | |
51 | } | |
5a5a1232 | 52 | |
53 | /**************************************************************************/ | |
54 | ||
e9ef1a49 | 55 | //______________________________________________________________________________ |
a8600b56 | 56 | void PointSetArrayEditor::SetModel(TObject* obj) |
5a5a1232 | 57 | { |
e9ef1a49 | 58 | // Set model object. |
59 | ||
a8600b56 | 60 | fM = dynamic_cast<PointSetArray*>(obj); |
5a5a1232 | 61 | |
ee399035 | 62 | // printf("FullRange(%f, %f) Selected(%f,%f)\n", |
63 | // fM->GetMin(), fM->GetMax(), fM->GetCurMin(), fM->GetCurMax()); | |
a3912979 | 64 | |
65 | fRange->SetLimits(fM->fMin, fM->fMax, TGNumberFormat::kNESRealTwo); | |
66 | fRange->SetValues(fM->fCurMin, fM->fCurMax); | |
5a5a1232 | 67 | } |
68 | ||
69 | /**************************************************************************/ | |
70 | ||
e9ef1a49 | 71 | //______________________________________________________________________________ |
a3912979 | 72 | void PointSetArrayEditor::DoRange() |
5a5a1232 | 73 | { |
e9ef1a49 | 74 | // Slot for setting the range of the separating quantity. |
75 | ||
a3912979 | 76 | fM->SetRange(fRange->GetMin(), fRange->GetMax()); |
a8600b56 | 77 | Update(); |
5a5a1232 | 78 | } |