Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEveStraightLineSetEditor.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
13 #include "TEveStraightLineSet.h"
14 
15 #include "TVirtualPad.h"
16 #include "TColor.h"
17 
18 #include "TGLabel.h"
19 #include "TGButton.h"
20 #include "TGNumberEntry.h"
21 #include "TGColorSelect.h"
22 #include "TGDoubleSlider.h"
23 
24 /** \class TEveStraightLineSetEditor
25 \ingroup TEve
26 Editor for TEveStraightLineSet class.
27 */
28 
29 ClassImp(TEveStraightLineSetEditor);
30 
31 ////////////////////////////////////////////////////////////////////////////////
32 /// Constructor.
33 
34 TEveStraightLineSetEditor::TEveStraightLineSetEditor(const TGWindow *p, Int_t width, Int_t height,
35  UInt_t options, Pixel_t back) :
36  TGedFrame(p, width, height, options | kVerticalFrame, back),
37  fM(0)
38  // Initialize widget pointers to 0
39 {
40  MakeTitle("TEveStraightLineSet");
41 
42  TGHorizontalFrame* frame = new TGHorizontalFrame(this);
43 
44  fRnrMarkers = new TGCheckButton(frame, "RnrMarkers");
45  frame->AddFrame(fRnrMarkers, new TGLayoutHints(kLHintsLeft, 1, 2, 1, 1));
46  fRnrMarkers->Connect
47  ("Toggled(Bool_t)",
48  "TEveStraightLineSetEditor", this, "DoRnrMarkers()");
49 
50  fRnrLines = new TGCheckButton(frame, "RnrLines");
51  frame->AddFrame(fRnrLines, new TGLayoutHints(kLHintsLeft, 2, 1, 1, 1));
52  fRnrLines->Connect
53  ("Toggled(Bool_t)",
54  "TEveStraightLineSetEditor", this, "DoRnrLines()");
55 
56  AddFrame(frame, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// Set model object.
61 
62 void TEveStraightLineSetEditor::SetModel(TObject* obj)
63 {
64  fM = dynamic_cast<TEveStraightLineSet*>(obj);
65 
66  // Set values of widgets
67  fRnrMarkers->SetState(fM->GetRnrMarkers() ? kButtonDown : kButtonUp);
68  fRnrLines->SetState(fM->GetRnrLines() ? kButtonDown : kButtonUp);
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Slot for RnrMarkers.
73 
74 void TEveStraightLineSetEditor::DoRnrMarkers()
75 {
76  fM->SetRnrMarkers(fRnrMarkers->IsOn());
77  Update();
78 }
79 
80 ////////////////////////////////////////////////////////////////////////////////
81 /// Slot for RnrLines.
82 
83 void TEveStraightLineSetEditor::DoRnrLines()
84 {
85  fM->SetRnrLines(fRnrLines->IsOn());
86  Update();
87 }