Logo ROOT   6.10/09
Reference Guide
TEveProjectionAxesEditor.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 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 "TEveProjectionAxes.h"
14 #include "TEveGValuators.h"
15 
16 #include "TGComboBox.h"
17 #include "TGButton.h"
18 #include "TGLabel.h"
19 #include "TG3DLine.h"
20 
21 /** \class TEveProjectionAxesEditor
22 \ingroup TEve
23 GUI editor for TEveProjectionAxes.
24 */
25 
27 
28 ////////////////////////////////////////////////////////////////////////////////
29 
31  UInt_t options, Pixel_t back) :
32  TGedFrame(p, width, height, options | kVerticalFrame, back),
33  fM(0),
34 
35  fLabMode(0),
36  fAxesMode(0),
37 
38  fCenterFrame(0),
39  fDrawCenter(0),
40  fDrawOrigin(0)
41 {
42  // Constructor.
43 
44  MakeTitle("TEveProjectionAxis");
45  Int_t labw=52;
46 
47  {
49 
50  TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
51  labfr->AddFrame(new TGLabel(labfr, "Labels:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
52  f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
53 
54  fLabMode = new TGComboBox(f, "Position");
55  fLabMode->AddEntry("Value", 1);
56  fLabMode->AddEntry("Position", 0);
57  fLabMode->GetTextEntry()->SetToolTipText("Set tick-marks on equidistant values/screen position.");
58  TGListBox* lb = fLabMode->GetListBox();
59  lb->Resize(lb->GetWidth(), 2*18);
60  fLabMode->Resize(80, 20);
61  fLabMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoLabMode(Int_t)");
62  f->AddFrame(fLabMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
63  AddFrame(f);
64  }
65 
66  {
68  TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
69  labfr->AddFrame(new TGLabel(labfr, "Axes:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
70  f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
71 
72 
73  fAxesMode = new TGComboBox(f, "All");
78  lb->Resize(lb->GetWidth(), 2*18);
79  fAxesMode->Resize(80, 20);
80  fAxesMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoAxesMode(Int_t)");
81  f->AddFrame(fAxesMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
82  AddFrame(f);
83  }
84 
85  //______________________________________________________________________________
86 
87  // center tab
89 
90  TGCompositeFrame *title1 = new TGCompositeFrame(fCenterFrame, 180, 10,
93  kFixedWidth |
95  title1->AddFrame(new TGLabel(title1, "Distortion Center"),
96  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
97  title1->AddFrame(new TGHorizontal3DLine(title1),
98  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
99  fCenterFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
100 
101 
102  {
103 
105 
106  fDrawOrigin = new TGCheckButton(hf1, "DrawOrigin");
107  hf1->AddFrame(fDrawOrigin, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
108  fDrawOrigin->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawOrigin()");
109 
110 
111  fDrawCenter = new TGCheckButton(hf1, "DrawCenter");
112  hf1->AddFrame(fDrawCenter, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
113  fDrawCenter->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawCenter()");
114 
115  fCenterFrame->AddFrame(hf1, new TGLayoutHints(kLHintsTop, 0,0,0,0));
116 
117  }
118 }
119 
120 ////////////////////////////////////////////////////////////////////////////////
121 /// Set model object.
122 
124 {
125  fM = dynamic_cast<TEveProjectionAxes*>(obj);
126 
131 
132 }
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Slot for setting draw of origin.
136 
138 {
140  Update();
141 }
142 
143 ////////////////////////////////////////////////////////////////////////////////
144 /// Slot for setting draw of center.
145 
147 {
149  Update();
150 }
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 /// Slot for setting tick-mark step mode.
154 
156 {
158  fM->SetLabMode(em);
159  Update();
160 }
161 
162 ////////////////////////////////////////////////////////////////////////////////
163 /// Slot for setting number of axes.
164 
166 {
168  fM->SetAxesMode(em);
169  Update();
170 }
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1419
void SetAxesMode(EAxesMode x)
void SetDrawCenter(Bool_t x)
void SetLabMode(ELabMode x)
GUI editor for TEveProjectionAxes.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
void DoAxesMode(Int_t type)
Slot for setting number of axes.
Bool_t GetDrawCenter() const
int Int_t
Definition: RtypesCore.h:41
Axes for non-linear projections.
UInt_t GetWidth() const
Definition: TGFrame.h:271
ULong_t Pixel_t
Definition: GuiTypes.h:39
you should not use this method at all Int_t Int_t Double_t Double_t em
Definition: TRolke.cxx:630
ELabMode GetLabMode() const
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:443
TGCompositeFrame(const TGCompositeFrame &)
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by &#39;owner&#39; in extra tab &#39;name&#39;.
Definition: TGedFrame.cxx:123
void DoLabMode(Int_t type)
Slot for setting tick-mark step mode.
virtual Bool_t IsOn() const
Definition: TGButton.h:311
Bool_t GetDrawOrigin() const
EAxesMode GetAxesMode() const
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:867
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:92
void SetDrawOrigin(Bool_t x)
#define ClassImp(name)
Definition: Rtypes.h:336
double f(double x)
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
void DoDrawCenter()
Slot for setting draw of center.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
Mother of all ROOT objects.
Definition: TObject.h:37
void DoDrawOrigin()
Slot for setting draw of origin.
virtual void SetModel(TObject *obj)
Set model object.
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1200
TEveProjectionAxesEditor(const TEveProjectionAxesEditor &)
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96