Logo ROOT  
Reference Guide
TVirtualPadEditor.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id: TVirtualPadEditor.cxx,v 1.0 2003/11/25
2 // Author: Ilka Antcheva 25/11/03
3 /*************************************************************************
4  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 /** \class TVirtualPadEditor
12 \ingroup Base
13 
14 Abstract base class used by ROOT graphics editor
15 */
16 
17 #include "TROOT.h"
18 #include "TVirtualPadEditor.h"
19 #include "TPluginManager.h"
20 #include "TEnv.h"
21 #include "TVirtualPad.h"
22 
25 
27 
28 ////////////////////////////////////////////////////////////////////////////////
29 /// Virtual editor ctor.
30 
32 {
33 }
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// Virtual editor dtor.
37 
39 {
40 }
41 
42 ////////////////////////////////////////////////////////////////////////////////
43 /// Static function returning a pointer to a new pad editor.
44 /// This pointer can be adopted by a TCanvas (i.e. TRootCanvas)
45 /// when it embeds the editor.
46 
48 {
50  if (fgEditorName.Length() == 0)
51  fgEditorName = gEnv->GetValue("Root.PadEditor","Ged");
52  h = gROOT->GetPluginManager()->FindHandler("TVirtualPadEditor",
53  fgEditorName);
54  if (h) {
55  if (h->LoadPlugin() == -1)
56  return 0;
57  return (TVirtualPadEditor*) h->ExecPlugin(1, gPad ? gPad->GetCanvas() : 0);
58  }
59 
60  return 0;
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Returns the type of the default pad editor. Static method.
65 
67 {
68  return fgEditorName;
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Returns the pad editor dialog. Static method.
73 
75 {
76  if (!fgPadEditor && load)
78 
79  return fgPadEditor;
80 }
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 /// Set type of default pad editor. Static method.
84 
86 {
87  if (fgEditorName == name) return;
88  delete fgPadEditor;
89  fgPadEditor = 0;
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Show the global pad editor. Static method.
95 
97 {
98  if (!fgPadEditor) {
99  GetPadEditor();
100  if (!fgPadEditor) return;
102  }
103  fgPadEditor->Show();
104 }
105 
106 ////////////////////////////////////////////////////////////////////////////////
107 /// Hide the pad editor. Static method.
108 
110 {
111  if (fgPadEditor)
112  fgPadEditor->Hide();
113 }
114 
115 ////////////////////////////////////////////////////////////////////////////////
116 /// Close the global pad editor. Static method.
117 
119 {
120  if (!fgPadEditor) return;
121 
122  delete fgPadEditor;
123  fgPadEditor = 0;
124 }
125 
126 ////////////////////////////////////////////////////////////////////////////////
127 /// Update fill attributes via the pad editor
128 
130 {
131  ShowEditor();
132 
133  if (fgPadEditor)
135 }
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 /// Update text attributes via the pad editor
139 
141  Int_t col, Int_t font, Float_t tsize)
142 {
143  ShowEditor();
144 
145  if (fgPadEditor)
146  fgPadEditor->TextAttributes(align, angle, col, font, tsize);
147 }
148 
149 ////////////////////////////////////////////////////////////////////////////////
150 /// Update line attributes via the pad editor
151 
153  Int_t width)
154 {
155  ShowEditor();
156 
157  if (fgPadEditor)
159 }
160 
161 ////////////////////////////////////////////////////////////////////////////////
162 /// Update marker attributes via the pad editor
163 
165  Float_t msize)
166 {
167  ShowEditor();
168 
169  if (fgPadEditor)
170  fgPadEditor->MarkerAttributes(color, style, msize);
171 }
TVirtualPadEditor::Terminate
static void Terminate()
Close the global pad editor. Static method.
Definition: TVirtualPadEditor.cxx:118
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TVirtualPadEditor::LoadEditor
static TVirtualPadEditor * LoadEditor()
Static function returning a pointer to a new pad editor.
Definition: TVirtualPadEditor.cxx:47
TVirtualPadEditor::TextAttributes
virtual void TextAttributes(Int_t, Float_t, Int_t, Int_t, Float_t)
Definition: TVirtualPadEditor.h:46
TVirtualPadEditor::SetPadEditorName
static void SetPadEditorName(const char *name)
Set type of default pad editor. Static method.
Definition: TVirtualPadEditor.cxx:85
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TVirtualPadEditor::TVirtualPadEditor
TVirtualPadEditor()
Virtual editor ctor.
Definition: TVirtualPadEditor.cxx:31
TEnv::GetValue
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:492
TVirtualPadEditor::Hide
virtual void Hide()
Definition: TVirtualPadEditor.h:50
TVirtualPadEditor::MarkerAttributes
virtual void MarkerAttributes(Int_t, Int_t, Float_t)
Definition: TVirtualPadEditor.h:45
TEnv.h
TVirtualPadEditor::UpdateTextAttributes
static void UpdateTextAttributes(Int_t align, Float_t angle, Int_t col, Int_t font, Float_t tsize)
Update text attributes via the pad editor.
Definition: TVirtualPadEditor.cxx:140
TString
Definition: TString.h:136
bool
TVirtualPadEditor::HideEditor
static void HideEditor()
Hide the pad editor. Static method.
Definition: TVirtualPadEditor.cxx:109
TVirtualPadEditor::GetPadEditor
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
Definition: TVirtualPadEditor.cxx:74
TROOT.h
style
TCanvas * style()
Definition: style.C:1
TPluginHandler
Definition: TPluginManager.h:101
TVirtualPadEditor.h
h
#define h(i)
Definition: RSha256.hxx:124
TVirtualPadEditor::fgPadEditor
static TVirtualPadEditor * fgPadEditor
Definition: TVirtualPadEditor.h:30
TVirtualPadEditor::Show
virtual void Show()
Definition: TVirtualPadEditor.h:49
TVirtualPad.h
TVirtualPadEditor::ShowEditor
static void ShowEditor()
Show the global pad editor. Static method.
Definition: TVirtualPadEditor.cxx:96
TVirtualPadEditor::UpdateFillAttributes
static void UpdateFillAttributes(Int_t col, Int_t sty)
Update fill attributes via the pad editor.
Definition: TVirtualPadEditor.cxx:129
TVirtualPadEditor::~TVirtualPadEditor
virtual ~TVirtualPadEditor()
Virtual editor dtor.
Definition: TVirtualPadEditor.cxx:38
TVirtualPadEditor::UpdateMarkerAttributes
static void UpdateMarkerAttributes(Int_t col, Int_t sty, Float_t msiz)
Update marker attributes via the pad editor.
Definition: TVirtualPadEditor.cxx:164
TVirtualPadEditor::fgEditorName
static TString fgEditorName
Definition: TVirtualPadEditor.h:31
TVirtualPadEditor::GetEditorName
static const char * GetEditorName()
Returns the type of the default pad editor. Static method.
Definition: TVirtualPadEditor.cxx:66
TVirtualPadEditor::LineAttributes
virtual void LineAttributes(Int_t, Int_t, Int_t)
Definition: TVirtualPadEditor.h:44
TVirtualPadEditor::UpdateLineAttributes
static void UpdateLineAttributes(Int_t col, Int_t sty, Int_t width)
Update line attributes via the pad editor.
Definition: TVirtualPadEditor.cxx:152
TPluginManager.h
name
char name[80]
Definition: TGX11.cxx:110
TVirtualPadEditor::FillAttributes
virtual void FillAttributes(Int_t, Int_t)
Definition: TVirtualPadEditor.h:43
gPad
#define gPad
Definition: TVirtualPad.h:287
TVirtualPadEditor
Definition: TVirtualPadEditor.h:27
TVirtualPadEditor::SetGlobal
virtual void SetGlobal(Bool_t)
Definition: TVirtualPadEditor.h:52
gROOT
#define gROOT
Definition: TROOT.h:406
int