]>
Commit | Line | Data |
---|---|---|
6f04ebee | 1 | // $Header$ |
2 | ||
3 | #include "LineEditor.h" | |
4 | #include <Reve/Line.h> | |
5 | ||
6 | #include <TVirtualPad.h> | |
7 | #include <TColor.h> | |
8 | ||
9 | #include <TGLabel.h> | |
10 | #include <TGButton.h> | |
11 | #include <TGNumberEntry.h> | |
12 | #include <TGColorSelect.h> | |
13 | #include <TGDoubleSlider.h> | |
14 | ||
15 | using namespace Reve; | |
16 | ||
17 | //______________________________________________________________________ | |
18 | // LineEditor | |
19 | // | |
20 | ||
21 | ClassImp(LineEditor) | |
22 | ||
23 | LineEditor::LineEditor(const TGWindow *p, Int_t width, Int_t height, | |
24 | UInt_t options, Pixel_t back) : | |
25 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
26 | fM(0), | |
27 | fRnrLine (0), | |
28 | fRnrPoints (0) | |
29 | { | |
32e219c2 | 30 | fPriority = 20; |
6f04ebee | 31 | { |
32 | TGHorizontalFrame* f = new TGHorizontalFrame(this); | |
33 | ||
6f04ebee | 34 | fRnrPoints = new TGCheckButton(f, "Draw Marker"); |
35 | f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0)); | |
36 | fRnrPoints->Connect("Toggled(Bool_t)"," Reve::LineEditor", this, "DoRnrPoints()"); | |
32e219c2 | 37 | |
38 | fRnrLine = new TGCheckButton(f, "Draw Line"); | |
39 | f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0)); | |
40 | fRnrLine->Connect("Toggled(Bool_t)", "Reve::LineEditor", this, "DoRnrLine()"); | |
6f04ebee | 41 | |
42 | AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1)); | |
43 | } | |
44 | } | |
45 | ||
46 | LineEditor::~LineEditor() | |
47 | {} | |
48 | ||
49 | /**************************************************************************/ | |
50 | ||
51 | void LineEditor::SetModel(TObject* obj) | |
52 | { | |
53 | fM = dynamic_cast<Line*>(obj); | |
54 | ||
55 | fRnrLine ->SetState(fM->fRnrLine ? kButtonDown : kButtonUp); | |
56 | fRnrPoints->SetState(fM->fRnrPoints ? kButtonDown : kButtonUp); | |
57 | } | |
58 | ||
59 | /**************************************************************************/ | |
60 | ||
61 | void LineEditor::DoRnrLine() | |
62 | { | |
63 | fM->SetRnrLine(fRnrLine->IsOn()); | |
64 | Update(); | |
65 | } | |
66 | ||
67 | void LineEditor::DoRnrPoints() | |
68 | { | |
69 | fM->SetRnrPoints(fRnrPoints->IsOn()); | |
70 | Update(); | |
71 | } |