Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17class TGLabel;
18class TGHSlider;
19class TGDoubleHSlider;
20
22{
23 TEveGValuatorBase(const TEveGValuatorBase&); // Not implemented
24 TEveGValuatorBase& operator=(const TEveGValuatorBase&); // Not implemented
25
26protected:
30
31 Int_t fNELength; // Number-entry length (in characters)
32 Int_t fNEHeight; // Number-entry height (in pixels)
33
35
36public:
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
45
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
62protected:
66
71
73
74public:
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
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
112
113protected:
117
118public:
119 TEveGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
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
154
155protected:
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
163public:
164 TEveGTriVecValuator(const TGWindow *p, const char* name, UInt_t w, UInt_t h, Int_t widgetId=-1);
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); }
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.
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
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
Composite GUI element for selection of range (label, two number-entries and double-slider).
TGNumberEntry * GetMinEntry()
void MinEntryCallback()
Callback for change in low number-entry.
Float_t GetMin() const
TGNumberEntry * fMaxEntry
virtual ~TEveGDoubleValuator()
void GetValues(Float_t &min, Float_t &max) const
TEveGDoubleValuator(const TEveGDoubleValuator &)
TGNumberEntry * GetMaxEntry()
TGDoubleHSlider * GetSlider()
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
Float_t GetLimitMin() const
void ValueSet()
Emit "ValueSet()" signal.
TGDoubleHSlider * fSlider
Float_t GetMax() const
void MaxEntryCallback()
Callback for change in high number-entry.
void SliderCallback()
Callback for change in slider position / width.
TEveGDoubleValuator & operator=(const TEveGDoubleValuator &)
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
TGNumberEntry * fMinEntry
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
Float_t GetLimitMax() const
Composite GUI element for setting three numerical values (label, three number-entries).
void SetValue(Int_t i, Float_t v)
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
TEveGValuator * fVal[3]
void ValueSet()
Emit "ValueSet()" signal.
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
void SetValues(Float_t v[3])
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
void SetValues(Float_t v0, Float_t v1, Float_t v2)
TEveGTriVecValuator(const TEveGTriVecValuator &)
virtual ~TEveGTriVecValuator()
void SetNELength(Int_t l)
void GetValues(Double_t v[3]) const
TEveGTriVecValuator & operator=(const TEveGTriVecValuator &)
void SetNEHeight(Int_t h)
void GetValues(Float_t v[3]) const
Float_t GetValue(Int_t i) const
void SetValues(Double_t v[3])
TEveGValuator * GetValuator(Int_t i) const
void SetLabelWidth(Int_t w)
Base class for composite GUI elements for setting of numeric values.
void SetLabelWidth(Int_t w)
TEveGValuatorBase & operator=(const TEveGValuatorBase &)
void SetNEHeight(Int_t h)
void SetAlignRight(Bool_t a)
void SetShowSlider(Bool_t s=kTRUE)
void SetNELength(Int_t l)
TGLabel * GetLabel()
virtual ~TEveGValuatorBase()
TEveGValuatorBase(const TEveGValuatorBase &)
virtual void Build(Bool_t connect=kTRUE)=0
Composite GUI element for single value selection (supports label, number-entry and slider).
TGNumberEntry * fEntry
TEveGValuator(const TEveGValuator &)
TEveGValuator & operator=(const TEveGValuator &)
void ValueSet(Double_t)
Emit "ValueSet(Double_t)" signal.
void SetEnabled(Bool_t state)
Set enabled state of the whole widget.
Int_t CalcSliderPos(Float_t v)
Return slider position for given value.
TGHSlider * fSlider
Float_t GetLimitMin() const
TGNumberEntry * GetEntry()
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
Bool_t fSliderNewLine
TGHSlider * GetSlider()
void GetLimits(Float_t &min, Float_t &max) const
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
void SliderCallback()
Callback for change in slider position.
void EntryCallback()
Callback for change in number-entry.
void SetSliderNewLine(Bool_t nl)
Float_t GetLimitMax() const
Float_t GetValue() const
virtual ~TEveGValuator()
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
Dragging the slider will generate the event:
Concrete class for horizontal slider.
Definition TGSlider.h:128
This class handles GUI labels.
Definition TGLabel.h:24
TGNumberEntry is a number entry input widget with up/down buttons.
virtual Double_t GetNumMax() const
virtual Double_t GetNumMin() const
virtual Double_t GetNumber() const
@ kNESRealTwo
Fixed fraction real, two digit.
The widget base class.
Definition TGWidget.h:43
ROOT GUI Window base class.
Definition TGWindow.h:23
auto * l
Definition textangle.C:4