12 #ifndef ROOT_TEveGValuators
13 #define ROOT_TEveGValuators
19 class TGDoubleHSlider;
21 class TEveGValuatorBase:
public TGCompositeFrame,
public TGWidget
23 TEveGValuatorBase(
const TEveGValuatorBase&);
24 TEveGValuatorBase& operator=(
const TEveGValuatorBase&);
37 TEveGValuatorBase(
const TGWindow *p,
const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
38 virtual ~TEveGValuatorBase() {}
40 virtual void Build(Bool_t connect=kTRUE) = 0;
42 void SetLabelWidth(Int_t w) { fLabelWidth = w; }
43 void SetAlignRight(Bool_t a) { fAlignRight = a; }
44 void SetShowSlider(Bool_t s=kTRUE) { fShowSlider = s; }
46 void SetNELength(Int_t l) { fNELength = l; }
47 void SetNEHeight(Int_t h) { fNEHeight = h; }
49 TGLabel* GetLabel() {
return fLabel;}
51 ClassDef(TEveGValuatorBase, 0);
57 class TEveGValuator:
public TEveGValuatorBase
59 TEveGValuator(
const TEveGValuator&);
60 TEveGValuator& operator=(
const TEveGValuator&);
67 Bool_t fSliderNewLine;
69 TGNumberEntry* fEntry;
72 Int_t CalcSliderPos(Float_t v);
75 TEveGValuator(
const TGWindow *p,
const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
76 virtual ~TEveGValuator() {}
78 virtual void Build(Bool_t connect=kTRUE);
80 Float_t GetValue()
const {
return fValue; }
81 virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
83 void SliderCallback();
85 void ValueSet(Double_t);
87 TGHSlider* GetSlider() {
return fSlider; }
88 TGNumberEntry* GetEntry() {
return fEntry; }
90 void SetSliderNewLine(Bool_t nl) { fSliderNewLine = nl; }
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,
97 TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
99 void SetToolTip(
const char* tip);
100 void SetEnabled(Bool_t state);
102 ClassDef(TEveGValuator, 0);
108 class TEveGDoubleValuator:
public TEveGValuatorBase
110 TEveGDoubleValuator(
const TEveGDoubleValuator&);
111 TEveGDoubleValuator& operator=(
const TEveGDoubleValuator&);
114 TGNumberEntry* fMinEntry;
115 TGNumberEntry* fMaxEntry;
116 TGDoubleHSlider* fSlider;
119 TEveGDoubleValuator(
const TGWindow *p,
const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
120 virtual ~TEveGDoubleValuator() {}
122 virtual void Build(Bool_t connect=kTRUE);
124 void MinEntryCallback();
125 void MaxEntryCallback();
126 void SliderCallback();
129 TGDoubleHSlider* GetSlider() {
return fSlider; }
130 TGNumberEntry* GetMinEntry() {
return fMinEntry; }
131 TGNumberEntry* GetMaxEntry() {
return fMaxEntry; }
133 void SetLimits(Int_t min, Int_t max);
134 void SetLimits(Float_t min, Float_t max, TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
135 void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE);
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(); }
144 ClassDef(TEveGDoubleValuator, 0);
150 class TEveGTriVecValuator :
public TGCompositeFrame,
public TGWidget
152 TEveGTriVecValuator(
const TEveGTriVecValuator&);
153 TEveGTriVecValuator& operator=(
const TEveGTriVecValuator&);
156 TEveGValuator* fVal[3];
164 TEveGTriVecValuator(
const TGWindow *p,
const char* name, UInt_t w, UInt_t h, Int_t widgetId=-1);
165 virtual ~TEveGTriVecValuator() {}
167 void Build(Bool_t vertical,
const char* lab0,
const char* lab1,
const char* lab2);
169 TEveGValuator* GetValuator(Int_t i)
const {
return fVal[i]; }
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); }
174 void GetValues(Float_t& v0, Float_t& v1, Float_t& v2)
const
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); }
181 void SetValues(Float_t v0, Float_t v1, Float_t v2)
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]); }
185 void SetValues(Double_t v[3])
186 { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
191 void SetLabelWidth(Int_t w) { fLabelWidth = w; }
192 void SetNELength(Int_t l) { fNELength = l; }
193 void SetNEHeight(Int_t h) { fNEHeight = h; }
195 void SetLimits(Int_t min, Int_t max);
196 void SetLimits(Float_t min, Float_t max,
197 TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
199 ClassDef(TEveGTriVecValuator, 0);