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
26
27////////////////////////////////////////////////////////////////////////////////
28/// Virtual editor ctor.
29
33
34////////////////////////////////////////////////////////////////////////////////
35/// Virtual editor dtor.
36
40
41////////////////////////////////////////////////////////////////////////////////
42/// Static function returning a pointer to a new pad editor.
43/// This pointer can be adopted by a TCanvas (i.e. TRootCanvas)
44/// when it embeds the editor.
45
47{
49 if (fgEditorName.Length() == 0)
50 fgEditorName = gEnv->GetValue("Root.PadEditor","Ged");
51 h = gROOT->GetPluginManager()->FindHandler("TVirtualPadEditor",
53 if (h) {
54 if (h->LoadPlugin() == -1)
55 return nullptr;
56 return (TVirtualPadEditor*) h->ExecPlugin(1, gPad ? gPad->GetCanvas() : nullptr);
57 }
58
59 return nullptr;
60}
61
62////////////////////////////////////////////////////////////////////////////////
63/// Returns the type of the default pad editor. Static method.
64
66{
67 return fgEditorName;
68}
69
70////////////////////////////////////////////////////////////////////////////////
71/// Returns the pad editor dialog. Static method.
72
80
81////////////////////////////////////////////////////////////////////////////////
82/// Set type of default pad editor. Static method.
83
85{
86 if (fgEditorName == name) return;
87 delete fgPadEditor;
88 fgPadEditor = nullptr;
90}
91
92////////////////////////////////////////////////////////////////////////////////
93/// Show the global pad editor. Static method.
94
96{
97 if (!fgPadEditor) {
99 if (!fgPadEditor) return;
100 fgPadEditor->SetGlobal(kTRUE);
101 }
102 fgPadEditor->Show();
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Hide the pad editor. Static method.
107
109{
110 if (fgPadEditor)
111 fgPadEditor->Hide();
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Close the global pad editor. Static method.
116
118{
119 if (!fgPadEditor) return;
120
121 delete fgPadEditor;
122 fgPadEditor = nullptr;
123}
124
125////////////////////////////////////////////////////////////////////////////////
126/// Update fill attributes via the pad editor
127
129{
130 ShowEditor();
131
132 if (fgPadEditor)
133 fgPadEditor->FillAttributes(color, style);
134}
135
136////////////////////////////////////////////////////////////////////////////////
137/// Update text attributes via the pad editor
138
140 Int_t col, Int_t font, Float_t tsize)
141{
142 ShowEditor();
143
144 if (fgPadEditor)
145 fgPadEditor->TextAttributes(align, angle, col, font, tsize);
146}
147
148////////////////////////////////////////////////////////////////////////////////
149/// Update line attributes via the pad editor
150
152 Int_t width)
153{
154 ShowEditor();
155
156 if (fgPadEditor)
157 fgPadEditor->LineAttributes(color, style, width);
158}
159
160////////////////////////////////////////////////////////////////////////////////
161/// Update marker attributes via the pad editor
162
165{
166 ShowEditor();
167
168 if (fgPadEditor)
169 fgPadEditor->MarkerAttributes(color, style, msize);
170}
#define h(i)
Definition RSha256.hxx:106
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
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:411
#define gPad
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:490
Basic string class.
Definition TString.h:138
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.
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.
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 ~TVirtualPadEditor()
Virtual editor dtor.
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.