#include "TROOT.h"
#include "TVirtualPadEditor.h"
#include "TPluginManager.h"
#include "TEnv.h"
#include "TVirtualPad.h"
TVirtualPadEditor *TVirtualPadEditor::fgPadEditor = 0;
TString TVirtualPadEditor::fgEditorName = "";
ClassImp(TVirtualPadEditor)
TVirtualPadEditor::TVirtualPadEditor()
{
}
TVirtualPadEditor::~TVirtualPadEditor()
{
}
TVirtualPadEditor *TVirtualPadEditor::LoadEditor()
{
TPluginHandler *h;
if (fgEditorName.Length() == 0)
fgEditorName = gEnv->GetValue("Root.PadEditor","Ged");
h = gROOT->GetPluginManager()->FindHandler("TVirtualPadEditor",
fgEditorName);
if (h) {
if (h->LoadPlugin() == -1)
return 0;
return (TVirtualPadEditor*) h->ExecPlugin(1, gPad->GetCanvas());
}
return 0;
}
const char *TVirtualPadEditor::GetEditorName()
{
return fgEditorName;
}
TVirtualPadEditor *TVirtualPadEditor::GetPadEditor(Bool_t load)
{
if (!fgPadEditor && load)
fgPadEditor = LoadEditor();
return fgPadEditor;
}
void TVirtualPadEditor::SetPadEditorName(const char *name)
{
if (fgEditorName == name) return;
delete fgPadEditor;
fgPadEditor = 0;
fgEditorName = name;
}
void TVirtualPadEditor::ShowEditor()
{
if (!fgPadEditor) {
GetPadEditor();
fgPadEditor->SetGlobal(kTRUE);
}
fgPadEditor->Show();
}
void TVirtualPadEditor::HideEditor()
{
if (fgPadEditor)
fgPadEditor->Hide();
}
void TVirtualPadEditor::Terminate()
{
if (!fgPadEditor) return;
delete fgPadEditor;
fgPadEditor = 0;
}
void TVirtualPadEditor::UpdateFillAttributes(Int_t color, Int_t style)
{
ShowEditor();
fgPadEditor->FillAttributes(color, style);
}
void TVirtualPadEditor::UpdateTextAttributes(Int_t align, Float_t angle,
Int_t col, Int_t font, Float_t tsize)
{
ShowEditor();
fgPadEditor->TextAttributes(align, angle, col, font, tsize);
}
void TVirtualPadEditor::UpdateLineAttributes(Int_t color, Int_t style,
Int_t width)
{
ShowEditor();
fgPadEditor->LineAttributes(color, style, width);
}
void TVirtualPadEditor::UpdateMarkerAttributes(Int_t color, Int_t style,
Float_t msize)
{
ShowEditor();
fgPadEditor->MarkerAttributes(color, style, msize);
}
Last change: Wed Jun 25 08:54:57 2008
Last generated: 2008-06-25 08:54
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.