Logo ROOT   6.08/07
Reference Guide
TEveViewerListEditor.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveViewerListEditor.h"
13 #include "TEveViewer.h"
14 #include "TEveGValuators.h"
15 
16 /** \class TEveViewerListEditor
17 \ingroup TEve
18 GUI editor for TEveViewerList.
19 */
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// Constructor.
25 
27  UInt_t options, Pixel_t back) :
28  TGedFrame(p, width, height, options | kVerticalFrame, back),
29  fM(0),
30 
31  fBrightness(0),
32  fColorSet(0)
33 {
34  MakeTitle("TEveViewerList");
35 
36  Int_t labelW = 63;
37  fBrightness = new TEveGValuator(this, "Brightness:", 90, 0);
38  fBrightness->SetLabelWidth(labelW);
40  fBrightness->Build();
42  fBrightness->Connect("ValueSet(Double_t)", "TEveViewerListEditor", this, "DoBrightness()");
43  AddFrame(fBrightness, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
44 
45  fColorSet = new TGTextButton(this , "Switch ColorSet");
46  fColorSet->Connect("Clicked()", "TEveViewerListEditor", this, "SwitchColorSet()");
47  AddFrame(fColorSet, new TGLayoutHints(kLHintsLeft, 2, 1, 4, 4));
48 }
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Set model object.
52 
54 {
55  fM = dynamic_cast<TEveViewerList*>(obj);
56 
58 }
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Slot for brightness.
62 
64 {
65  fColorSet->SetText(fM->UseLightColorSet()?"DarkColorSet": "Light ColorSet");
67 }
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Slot for color set.
71 
73 {
74  fColorSet->SetText(fM->UseLightColorSet()? "Light ColorSet":"Dark ColorSet");
75  fM->SwitchColorSet();
76 }
List of Viewers providing common operations on TEveViewer collections.
Definition: TEveViewer.h:79
TEveGValuator * fBrightness
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
void SetColorBrightness(Float_t b)
Set color brightness.
Definition: TEveViewer.cxx:650
int Int_t
Definition: RtypesCore.h:41
void DoBrightness()
Slot for brightness.
void SwitchColorSet()
Switch background color.
Definition: TEveViewer.cxx:658
Composite GUI element for single value selection (supports label, number-entry and slider)...
ULong_t Pixel_t
Definition: GuiTypes.h:41
GUI editor for TEveViewerList.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:1137
Float_t GetColorBrightness() const
Definition: TEveViewer.h:126
void SetNELength(Int_t l)
unsigned int UInt_t
Definition: RtypesCore.h:42
Bool_t UseLightColorSet() const
Definition: TEveViewer.h:129
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:594
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
#define ClassImp(name)
Definition: Rtypes.h:279
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
void SwitchColorSet()
Slot for color set.
Mother of all ROOT objects.
Definition: TObject.h:37
TEveViewerListEditor(const TEveViewerListEditor &)
void SetLabelWidth(Int_t w)
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
Float_t GetValue() const
virtual void SetModel(TObject *obj)
Set model object.