Logo ROOT   master
Reference Guide
TEveGValuators.h
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 
12 #ifndef ROOT_TEveGValuators
13 #define ROOT_TEveGValuators
14 
15 #include "TGNumberEntry.h"
16 
17 class TGLabel;
18 class TGHSlider;
19 class TGDoubleHSlider;
20 
22 {
23  TEveGValuatorBase(const TEveGValuatorBase&); // Not implemented
24  TEveGValuatorBase& operator=(const TEveGValuatorBase&); // Not implemented
25 
26 protected:
30 
31  Int_t fNELength; // Number-entry length (in characters)
32  Int_t fNEHeight; // Number-entry height (in pixels)
33 
35 
36 public:
37  TEveGValuatorBase(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
38  virtual ~TEveGValuatorBase() {}
39 
40  virtual void Build(Bool_t connect=kTRUE) = 0;
41 
42  void SetLabelWidth(Int_t w) { fLabelWidth = w; }
45 
46  void SetNELength(Int_t l) { fNELength = l; }
47  void SetNEHeight(Int_t h) { fNEHeight = h; }
48 
49  TGLabel* GetLabel() {return fLabel;}
50 
51  ClassDef(TEveGValuatorBase, 0); // Base class for composite GUI elements for setting of numeric values.
52 };
53 
54 
55 /******************************************************************************/
56 
58 {
59  TEveGValuator(const TEveGValuator&); // Not implemented
60  TEveGValuator& operator=(const TEveGValuator&); // Not implemented
61 
62 protected:
66 
71 
73 
74 public:
75  TEveGValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
76  virtual ~TEveGValuator() {}
77 
78  virtual void Build(Bool_t connect=kTRUE);
79 
80  Float_t GetValue() const { return fValue; }
81  virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
82 
83  void SliderCallback();
84  void EntryCallback();
85  void ValueSet(Double_t); //*SIGNAL*
86 
87  TGHSlider* GetSlider() { return fSlider; }
88  TGNumberEntry* GetEntry() { return fEntry; }
89 
91 
92  void GetLimits(Float_t& min, Float_t& max) const { min = fMin; max = fMax; }
93  Float_t GetLimitMin() const { return fMin; }
94  Float_t GetLimitMax() const { return fMax; }
95  void SetLimits(Int_t min, Int_t max);
96  void SetLimits(Float_t min, Float_t max, Int_t npos,
98 
99  void SetToolTip(const char* tip);
100  void SetEnabled(Bool_t state);
101 
102  ClassDef(TEveGValuator, 0); // Composite GUI element for single value selection (supports label, number-entry and slider).
103 };
104 
105 
106 /******************************************************************************/
107 
109 {
110  TEveGDoubleValuator(const TEveGDoubleValuator&); // Not implemented
111  TEveGDoubleValuator& operator=(const TEveGDoubleValuator&); // Not implemented
112 
113 protected:
117 
118 public:
119  TEveGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
120  virtual ~TEveGDoubleValuator() {}
121 
122  virtual void Build(Bool_t connect=kTRUE);
123 
124  void MinEntryCallback();
125  void MaxEntryCallback();
126  void SliderCallback();
127  void ValueSet(); //*SIGNAL*
128 
132 
133  void SetLimits(Int_t min, Int_t max);
135  void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE);
136 
137  void GetValues(Float_t& min, Float_t& max) const
138  { min = fMinEntry->GetNumber(); max = fMaxEntry->GetNumber(); }
139  Float_t GetMin() const { return fMinEntry->GetNumber(); }
140  Float_t GetMax() const { return fMaxEntry->GetNumber(); }
141  Float_t GetLimitMin() const { return fMinEntry->GetNumMin(); }
142  Float_t GetLimitMax() const { return fMaxEntry->GetNumMax(); }
143 
144  ClassDef(TEveGDoubleValuator, 0); // Composite GUI element for selection of range (label, two number-entries and double-slider).
145 };
146 
147 
148 /******************************************************************************/
149 
151 {
152  TEveGTriVecValuator(const TEveGTriVecValuator&); // Not implemented
153  TEveGTriVecValuator& operator=(const TEveGTriVecValuator&); // Not implemented
154 
155 protected:
157 
158  // Weed-size vars from TEveGValuator; copied.
160  Int_t fNELength; // Number-entry length (in characters)
161  Int_t fNEHeight; // Number-entry height (in pixels)
162 
163 public:
164  TEveGTriVecValuator(const TGWindow *p, const char* name, UInt_t w, UInt_t h, Int_t widgetId=-1);
165  virtual ~TEveGTriVecValuator() {}
166 
167  void Build(Bool_t vertical, const char* lab0, const char* lab1, const char* lab2);
168 
169  TEveGValuator* GetValuator(Int_t i) const { return fVal[i]; }
170 
171  Float_t GetValue(Int_t i) const { return fVal[i]->GetValue(); }
172  void SetValue(Int_t i, Float_t v) { fVal[i]->SetValue(v); }
173 
175  { v0 = GetValue(0); v1 = GetValue(1); v2 = GetValue(2); }
176  void GetValues(Float_t v[3]) const
177  { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
178  void GetValues(Double_t v[3]) const
179  { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
180 
182  { SetValue(0, v0); SetValue(1, v1); SetValue(2, v2); }
183  void SetValues(Float_t v[3])
184  { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
186  { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
187 
188  void ValueSet(); //*SIGNAL*
189 
190  // Weed-size vars from TEveGValuator; copied.
191  void SetLabelWidth(Int_t w) { fLabelWidth = w; }
194 
195  void SetLimits(Int_t min, Int_t max);
196  void SetLimits(Float_t min, Float_t max,
198 
199  ClassDef(TEveGTriVecValuator, 0); // Composite GUI element for setting three numerical values (label, three number-entries).
200 };
201 
202 #endif
void SetValue(Int_t i, Float_t v)
TGNumberEntry * GetEntry()
void SetLabelWidth(Int_t w)
Composite GUI element for setting three numerical values (label, three number-entries).
Float_t GetLimitMin() const
void GetValues(Float_t &min, Float_t &max) const
void MaxEntryCallback()
Callback for change in high number-entry.
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
void SetNELength(Int_t l)
void ValueSet()
Emit "ValueSet()" signal.
float Float_t
Definition: RtypesCore.h:55
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
unsigned int UInt_t
Definition: CPyCppyy.h:44
TGNumberEntry * GetMinEntry()
void SliderCallback()
Callback for change in slider position.
int Int_t
Definition: CPyCppyy.h:43
Float_t GetLimitMax() const
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
bool Bool_t
Definition: RtypesCore.h:61
virtual void Build(Bool_t connect=kTRUE)=0
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetAlignRight(Bool_t a)
TGNumberEntry * fEntry
TGDoubleHSlider * GetSlider()
TGNumberEntry * fMinEntry
Composite GUI element for single value selection (supports label, number-entry and slider)...
void SetSliderNewLine(Bool_t nl)
#define ClassDef(name, id)
Definition: Rtypes.h:322
TEveGValuator * fVal[3]
void SliderCallback()
Callback for change in slider position / width.
Float_t GetMax() const
void SetValues(Float_t v0, Float_t v1, Float_t v2)
TEveGValuator * GetValuator(Int_t i) const
TEveGTriVecValuator & operator=(const TEveGTriVecValuator &)
static constexpr double s
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
void GetLimits(Float_t &min, Float_t &max) const
void SetNEHeight(Int_t h)
void SetNEHeight(Int_t h)
virtual Double_t GetNumMin() const
TEveGDoubleValuator & operator=(const TEveGDoubleValuator &)
TEveGValuator(const TEveGValuator &)
virtual ~TEveGTriVecValuator()
void SetShowSlider(Bool_t s=kTRUE)
void ValueSet(Double_t)
Emit "ValueSet(Double_t)" signal.
virtual ~TEveGDoubleValuator()
Float_t GetLimitMax() const
void SetNELength(Int_t l)
auto * a
Definition: textangle.C:12
TGNumberEntry * fMaxEntry
void ValueSet()
Emit "ValueSet()" signal.
Base class for composite GUI elements for setting of numeric values.
virtual ~TEveGValuatorBase()
Float_t GetValue(Int_t i) const
virtual ~TEveGValuator()
void SetEnabled(Bool_t state)
Set enabled state of the whole widget.
TEveGValuatorBase(const TEveGValuatorBase &)
void SetValues(Double_t v[3])
#define h(i)
Definition: RSha256.hxx:106
void SetValues(Float_t v[3])
void GetValues(Double_t v[3]) const
const Bool_t kFALSE
Definition: RtypesCore.h:90
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
double Double_t
Definition: RtypesCore.h:57
TGHSlider * GetSlider()
virtual Double_t GetNumber() const
TGLabel * GetLabel()
TEveGValuatorBase & operator=(const TEveGValuatorBase &)
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
Float_t GetMin() const
auto * l
Definition: textangle.C:4
virtual Double_t GetNumMax() const
Int_t CalcSliderPos(Float_t v)
Return slider position for given value.
void EntryCallback()
Callback for change in number-entry.
void GetValues(Float_t v[3]) const
TGHSlider * fSlider
void SetLabelWidth(Int_t w)
TEveGDoubleValuator(const TEveGDoubleValuator &)
TGDoubleHSlider * fSlider
TEveGTriVecValuator(const TEveGTriVecValuator &)
Composite GUI element for selection of range (label, two number-entries and double-slider).
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
Float_t GetLimitMin() const
TEveGValuator & operator=(const TEveGValuator &)
Bool_t fSliderNewLine
const Bool_t kTRUE
Definition: RtypesCore.h:89
TGNumberEntry * GetMaxEntry()
char name[80]
Definition: TGX11.cxx:109
Float_t GetValue() const
void MinEntryCallback()
Callback for change in low number-entry.