3 #ifndef REVE_RGValuators_H
4 #define REVE_RGValuators_H
6 #include <TGNumberEntry.h>
10 class TGDoubleHSlider;
15 class RGValuatorBase: public TGCompositeFrame
28 RGValuatorBase(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
29 virtual ~RGValuatorBase() {}
31 virtual void Build() = 0;
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; }
37 void SetNELength(Int_t l) { fNELength = l; }
38 void SetNEGeight(Int_t h) { fNEHeight = h; }
40 ClassDef(RGValuatorBase, 0);
41 }; // endclass RGValuatorBase
43 /**************************************************************************/
45 class RGValuator: public RGValuatorBase
52 Bool_t fSliderNewLine;
54 TGNumberEntry* fEntry;
58 RGValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
59 virtual ~RGValuator() {}
63 Float_t GetValue() const { return fValue; }
64 virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
66 void SliderCallback();
68 void ValueSet(Double_t); //*SIGNAL*
70 TGHSlider* GetSlider() { return fSlider; }
71 TGNumberEntry* GetEntry() { return fEntry; }
73 void SetSliderNewLine(Bool_t nl) { fSliderNewLine = nl; }
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);
79 void SetToolTip(const Text_t* tip);
80 void SetEnabled(Bool_t state);
82 ClassDef(RGValuator, 0);
83 }; // endclass RGValuator
85 /**************************************************************************/
87 class RGDoubleValuator: public RGValuatorBase
90 TGNumberEntry* fMinEntry;
91 TGNumberEntry* fMaxEntry;
92 TGDoubleHSlider* fSlider;
95 RGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h);
96 virtual ~RGDoubleValuator() {}
100 void MinEntryCallback();
101 void MaxEntryCallback();
102 void SliderCallback();
103 void ValueSet(); //*SIGNAL*
105 TGDoubleHSlider* GetSlider() { return fSlider; }
106 TGNumberEntry* GetMinEntry() { return fMinEntry; }
107 TGNumberEntry* GetMaxEntry() { return fMaxEntry; }
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);
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(); }
117 ClassDef(RGDoubleValuator, 0);
118 }; // endclass RGDoubleValuator