Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
14Abstract 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",
54 if (h) {
55 if (h->LoadPlugin() == -1)
56 return nullptr;
57 return (TVirtualPadEditor*) h->ExecPlugin(1, gPad ? gPad->GetCanvas() : nullptr);
58 }
59
60 return nullptr;
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 = nullptr;
91}
92
93////////////////////////////////////////////////////////////////////////////////
94/// Show the global pad editor. Static method.
95
97{
98 if (!fgPadEditor) {
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 = nullptr;
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}
#define h(i)
Definition RSha256.hxx:106
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
Option_t Option_t TPoint TPoint angle
Option_t Option_t width
Option_t Option_t style
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:405
#define gPad
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
Abstract base class used by ROOT graphics editor.
static void UpdateFillAttributes(Int_t col, Int_t sty)
Update fill attributes via the pad editor.
static void HideEditor()
Hide the pad editor. Static method.
static void UpdateLineAttributes(Int_t col, Int_t sty, Int_t width)
Update line attributes via the pad editor.
virtual void FillAttributes(Int_t, Int_t)
virtual void LineAttributes(Int_t, Int_t, Int_t)
static void UpdateMarkerAttributes(Int_t col, Int_t sty, Float_t msiz)
Update marker attributes via the pad editor.
static TVirtualPadEditor * LoadEditor()
Static function returning a pointer to a new pad editor.
static TVirtualPadEditor * fgPadEditor
static void SetPadEditorName(const char *name)
Set type of default pad editor. Static method.
virtual void Hide()
static void ShowEditor()
Show the global pad editor. Static method.
TVirtualPadEditor()
Virtual editor ctor.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
virtual void TextAttributes(Int_t, Float_t, Int_t, Int_t, Float_t)
virtual ~TVirtualPadEditor()
Virtual editor dtor.
virtual void SetGlobal(Bool_t)
virtual void Show()
virtual void MarkerAttributes(Int_t, Int_t, Float_t)
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.
static TString fgEditorName
static const char * GetEditorName()
Returns the type of the default pad editor. Static method.
static void Terminate()
Close the global pad editor. Static method.