Added method RGValuator::SetEnabled().
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Jun 2006 18:12:25 +0000 (18:12 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Jun 2006 18:12:25 +0000 (18:12 +0000)
EVE/Reve/RGValuators.cxx
EVE/Reve/RGValuators.h

index 56e3e66b1555be91d64123638a5418953a79a71e..e32ebb2e8a3b18be2d157f30d047906551aa4b99 100644 (file)
@@ -88,7 +88,7 @@ void RGValuator::Build()
   }
 
   // entry
-  TGLayoutHints*  elh =  new TGLayoutHints(kLHintsLeft, 1,0,0,0);
+  TGLayoutHints*  elh =  new TGLayoutHints(kLHintsLeft, 0,0,0,0);
   fEntry = new TGNumberEntry(hf1, 0, fNELength);
   fEntry->SetHeight(fNEHeight);
   fEntry->GetNumberEntry()->SetToolTipText("Enter Slider Value");
@@ -187,6 +187,17 @@ void RGValuator::SetToolTip(const Text_t* tip)
   fEntry->GetNumberEntry()->SetToolTipText(tip);
 }
 
+void RGValuator::SetEnabled(Bool_t state)
+{
+  fEntry->GetNumberEntry()->SetEnabled(state);
+  fEntry->GetButtonUp()->SetEnabled(state);
+  fEntry->GetButtonDown()->SetEnabled(state);
+  if(fSlider) {
+    if(state) fSlider->MapWindow();
+    else      fSlider->UnmapWindow();
+  }
+}
+
 /**************************************************************************/
 // RGDoubleValuator
 /**************************************************************************/
@@ -242,7 +253,7 @@ void RGDoubleValuator::Build()
   fMinEntry = new TGNumberEntry(this, 0, fNELength);
   fMinEntry->SetHeight(fNEHeight);
   fMinEntry->GetNumberEntry()->SetToolTipText("Enter Slider Min Value");
-  hf1->AddFrame(fMinEntry, new TGLayoutHints(kLHintsLeft, 1,0,0,0));
+  hf1->AddFrame(fMinEntry, new TGLayoutHints(kLHintsLeft, 0,0,0,0));
   fMinEntry->Connect("ValueSet(Long_t)",
                     "Reve::RGDoubleValuator", this, "MinEntryCallback()");
   fMinEntry->Associate(this);   
index 5216aaebc6f412f45aa3b0f89a46b9f43a5c6fd2..9e72cb6ab6ffade45ad7d058d80c6c11de566a91 100644 (file)
@@ -77,6 +77,7 @@ public:
                 TGNumberFormat::EStyle nef=TGNumberFormat::kNESRealTwo);
 
   void SetToolTip(const Text_t* tip);
+  void SetEnabled(Bool_t state);
 
   ClassDef(RGValuator, 0);
 }; // endclass RGValuator