]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/RGValuators.h
Added method SortPathMarksByTime().
[u/mrichter/AliRoot.git] / EVE / Reve / RGValuators.h
1 // $Header$
2
3 #ifndef REVE_RGValuators_H
4 #define REVE_RGValuators_H
5
6 #include <TGNumberEntry.h>
7
8 class TGLabel;
9 class TGHSlider;
10 class TGDoubleHSlider;
11
12
13 namespace Reve {
14
15 class RGValuatorBase: public TGCompositeFrame
16 {
17   RGValuatorBase(const RGValuatorBase&);            // Not implemented
18   RGValuatorBase& operator=(const RGValuatorBase&); // Not implemented
19
20 protected:
21   UInt_t      fLabelWidth;
22   Bool_t      fAlignRight;
23   Bool_t      fShowSlider;
24
25   Int_t       fNELength; // Number-entry length (in characters)
26   Int_t       fNEHeight; // Number-entry height (in pixels)
27
28   TGLabel*    fLabel;
29
30 public:
31   RGValuatorBase(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
32   virtual ~RGValuatorBase() {}
33
34   virtual void Build(Bool_t connect=kTRUE) = 0;
35
36   void SetLabelWidth(Int_t w)        { fLabelWidth = w; }
37   void SetAlignRight(Bool_t a)       { fAlignRight = a; }
38   void SetShowSlider(Bool_t s=kTRUE) { fShowSlider = s; }
39
40   void SetNELength(Int_t l)          { fNELength = l; }
41   void SetNEHeight(Int_t h)          { fNEHeight = h; }
42
43   ClassDef(RGValuatorBase, 0);
44 }; // endclass RGValuatorBase
45
46 /**************************************************************************/
47
48 class RGValuator: public RGValuatorBase
49 {
50   RGValuator(const RGValuator&);            // Not implemented
51   RGValuator& operator=(const RGValuator&); // Not implemented
52
53 protected:
54   Float_t        fValue;
55   Float_t        fMin;
56   Float_t        fMax;
57
58   Bool_t         fSliderNewLine;
59   Int_t          fSliderDivs;
60   TGNumberEntry* fEntry;
61   TGHSlider*     fSlider;
62
63   Int_t CalcSliderPos(Float_t v);
64   
65 public:
66   RGValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
67   virtual ~RGValuator() {}
68
69   virtual void Build(Bool_t connect=kTRUE);
70   
71   Float_t GetValue() const { return fValue; }
72   virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
73
74   void SliderCallback();
75   void EntryCallback();
76   void ValueSet(Double_t); //*SIGNAL* 
77
78   TGHSlider*     GetSlider() { return fSlider; }
79   TGNumberEntry* GetEntry()  { return fEntry; }
80
81   void SetSliderNewLine(Bool_t nl) { fSliderNewLine = nl; }
82
83   void GetLimits(Float_t& min, Float_t& max) const { min = fMin; max = fMax; }
84   Float_t GetLimitMin() const { return fMin; }
85   Float_t GetLimitMax() const { return fMax; }
86   void SetLimits(Int_t min, Int_t max);
87   void SetLimits(Float_t min, Float_t max, Int_t npos,
88                  TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
89
90   void SetToolTip(const Text_t* tip);
91   void SetEnabled(Bool_t state);
92
93   ClassDef(RGValuator, 0);
94 }; // endclass RGValuator
95
96 /**************************************************************************/
97
98 class RGDoubleValuator: public RGValuatorBase
99 {
100   RGDoubleValuator(const RGDoubleValuator&);            // Not implemented
101   RGDoubleValuator& operator=(const RGDoubleValuator&); // Not implemented
102
103 protected:
104   TGNumberEntry*    fMinEntry;
105   TGNumberEntry*    fMaxEntry;
106   TGDoubleHSlider*  fSlider;
107   
108 public:
109   RGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
110   virtual ~RGDoubleValuator() {}
111
112   virtual void Build(Bool_t connect=kTRUE);
113  
114   void MinEntryCallback();
115   void MaxEntryCallback();
116   void SliderCallback();
117   void ValueSet(); //*SIGNAL* 
118
119   TGDoubleHSlider* GetSlider()   { return fSlider; }
120   TGNumberEntry*   GetMinEntry() { return fMinEntry; }
121   TGNumberEntry*   GetMaxEntry() { return fMaxEntry; }
122
123   void SetLimits(Int_t min, Int_t max);
124   void SetLimits(Float_t min, Float_t max, TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
125   void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE);
126
127   void GetValues(Float_t& min, Float_t& max) const
128   { min = fMinEntry->GetNumber(); max = fMaxEntry->GetNumber(); }
129   Float_t GetMin() const { return fMinEntry->GetNumber(); }
130   Float_t GetMax() const { return fMaxEntry->GetNumber(); }
131   Float_t GetLimitMin() const { return fMinEntry->GetNumMin(); }
132   Float_t GetLimitMax() const { return fMaxEntry->GetNumMax(); }
133
134   ClassDef(RGDoubleValuator, 0);
135 }; // endclass RGDoubleValuator
136
137 /**************************************************************************/
138
139 class RGTriVecValuator : public TGCompositeFrame
140 {
141   RGTriVecValuator(const RGTriVecValuator&);            // Not implemented
142   RGTriVecValuator& operator=(const RGTriVecValuator&); // Not implemented
143
144 protected:
145   RGValuator* fVal[3];
146
147   // Weed-size vars from RGValuator; copied.
148   UInt_t      fLabelWidth;
149   Int_t       fNELength; // Number-entry length (in characters)
150   Int_t       fNEHeight; // Number-entry height (in pixels)
151
152 public:
153   RGTriVecValuator(const TGWindow *p, const char* name, UInt_t w, UInt_t h);
154   virtual ~RGTriVecValuator();
155
156   void Build(Bool_t vertical, const char* lab0, const char* lab1, const char* lab2);
157
158   RGValuator* GetValuator(Int_t i) const { return fVal[i]; }
159
160   Float_t GetValue(Int_t i) const   { return fVal[i]->GetValue(); }
161   void SetValue(Int_t i, Float_t v) { fVal[i]->SetValue(v); }
162
163   void GetValues(Float_t& v0, Float_t& v1, Float_t& v2) const
164   { v0 = GetValue(0); v1 = GetValue(1); v2 = GetValue(2); }
165   void GetValues(Float_t v[3]) const
166   { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
167   void GetValues(Double_t v[3]) const
168   { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
169
170   void SetValues(Float_t v0, Float_t v1, Float_t v2)
171   { SetValue(0, v0); SetValue(1, v1); SetValue(2, v2); }
172   void SetValues(Float_t v[3])
173   { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
174   void SetValues(Double_t v[3])
175   { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
176
177   void ValueSet(); //*SIGNAL*
178   
179   // Weed-size vars from RGValuator; copied.
180   void SetLabelWidth(Int_t w) { fLabelWidth = w; }
181   void SetNELength(Int_t l)   { fNELength   = l; }
182   void SetNEHeight(Int_t h)   { fNEHeight   = h; }
183
184   void SetLimits(Int_t min, Int_t max);
185   void SetLimits(Float_t min, Float_t max,
186                  TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
187
188   ClassDef(RGTriVecValuator, 0)
189 };
190
191 }
192
193 #endif