]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/LineEditor.cxx
White-space.
[u/mrichter/AliRoot.git] / EVE / Reve / LineEditor.cxx
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 {
30   // MakeTitle("Line");
31
32   {
33     TGHorizontalFrame* f = new TGHorizontalFrame(this);
34
35     fRnrLine  = new TGCheckButton(f, "Draw Line");
36     f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
37     fRnrLine->Connect("Toggled(Bool_t)", "Reve::LineEditor", this, "DoRnrLine()");
38     fRnrPoints = new TGCheckButton(f, "Draw Marker");
39     f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));  
40     fRnrPoints->Connect("Toggled(Bool_t)"," Reve::LineEditor", this, "DoRnrPoints()");
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 }