Logo ROOT  
Reference Guide
TEveGridStepperEditor.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 "TEveGridStepper.h"
14#include "TEveGValuators.h"
15
16#include "TVirtualPad.h"
17#include "TColor.h"
18
19#include "TGLabel.h"
20#include "TGSlider.h"
21#include "TGButton.h"
22#include "TGNumberEntry.h"
23
24/** \class TEveGridStepperSubEditor
25\ingroup TEve
26Sub-editor for TEveGridStepper class.
27*/
28
30
31////////////////////////////////////////////////////////////////////////////////
32/// Constructor.
33
36 fM (0),
37 fNx(0), fNy(0), fNz(0),
38 fDx(0), fDy(0), fDz(0)
39{
40 Int_t labelW = 15;
41
43
44 {
45 TGGroupFrame* f = new TGGroupFrame(hf, "NumRows", kVerticalFrame);
46 f->SetWidth(30);
47 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
48
49 fNx = new TEveGValuator(f,"X:", 200, 0);
50 fNx->SetNELength(3);
51 fNx->SetLabelWidth(labelW);
53 fNx->Build();
54 fNx->SetLimits(1, 15);
55 fNx->Connect("ValueSet(Double_t)",
56 "TEveGridStepperSubEditor", this, "DoNs()");
57 f->AddFrame(fNx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
58
59 fNy = new TEveGValuator(f,"Y:", 200, 0);
60 fNy->SetNELength(3);
61 fNy->SetLabelWidth(labelW);
63 fNy->Build();
64 fNy->SetLimits(1, 15);
65 fNy->Connect("ValueSet(Double_t)",
66 "TEveGridStepperSubEditor", this, "DoNs()");
67 f->AddFrame(fNy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
68
69 fNz = new TEveGValuator(f,"Z:", 200, 0);
70 fNz->SetNELength(3);
71 fNz->SetLabelWidth(labelW);
73 fNz->Build();
74 fNz->SetLimits(1, 15);
75 fNz->Connect("ValueSet(Double_t)",
76 "TEveGridStepperSubEditor", this, "DoNs()");
77 f->AddFrame(fNz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
78
79 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
80 }
81 {
82 TGGroupFrame* f = new TGGroupFrame(hf, "Step", kVerticalFrame);
83 f->SetWidth(130);
84 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
85
86 fDx = new TEveGValuator(f,"X:", 200, 0);
87 fDx->SetNELength(5);
88 fDx->SetLabelWidth(labelW);
90 fDx->Build();
92 fDx->Connect("ValueSet(Double_t)",
93 "TEveGridStepperSubEditor", this, "DoDs()");
94 f->AddFrame(fDx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
95
96 fDy = new TEveGValuator(f,"Y:", 200, 0);
97 fDy->SetNELength(5);
98 fDy->SetLabelWidth(labelW);
100 fDy->Build();
102 fDy->Connect("ValueSet(Double_t)",
103 "TEveGridStepperSubEditor", this, "DoDs()");
104 f->AddFrame(fDy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
105
106 fDz = new TEveGValuator(f,"Z:", 200, 0);
107 fDz->SetNELength(5);
108 fDz->SetLabelWidth(labelW);
110 fDz->Build();
112 fDz->Connect("ValueSet(Double_t)",
113 "TEveGridStepperSubEditor", this, "DoDs()");
114 f->AddFrame(fDz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
115
116 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
117 }
118 AddFrame(hf, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
119}
120
121////////////////////////////////////////////////////////////////////////////////
122/// Set model object.
123
125{
126 fM = m;
127
128 fNx->SetValue(fM->fNx);
129 fNy->SetValue(fM->fNy);
130 fNz->SetValue(fM->fNz);
131
132 fDx->SetValue(fM->fDx);
133 fDy->SetValue(fM->fDy);
134 fDz->SetValue(fM->fDz);
135}
136
137////////////////////////////////////////////////////////////////////////////////
138/// Emit Changed signal.
139
141{
142 Emit("Changed()");
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Slot for changing fN's.
147
149{
151 Changed();
152}
153
154////////////////////////////////////////////////////////////////////////////////
155/// Slot for changing fD's.
156
158{
160 Changed();
161}
162
163/** \class TEveGridStepperEditor
164\ingroup TEve
165Editor for TEveGridStepper class.
166*/
167
169
170////////////////////////////////////////////////////////////////////////////////
171/// Constructor.
172
174 UInt_t options, Pixel_t back) :
175 TGedFrame(p, width, height, options | kVerticalFrame, back),
176 fM (0),
177 fSE (0)
178{
179 MakeTitle("TEveGridStepper");
180
181 fSE = new TEveGridStepperSubEditor(this);
182 AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
183 fSE->Connect("Changed()", "TEveGridStepperEditor", this, "Update()");
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Set model object.
188
190{
191 fM = dynamic_cast<TEveGridStepper*>(obj);
192 fSE->SetModel(fM);
193}
@ kVerticalFrame
Definition: GuiTypes.h:381
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
const Bool_t kFALSE
Definition: RtypesCore.h:90
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
void SetLabelWidth(Int_t w)
void SetShowSlider(Bool_t s=kTRUE)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Float_t GetValue() const
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
Editor for TEveGridStepper class.
virtual void SetModel(TObject *obj)
Set model object.
TEveGridStepperSubEditor * fSE
TEveGridStepperEditor(const TEveGridStepperEditor &)
Sub-editor for TEveGridStepper class.
void Changed()
Emit Changed signal.
void DoNs()
Slot for changing fN's.
void DoDs()
Slot for changing fD's.
TEveGridStepperSubEditor(const TEveGridStepperSubEditor &)
void SetModel(TEveGridStepper *m)
Set model object.
Provide discrete position coordinates for placement of objects on regular grids.
void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
void SetNs(Int_t nx, Int_t ny, Int_t nz=1)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
Mother of all ROOT objects.
Definition: TObject.h:37
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
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:866
auto * m
Definition: textangle.C:8