]>
Commit | Line | Data |
---|---|---|
1383fb4a | 1 | // $Header$ |
2 | ||
3 | #include "StraightLineSetEditor.h" | |
4 | #include <Reve/StraightLineSet.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 | // StraightLineSetEditor | |
19 | // | |
20 | ||
21 | ClassImp(StraightLineSetEditor) | |
22 | ||
23 | StraightLineSetEditor::StraightLineSetEditor(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 | // Initialize widget pointers to 0 | |
28 | { | |
29 | MakeTitle("StraightLineSet"); | |
30 | ||
31 | TGHorizontalFrame* frame = new TGHorizontalFrame(this); | |
32 | ||
33 | fRnrMarkers = new TGCheckButton(frame, "RnrMarkers"); | |
34 | frame->AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsLeft, 1, 2, 1, 1)); | |
35 | fRnrMarkers->Connect | |
36 | ("Toggled(Bool_t)", | |
37 | "Reve::StraightLineSetEditor", this, "DoRnrMarkers()"); | |
38 | ||
39 | fRnrLines = new TGCheckButton(frame, "RnrLines"); | |
40 | frame->AddFrame(fRnrLines, new TGLayoutHints(kLHintsLeft, 2, 1, 1, 1)); | |
41 | fRnrLines->Connect | |
42 | ("Toggled(Bool_t)", | |
43 | "Reve::StraightLineSetEditor", this, "DoRnrLines()"); | |
44 | ||
45 | AddFrame(frame, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0)); | |
46 | } | |
47 | ||
48 | StraightLineSetEditor::~StraightLineSetEditor() | |
49 | {} | |
50 | ||
51 | /**************************************************************************/ | |
52 | ||
53 | void StraightLineSetEditor::SetModel(TObject* obj) | |
54 | { | |
55 | fM = dynamic_cast<StraightLineSet*>(obj); | |
56 | ||
57 | // Set values of widgets | |
58 | fRnrMarkers->SetState(fM->fRnrMarkers ? kButtonDown : kButtonUp); | |
59 | fRnrLines->SetState(fM->fRnrLines ? kButtonDown : kButtonUp); | |
60 | } | |
61 | ||
62 | /**************************************************************************/ | |
63 | ||
64 | // Implements callback/slot methods | |
65 | ||
66 | void StraightLineSetEditor::DoRnrMarkers() | |
67 | { | |
68 | fM->fRnrMarkers = fRnrMarkers->IsOn(); | |
69 | Update(); | |
70 | } | |
71 | ||
72 | void StraightLineSetEditor::DoRnrLines() | |
73 | { | |
74 | fM->fRnrLines = fRnrLines->IsOn(); | |
75 | Update(); | |
76 | } |