Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveProjectionAxesEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 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 "TEveProjectionAxes.h"
14#include "TEveGValuators.h"
15
16#include "TGComboBox.h"
17#include "TGButton.h"
18#include "TGLabel.h"
19#include "TG3DLine.h"
20
21/** \class TEveProjectionAxesEditor
22\ingroup TEve
23GUI editor for TEveProjectionAxes.
24*/
25
27
28////////////////////////////////////////////////////////////////////////////////
29
31 UInt_t options, Pixel_t back) :
32 TGedFrame(p, width, height, options | kVerticalFrame, back),
33 fM(0),
34
35 fLabMode(0),
36 fAxesMode(0),
37
38 fCenterFrame(0),
39 fDrawCenter(0),
40 fDrawOrigin(0)
41{
42 // Constructor.
43
44 MakeTitle("TEveProjectionAxis");
45 Int_t labw=52;
46
47 {
49
50 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
51 labfr->AddFrame(new TGLabel(labfr, "Labels:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
52 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
53
54 fLabMode = new TGComboBox(f, "Position");
55 fLabMode->AddEntry("Value", 1);
56 fLabMode->AddEntry("Position", 0);
57 fLabMode->GetTextEntry()->SetToolTipText("Set tick-marks on equidistant values/screen position.");
59 lb->Resize(lb->GetWidth(), 2*18);
60 fLabMode->Resize(80, 20);
61 fLabMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoLabMode(Int_t)");
62 f->AddFrame(fLabMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
63 AddFrame(f);
64 }
65
66 {
68 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
69 labfr->AddFrame(new TGLabel(labfr, "Axes:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
70 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
71
72
73 fAxesMode = new TGComboBox(f, "All");
78 lb->Resize(lb->GetWidth(), 2*18);
79 fAxesMode->Resize(80, 20);
80 fAxesMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoAxesMode(Int_t)");
81 f->AddFrame(fAxesMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
82 AddFrame(f);
83 }
84
85 //______________________________________________________________________________
86
87 // center tab
89
90 TGCompositeFrame *title1 = new TGCompositeFrame(fCenterFrame, 180, 10,
95 title1->AddFrame(new TGLabel(title1, "Distortion Center"),
96 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
97 title1->AddFrame(new TGHorizontal3DLine(title1),
98 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
99 fCenterFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
100
101
102 {
103
105
106 fDrawOrigin = new TGCheckButton(hf1, "DrawOrigin");
107 hf1->AddFrame(fDrawOrigin, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
108 fDrawOrigin->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawOrigin()");
109
110
111 fDrawCenter = new TGCheckButton(hf1, "DrawCenter");
112 hf1->AddFrame(fDrawCenter, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
113 fDrawCenter->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawCenter()");
114
115 fCenterFrame->AddFrame(hf1, new TGLayoutHints(kLHintsTop, 0,0,0,0));
116
117 }
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Set model object.
122
124{
125 fM = dynamic_cast<TEveProjectionAxes*>(obj);
126
131
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Slot for setting draw of origin.
136
138{
140 Update();
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Slot for setting draw of center.
145
147{
149 Update();
150}
151
152////////////////////////////////////////////////////////////////////////////////
153/// Slot for setting tick-mark step mode.
154
156{
158 fM->SetLabMode(em);
159 Update();
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Slot for setting number of axes.
164
166{
168 fM->SetAxesMode(em);
169 Update();
170}
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedSize
Definition GuiTypes.h:390
@ kOwnBackground
Definition GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
const Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
GUI editor for TEveProjectionAxes.
void DoLabMode(Int_t type)
Slot for setting tick-mark step mode.
void DoAxesMode(Int_t type)
Slot for setting number of axes.
void DoDrawOrigin()
Slot for setting draw of origin.
void DoDrawCenter()
Slot for setting draw of center.
TEveProjectionAxesEditor(const TEveProjectionAxesEditor &)
virtual void SetModel(TObject *obj)
Set model object.
Axes for non-linear projections.
void SetDrawOrigin(Bool_t x)
void SetLabMode(ELabMode x)
Bool_t GetDrawOrigin() const
EAxesMode GetAxesMode() const
void SetAxesMode(EAxesMode x)
Bool_t GetDrawCenter() const
ELabMode GetLabMode() const
void SetDrawCenter(Bool_t x)
Selects different options.
Definition TGButton.h:264
virtual Bool_t IsOn() const
Definition TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:111
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual TGListBox * GetListBox() const
Definition TGComboBox.h:110
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:605
UInt_t GetWidth() const
Definition TGFrame.h:224
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:386
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:95
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:72
Mother of all ROOT objects.
Definition TObject.h:41
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:869