17#include "TVirtualPad.h"
29 TNamed(name, title ? title :
"Go4 LabelPainter"),
47 SetTextColor(GetLineColor());
61 Double_t xrange = (gPad->GetUxmax()-gPad->GetUxmin());
62 Double_t yrange = (gPad->GetUymax()-gPad->GetUymin());
74 if (!gPad->GetListOfPrimitives()->FindObject(
fxLabel))
80 Double_t x0 = xrange/2;
81 Double_t y0 = yrange/2;
92 fxLabel->SetLineColor(GetLineColor());
102 gROOT->GetListOfCanvases()->RecursiveRemove(
fxLabel);
106 if(option.Contains(
"reset")) {
129 if(!gPad)
return nullptr;
131 Double_t x0 = x, y0 = y, xmax = 0, ymax = 0;
133 auto label =
new TGo4Label(x0,y0,xmax,ymax);
134 label->SetOwner(
this);
135 TAttText::Copy(*label);
136 TAttLine::Copy(*label);
137 TAttFill::Copy(*label);
162 Double_t xpmin = gPad->GetUxmin();
163 Double_t xpmax = gPad->GetUxmax();
164 Double_t ypmin = gPad->GetUymin();
165 Double_t ypmax = gPad->GetUymax();
166 Double_t dx = (xpmax - xpmin);
167 Double_t dy = (ypmax - ypmin);
170 xmax = gPad->XtoPad(xmin) + width;
171 ymax = gPad->YtoPad(ymin) + height;
172 xmax = gPad->PadtoX(xmax);
173 ymax = gPad->PadtoY(ymax);
207 TPaveText::Paint(opt);
219 TPaveText::ExecuteEvent(event,px,py);
220 if(event == kButton1Up) {
void Paint(Option_t *opt="") override
static const void * fxLastDeleted
set this to pointer of last deleted instance before
TObject * fxOwner
the owner of this connector line
Base class for painters providing a textlabel for additional information.
virtual void UnPaintLabel(Option_t *opt="")
Erase the label.
Double_t fdHeight
initial height relative to whole pad
Double_t fdX0
initial reference coordinates x
TGo4Label * fxLabel
the label
Double_t fdY0
initial reference coordinates y
Double_t GetLabelYlo()
Reference coordinate y of label box (lower left corner)
Double_t fdWidth
initial width relative to whole pad
Double_t GetLabelXup()
Reference coordinate x of label box (upper right corner)
void InitAttributes()
Initialize the label attributes.
Double_t GetLabelYup()
Reference coordinate y of label box (upper right corner)
virtual ~TGo4LabelPainter()
void LabelCoords(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax)
Evaluate coordinates for new label for given xmin, ymin with respect to pad size.
Bool_t CheckLabel()
Check if label is still existing.
TString fxCaption
Headline for the label.
Bool_t fbIsLabStreamed
Flag to handle streamed label from file correctly.
void SetCaption(const char *txt)
virtual void PaintLabel(Option_t *opt="")
Draw the label.
TGo4Label * CreateCurrentLabel(Double_t x, Double_t y)
Create Label at the window coords.
virtual void DisplayToFront(Option_t *opt="")
pop all components to the front of the pad
virtual void RePaintLabel(Option_t *opt="")
refresh painting of label with current attributes
Double_t GetLabelXlo()
Reference coordinate x of label box (lower left corner)
Text label that knows its author.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
static const void * fxLastDeleted
set this to pointer of last deleted instance before
void Paint(Option_t *opt="") override
TObject * fxOwner
the owner of this label