Added method RGValuator::SetEnabled().
[u/mrichter/AliRoot.git] / EVE / Reve / RGValuators.h
CommitLineData
5987168b 1// $Header$
2
3#ifndef REVE_RGValuators_H
4#define REVE_RGValuators_H
5
6#include <TGNumberEntry.h>
7
8class TGLabel;
9class TGHSlider;
10class TGDoubleHSlider;
11
12
13namespace Reve {
14
15class RGValuatorBase: public TGCompositeFrame
16{
17protected:
18 UInt_t fLabelWidth;
19 Bool_t fAlignRight;
20 Bool_t fShowSlider;
21
22 Int_t fNELength;
23 Int_t fNEHeight;
24
25 TGLabel* fLabel;
26
27public:
28 RGValuatorBase(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
29 virtual ~RGValuatorBase() {}
30
31 virtual void Build() = 0;
32
33 void SetLabelWidth(Int_t w) { fLabelWidth = w; }
34 void SetAlignRight(Bool_t a) { fAlignRight = a; }
35 void SetShowSlider(Bool_t s=kTRUE) { fShowSlider = s; }
36
37 void SetNELength(Int_t l) { fNELength = l; }
38 void SetNEGeight(Int_t h) { fNEHeight = h; }
39
40 ClassDef(RGValuatorBase, 0);
41}; // endclass RGValuatorBase
42
43/**************************************************************************/
44
45class RGValuator: public RGValuatorBase
46{
47protected:
48 Float_t fValue;
49 Float_t fMin;
50 Float_t fMax;
51
52 Bool_t fSliderNewLine;
53 Int_t fSliderSteps;
54 TGNumberEntry* fEntry;
55 TGHSlider* fSlider;
56
57public:
58 RGValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
59 virtual ~RGValuator() {}
60
61 virtual void Build();
62
63 Float_t GetValue() const { return fValue; }
64 virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
65
66 void SliderCallback();
67 void EntryCallback();
68 void ValueSet(Double_t); //*SIGNAL*
69
70 TGHSlider* GetSlider() { return fSlider; }
71 TGNumberEntry* GetEntry() { return fEntry; }
72
73 void SetSliderNewLine(Bool_t nl) { fSliderNewLine = nl; }
74
75 void SetLimits(Int_t min, Int_t max);
76 void SetLimits(Float_t min, Float_t max, Int_t nsteps,
77 TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
78
79 void SetToolTip(const Text_t* tip);
78cd2dc1 80 void SetEnabled(Bool_t state);
5987168b 81
82 ClassDef(RGValuator, 0);
83}; // endclass RGValuator
84
85/**************************************************************************/
86
87class RGDoubleValuator: public RGValuatorBase
88{
89protected:
90 TGNumberEntry* fMinEntry;
91 TGNumberEntry* fMaxEntry;
92 TGDoubleHSlider* fSlider;
93
94public:
95 RGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
96 virtual ~RGDoubleValuator() {}
97
98 virtual void Build();
99
100 void MinEntryCallback();
101 void MaxEntryCallback();
102 void SliderCallback();
103 void ValueSet(); //*SIGNAL*
104
105 TGDoubleHSlider* GetSlider() { return fSlider; }
106 TGNumberEntry* GetMinEntry() { return fMinEntry; }
107 TGNumberEntry* GetMaxEntry() { return fMaxEntry; }
108
109 void SetLimits(Float_t min, Float_t max, TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
110 void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE);
111
112 void GetValues(Float_t& min, Float_t& max) const
113 { min = fMinEntry->GetNumber(); max = fMaxEntry->GetNumber(); }
114 Float_t GetMin() const { return fMinEntry->GetNumber(); }
115 Float_t GetMax() const { return fMaxEntry->GetNumber(); }
116
117 ClassDef(RGDoubleValuator, 0);
118}; // endclass RGDoubleValuator
119
120}
121
122#endif