Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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
13#include "TEveViewer.h"
14#include "TEveGValuators.h"
15
16/** \class TEveViewerListEditor
17\ingroup TEve
18GUI editor for TEveViewerList.
19*/
20
21
22////////////////////////////////////////////////////////////////////////////////
23/// Constructor.
24
26 UInt_t options, Pixel_t back) :
27 TGedFrame(p, width, height, options | kVerticalFrame, back),
28 fM(nullptr),
29
30 fBrightness(nullptr),
31 fColorSet(nullptr)
32{
33 MakeTitle("TEveViewerList");
34
35 Int_t labelW = 63;
36 fBrightness = new TEveGValuator(this, "Brightness:", 90, 0);
37 fBrightness->SetLabelWidth(labelW);
38 fBrightness->SetNELength(4);
39 fBrightness->Build();
40 fBrightness->SetLimits(-2, 2 , 41 , TGNumberFormat::kNESRealTwo);
41 fBrightness->Connect("ValueSet(Double_t)", "TEveViewerListEditor", this, "DoBrightness()");
43
44 fColorSet = new TGTextButton(this , "Switch ColorSet");
45 fColorSet->Connect("Clicked()", "TEveViewerListEditor", this, "SwitchColorSet()");
47}
48
49////////////////////////////////////////////////////////////////////////////////
50/// Set model object.
51
53{
54 fM = dynamic_cast<TEveViewerList*>(obj);
55
56 fBrightness->SetValue(fM->GetColorBrightness());
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// Slot for brightness.
61
63{
64 fColorSet->SetText(fM->UseLightColorSet()?"DarkColorSet": "Light ColorSet");
65 fM->SetColorBrightness(fBrightness->GetValue());
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Slot for color set.
70
72{
73 fColorSet->SetText(fM->UseLightColorSet()? "Light ColorSet":"Dark ColorSet");
74 fM->SwitchColorSet();
75}
@ kVerticalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetModel(TObject *obj) override
Set model object.
TEveViewerListEditor(const TEveViewerListEditor &)
void SwitchColorSet()
Slot for color set.
void DoBrightness()
Slot for brightness.
List of Viewers providing common operations on TEveViewer collections.
Definition TEveViewer.h:80
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
@ kNESRealTwo
Fixed fraction real, two digit.
Yield an action as soon as it is clicked.
Definition TGButton.h:142
ROOT GUI Window base class.
Definition TGWindow.h:23
TGedFrame(const TGedFrame &)=delete
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:94
Mother of all ROOT objects.
Definition TObject.h:42