|
ROOT
Reference Guide |
|
Go to the documentation of this file.
154 fClickSelectedPad = 0;
164 const char *defcanvas =
gROOT->GetDefCanvasName();
168 if (lc->FindObject(defcanvas)) {
169 Int_t n = lc->GetSize()+1;
170 while (lc->FindObject(
Form(
"%s_n%d",defcanvas,
n)))
n++;
175 Constructor(cdef, cdef, 1);
283 static Int_t ww = 500;
284 static Int_t wh = 500;
285 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title; arr[4] =&ww; arr[5] = &wh;
301 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
304 if (
gROOT->IsBatch()) {
320 if (form < 1 || form > 5) form = 1;
385 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title; arr[4] =&ww; arr[5] = &wh;
396 Error(
"Constructor",
"Invalid canvas height: %d",wh);
404 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
407 if (
gROOT->IsBatch()) {
451 :
TPad(), fDoubleBuffer(0)
474 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title;
475 arr[4] = &wtopx; arr[5] = &wtopy; arr[6] = &ww; arr[7] = &wh;
490 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
493 if (
gROOT->IsBatch()) {
597 }
else if (
IsWeb()) {
626 gROOT->GetListOfCanvases()->Add(
this);
742 while ((obj=next())) {
782 if (padsave) cansave = (
TCanvas*)
gPad->GetCanvas();
786 if ((!
gROOT->IsLineProcessing()) && (!
gVirtualX->IsCmdThread())) {
809 gROOT->GetListOfCanvases()->Remove(
this);
815 if (cansave ==
this) {
860 if (old) {
gROOT->GetListOfCanvases()->Remove(old);
delete old;}
870 if (
gROOT->IsBatch()) {
897 newCanvas->
Draw(option);
914 if (pad ==
this) pad = selpad;
915 if (padsav == 0 || pad == 0 || pad ==
this) {
946 while ((obj=next())) {
948 clone = obj->
Clone();
949 pad->GetListOfPrimitives()->Add(clone,next.
GetOption());
954 if (padsav) padsav->
cd();
966 const Int_t kTMAX=256;
967 static char atext[kTMAX];
980 snprintf(atext, kTMAX,
"%c", (
char) px);
982 snprintf(atext, kTMAX,
"%d,%d", px, py);
988 xaxis = ((
TH1*)selected)->GetXaxis();
990 xaxis = ((
TGraph*)selected)->GetXaxis();
992 xaxis = (
TAxis*)selected;
1005 if (lnF - idF == 21) {
1006 time_format = time_format(idF+2, lnF);
1104 if (
gROOT->GetEditorMode()) {
1152 if (padsav && padsav->
GetCanvas() ==
this) {
1162 if (padsav) padsav->
cd();
1178 if ((!
gROOT->IsLineProcessing()) && (!
gVirtualX->IsCmdThread())) {
1179 gInterpreter->Execute(
this, IsA(),
"UseCurrentStyle",
"");
1242 pad =
Pick(px, py, prevSelObj);
1284 pad =
Pick(px, py, prevSelObj);
1351 pad =
Pick(px, py, prevSelObj);
1368 while ((tc = (
TCanvas *)next()))
1395 pad =
Pick(px, py, prevSelObj);
1428 pad =
Pick(px, py, prevSelObj);
1445 pad =
Pick(px, py, prevSelObj);
1497 std::cout <<
"Canvas Name=" <<
GetName()<<
" Title="<<
GetTitle()<<
" Option="<<option<<std::endl;
1508 const char *defcanvas =
gROOT->GetDefCanvasName();
1511 auto lc = (
TList*)
gROOT->GetListOfCanvases();
1512 if (lc->FindObject(defcanvas)) {
1513 Int_t n = lc->GetSize() + 1;
1514 cdef =
new char[strlen(defcanvas)+15];
1516 strlcpy(cdef,
Form(
"%s_n%d", defcanvas,
n++),strlen(defcanvas)+15);
1517 }
while (lc->FindObject(cdef));
1523 ::Info(
"TCanvas::MakeDefCanvas",
" created default TCanvas with name %s",cdef);
1603 Emit(
"Picked(TPad*,TObject*,Int_t)", args);
1623 Emit(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)", args);
1635 Connect(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)", 0, 0, slot);
1649 Emit(
"Selected(TVirtualPad*,TObject*,Int_t)", args);
1664 Emit(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", args);
1674 if ((!
gROOT->IsLineProcessing()) && (!
gVirtualX->IsCmdThread())) {
1708 nww =
fCw; nwh = twh;
1720 nww =
fCw; nwh = twh;
1742 if (padsav) padsav->
cd();
1787 out<<
" gStyle->SetOptFit(1);"<<std::endl;
1790 out<<
" gStyle->SetOptStat(0);"<<std::endl;
1793 out<<
" gStyle->SetOptTitle(0);"<<std::endl;
1795 if (
gROOT->GetEditHistograms()) {
1796 out<<
" gROOT->SetEditHistograms();"<<std::endl;
1799 out<<
" "<<
GetName()<<
"->ToggleEventStatus();"<<std::endl;
1802 out<<
" "<<
GetName()<<
"->ToggleToolTips();"<<std::endl;
1805 out<<
" "<<
GetName()<<
"->ToggleToolBar();"<<std::endl;
1810 out<<
" "<<
GetName()<<
"->SetHighLightColor(ci);" << std::endl;
1833 while((cl = (
TClass*)next())) {
1839 Int_t lenfile = strlen(filename);
1842 const char *cname =
GetName();
1847 fname = (
char*)filename;
1848 out.open(fname, std::ios::out);
1850 Int_t nch = strlen(cname);
1852 strlcpy(lcname,cname,10);
1853 for (
Int_t k=1;k<=nch;k++) {
if (lcname[nch-k] ==
' ') lcname[nch-k] = 0;}
1854 if (lcname[0] == 0) {invalid =
kTRUE; strlcpy(lcname,
"c1",10); nch = 2;}
1857 fname =
new char[nch+3];
1858 strlcpy(fname,cname,nch+3);
1859 strncat(fname,
".C",3);
1860 out.open(fname, std::ios::out);
1863 Error(
"SaveSource",
"Cannot open file: %s",fname);
1864 if (!lenfile)
delete [] fname;
1870 out.precision(precision);
1878 Error(
"SaveSource",
"Cannot open TCanvas");
1903 if (!
first.IsDigit()) out <<
"void " << mname(
s,p-
s) <<
"()" << std::endl;
1905 out <<
"{"<<std::endl;
1906 out <<
"//=========Macro generated from canvas: "<<
GetName()<<
"/"<<
GetTitle()<<std::endl;
1907 out <<
"//========= ("<<t.
AsString()<<
") by ROOT version "<<
gROOT->GetVersion()<<std::endl;
1910 out <<std::endl<<
" gStyle->SetCanvasPreferGL(kTRUE);"<<std::endl<<std::endl;
1915 <<quote<<
", "<<quote<<
GetTitle()<<quote<<
","<<w<<
","<<
h<<
");"<<std::endl;
1918 out<<
" TCanvas *"<<cname<<
" = new TCanvas("<<quote<<
GetName()<<quote<<
", "<<quote<<
GetTitle()
1921 out<<
",-"<<topx<<
","<<topy<<
","<<w<<
","<<
h<<
");"<<std::endl;
1923 out<<
","<<topx<<
","<<topy<<
","<<w<<
","<<
h<<
");"<<std::endl;
1927 out<<
" gStyle->SetOptFit(1);"<<std::endl;
1930 out<<
" gStyle->SetOptStat(0);"<<std::endl;
1933 out<<
" gStyle->SetOptTitle(0);"<<std::endl;
1935 if (
gROOT->GetEditHistograms()) {
1936 out<<
" gROOT->SetEditHistograms();"<<std::endl;
1939 out<<
" "<<
GetName()<<
"->ToggleEventStatus();"<<std::endl;
1942 out<<
" "<<
GetName()<<
"->ToggleToolTips();"<<std::endl;
1947 out<<
" "<<
GetName()<<
"->SetHighLightColor(ci);" << std::endl;
1957 out<<
" "<<
GetName()<<
"->SetSelected("<<
GetName()<<
");"<<std::endl;
1959 out<<
" "<<
GetName()<<
"->ToggleToolBar();"<<std::endl;
1963 out <<
"}"<<std::endl;
1965 Info(
"SaveSource",
"C++ Macro file: %s has been generated", fname);
1969 while((cl = (
TClass*)next())) {
1972 if (!lenfile)
delete [] fname;
2041 Error(
"SetAspectRatio",
"cannot fix aspect ratio, height of canvas is 0");
2067 const char *defcanvas =
gROOT->GetDefCanvasName();
2069 auto lc = (
TList*)
gROOT->GetListOfCanvases();
2070 if (lc->FindObject(defcanvas)) {
2071 cdef =
Form(
"%s_n%d",defcanvas,lc->GetSize()+1);
2073 cdef =
Form(
"%s",defcanvas);
2124 Double_t ratio2 = xlength2/ylength2;
2133 }
else if (axis==2) {
2137 Error(
"SetRealAspectRatio",
"axis value %d is neither 1 (resize along x-axis) nor 2 (resize along y-axis).",axis);
2159 ratio2 = xlength2/ylength2;
2165 Error(
"SetRealAspectRatio",
"Resizing failed.");
2252 if (
b.IsReading()) {
2256 if (
v>7)
b.ClassBegin(TCanvas::IsA());
2257 if (
v>7)
b.ClassMember(
"TPad");
2265 while ((colold = (
TColor*)next())) {
2277 if (!colcur)
return;
2283 if (currentpalette) {
2284 TIter nextpal(currentpalette);
2292 delete currentpalette;
2299 if (
v>7)
b.ClassMember(
"fDISPLAY",
"TString");
2301 if (
v>7)
b.ClassMember(
"fDoubleBuffer",
"Int_t");
2303 if (
v>7)
b.ClassMember(
"fRetained",
"Bool_t");
2305 if (
v>7)
b.ClassMember(
"fXsizeUser",
"Size_t");
2307 if (
v>7)
b.ClassMember(
"fYsizeUser",
"Size_t");
2309 if (
v>7)
b.ClassMember(
"fXsizeReal",
"Size_t");
2311 if (
v>7)
b.ClassMember(
"fYsizeReal",
"Size_t");
2314 if (
v>7)
b.ClassMember(
"fWindowTopX",
"Int_t");
2316 if (
v>7)
b.ClassMember(
"fWindowTopY",
"Int_t");
2319 if (
v>7)
b.ClassMember(
"fWindowWidth",
"UInt_t");
2321 if (
v>7)
b.ClassMember(
"fWindowHeight",
"UInt_t");
2324 if (
v>7)
b.ClassMember(
"fCw",
"UInt_t");
2326 if (
v>7)
b.ClassMember(
"fCh",
"UInt_t");
2332 if (
v>7)
b.ClassMember(
"fCatt",
"TAttCanvas");
2335 if (
v>7)
b.ClassMember(
"kMoveOpaque",
"Bool_t");
2337 if (
v>7)
b.ClassMember(
"kResizeOpaque",
"Bool_t");
2339 if (
v>7)
b.ClassMember(
"fHighLightColor",
"Color_t");
2341 if (
v>7)
b.ClassMember(
"fBatch",
"Bool_t");
2344 if (
v>7)
b.ClassMember(
"kShowEventStatus",
"Bool_t");
2348 if (
v>7)
b.ClassMember(
"kAutoExec",
"Bool_t");
2351 if (
v>7)
b.ClassMember(
"kMenuBar",
"Bool_t");
2354 if (
v>7)
b.ClassEnd(TCanvas::IsA());
2355 b.CheckByteCount(R__s, R__c, TCanvas::IsA());
2372 CurrentColorPalette->
SetName(
"CurrentColorPalette");
2373 for (
Int_t i=0; i<palsize; i++) CurrentColorPalette->
Add(
gROOT->GetColor(pal[i]));
2377 R__c =
b.WriteVersion(TCanvas::IsA(),
kTRUE);
2378 b.ClassBegin(TCanvas::IsA());
2379 b.ClassMember(
"TPad");
2382 if (CurrentColorPalette) {
fPrimitives->
Remove(CurrentColorPalette);
delete CurrentColorPalette; }
2383 b.ClassMember(
"fDISPLAY",
"TString");
2385 b.ClassMember(
"fDoubleBuffer",
"Int_t");
2387 b.ClassMember(
"fRetained",
"Bool_t");
2389 b.ClassMember(
"fXsizeUser",
"Size_t");
2391 b.ClassMember(
"fYsizeUser",
"Size_t");
2393 b.ClassMember(
"fXsizeReal",
"Size_t");
2395 b.ClassMember(
"fYsizeReal",
"Size_t");
2401 b.ClassMember(
"fWindowTopX",
"Int_t");
2403 b.ClassMember(
"fWindowTopY",
"Int_t");
2405 b.ClassMember(
"fWindowWidth",
"UInt_t");
2407 b.ClassMember(
"fWindowHeight",
"UInt_t");
2409 b.ClassMember(
"fCw",
"UInt_t");
2411 b.ClassMember(
"fCh",
"UInt_t");
2413 b.ClassMember(
"fCatt",
"TAttCanvas");
2415 b.ClassMember(
"kMoveOpaque",
"Bool_t");
2417 b.ClassMember(
"kResizeOpaque",
"Bool_t");
2419 b.ClassMember(
"fHighLightColor",
"Color_t");
2421 b.ClassMember(
"fBatch",
"Bool_t");
2423 b.ClassMember(
"kShowEventStatus",
"Bool_t");
2425 b.ClassMember(
"kAutoExec",
"Bool_t");
2427 b.ClassMember(
"kMenuBar",
"Bool_t");
2429 b.ClassEnd(TCanvas::IsA());
2430 b.SetByteCount(R__c,
kTRUE);
2494 gPad->GetGLDevice() != -1);
2498 static_cast<TCanvas*
>(TheCanvas)->Update();
2510 static const union CastFromFuncToVoidPtr_t {
2512 void (*fFuncPtr)(
void*);
2514 } castFromFuncToVoidPtr;
2519 arr[2] = castFromFuncToVoidPtr.fVoidPtr;
2520 if ((*
gThreadXAR)(
"CUPD", 3, arr, 0))
return;
2597 Error(
"CreatePainter",
"GL Painter creation failed! Will use default!");
static Bool_t fgIsFolder
Indicates if canvas can be browsed as a folder.
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
@ kMustCleanup
if object destructor must call RecursiveRemove()
TAttCanvas fCatt
Canvas attributes.
void SetGrayscale(Bool_t set=kTRUE)
Set whether this canvas should be painted in grayscale, and re-paint it if necessary.
Bool_t fDrawn
! Set to True when the Draw method is called
Double_t fX2
X of upper X coordinate.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitives in this pad on the C++ source file out.
Class to manage histogram axis.
void CopyPixmaps() override
Copy the sub-pixmaps of the pad to the canvas.
Int_t fEventX
! Last X mouse position in canvas
void Clear(Option_t *option="") override
Remove all primitives from the canvas.
virtual void ShowToolBar(Bool_t show=kTRUE)
void SetTickx(Int_t value=1) override
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
Using a TBrowser one can browse all ROOT objects.
Manages default Pad attributes.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Size_t fXsizeReal
Current size of canvas along X in CM.
Bool_t fBatch
! True when in batchmode
virtual void ToggleAutoExec()
Toggle pad auto execution of list of TExecs.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
The most important graphics class in the ROOT system.
Bool_t HasMenuBar() const
virtual void SetWindowSize(UInt_t w, UInt_t h)
void Modified(Bool_t flag=1) override
Int_t GetLogy() const override
Double_t GetY1() const override
void CopyPixmaps() override
Copy the canvas pixmap of the pad to the canvas.
void DisconnectWidget()
Used by friend class TCanvasImp.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TCanvas * GetCanvas() const override
Int_t GetTicky() const override
Int_t GetCanvasBorderMode() const
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
void Close(Option_t *option="") override
Delete all primitives in pad and pad itself.
void SetTitle(const char *title="") override
Set canvas title.
char * Form(const char *fmt,...)
void Paint(Option_t *option="") override
Paint canvas.
Bool_t IsWeb() const
Is web canvas.
void ResizeOpaque(Int_t set=1)
Set option to resize objects/pads in a canvas.
void Close(Option_t *option="") override
Close canvas.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void InitializeGraphics()
Initialize the graphics environment.
Int_t GetCanvasDefH() const
virtual void EditorBar()
Get editor bar.
Double_t fAspectRatio
ratio of w/h in case of fixed ratio
Size_t fYsizeReal
Current size of canvas along Y in CM.
static Bool_t DefinedColors()
Static function returning kTRUE if some new colors have been defined after initialisation or since th...
Double_t fY2
Y of upper Y coordinate.
void CreatePainter()
Probably, TPadPainter must be placed in a separate ROOT module - "padpainter" (the same as "histpaint...
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its associated colors.
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
Generate kMouseEnter and kMouseLeave events depending on the previously selected object and the curre...
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
TVirtualPadPainter * fPainter
! Canvas (pad) painter.
static constexpr double s
Int_t fSelectedY
! Y of selected object
const char * AsString() const
Return the date & time as a string (ctime() format).
void SetCanvasBorderSize(Width_t size=1)
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
Bool_t fFixedAspectRatio
True if fixed aspect ratio.
TPad * fSelectedPad
! Pad containing currently selected object
void ls(Option_t *option="") const override
List all primitives in pad.
Float_t GetPadTopMargin() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Int_t GetEntries() const
Return the number of objects in array (i.e.
static void SetFolder(Bool_t isfolder=kTRUE)
If isfolder=kTRUE, the canvas can be browsed like a folder by default a canvas is not browsable.
Int_t fEventY
! Last Y mouse position in canvas
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Bool_t IsGrayscale()
Check whether this canvas is to be drawn in grayscale mode.
void PaintModified() override
Traverse pad hierarchy and (re)paint only modified pads.
void RunAutoExec()
Execute the list of TExecs in the current pad.
UInt_t GetWh() const override
Buffer base class used for serializing objects.
void SetFixedAspectRatio(Bool_t fixed=kTRUE) override
Fix canvas aspect ratio to current value if fixed is true.
Int_t GetLogz() const override
virtual Bool_t GetTimeDisplay() const
virtual const char * GetTitle() const
Returns title of object.
void SetLogz(Int_t value=1) override
Set Lin/Log scale for Z.
static void SaveColor(std::ostream &out, Int_t ci)
Save a color with index > 228 as a C++ statement(s) on output stream out.
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
Set the canvas scale in centimeters.
Int_t fCanvasID
! Canvas identifier
Color_t GetHighLightColor() const override
void UseCurrentStyle() override
Force a copy of current style for all objects in canvas.
UInt_t fCh
Height of the canvas along Y (pixels)
void Browse(TBrowser *b) override
Browse.
virtual UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h)
Option_t * GetOption() const
void UseCurrentStyle() override
Force a copy of current style for all objects in pad.
UInt_t fCw
Width of the canvas along X (pixels)
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
void Clear(Option_t *option="") override
Delete all pad primitives.
void SetBatch(Bool_t batch=kTRUE) override
Toggle batch mode.
Int_t GetPadTickY() const
virtual Bool_t IsWeb() const
void SetGridy(Int_t value=1) override
TPad * fPadSave
! Pointer to saved pad in HandleInput
TObject * fSelected
! Currently selected object
Double_t GetY2() const override
Int_t fGLDevice
! OpenGL off-screen pixmap identifier
void Constructor()
Canvas default constructor.
virtual void LockPainter()
Empty definition.
Int_t fDoubleBuffer
Double buffer flag (0=off, 1=on)
void HighLight(Color_t col=kRed, Bool_t set=kTRUE) override
Highlight pad.
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
Int_t GetLogx() const override
static const double x1[5]
Ssiz_t Last(char c) const
Find last occurrence of a character c.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
void Destructor()
Actual canvas destructor.
Bool_t GetCanvasPreferGL() const
Color_t GetCanvasColor() const
void Closed() override
Emit Closed signal.
void SetBorderSize(Short_t bordersize) override
void SetCursor(ECursor cursor) override
Set cursor.
void SetGridx(Int_t value=1) override
void SetDoubleBuffer(Int_t mode=1) override
Set Double Buffer On/Off.
virtual void ForceUpdate()
TString fDISPLAY
Name of destination screen.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
@ kNoContextMenu
if object does not want context menu
virtual const char * GetName() const
Returns name of object.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
Size_t fYsizeUser
User specified size of canvas along Y in CM.
TCanvas(const TCanvas &canvas)=delete
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Int_t GetCanvasDefX() const
void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Set world coordinate system for the pad.
Double_t fY1
Y of lower Y coordinate.
Float_t GetScreenFactor() const
static Bool_t SupportAlpha()
Static function returning "true" if transparency is supported.
Int_t GetCanvasDefY() const
virtual TObject * DrawClonePad()
Draw a clone of this canvas into the current pad In an interactive session, select the destination/cu...
void SetFillStyle(Style_t fstyle) override
Override TAttFill::FillStyle for TPad because we want to handle style=0 as style 4000.
virtual void Highlighted(TVirtualPad *pad, TObject *obj, Int_t x, Int_t y)
Emit Highlighted() signal.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
TVirtualPadPainter * GetCanvasPainter()
Access and (probably) creation of pad painter.
R__EXTERN TGuiFactory * gBatchGuiFactory
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
Color_t GetHighLightColor() const override
Get highlight color.
Double_t fX1
X of lower X coordinate.
void MoveOpaque(Int_t set=1)
Set option to move objects/pads in a canvas.
virtual void ProcessedEvent(Int_t event, Int_t x, Int_t y, TObject *selected)
Emit ProcessedEvent() signal.
Short_t GetBorderSize() const override
Bool_t GetShowToolTips() const
Bool_t GetShowToolBar() const
R__EXTERN TStyle * gStyle
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
void SetWindowPosition(Int_t x, Int_t y)
Set canvas window position.
The color creation and management class.
R__EXTERN TVirtualMutex * gROOTMutex
Int_t GetOptTitle() const
TList * fPrimitives
->List of primitives (subpads)
Bool_t GetShowEventStatus() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
TVirtualPad * GetSelectedPad() const override
Int_t GetPadTickX() const
Short_t fBorderMode
Bordermode (-1=down, 0 = no border, 1=up)
TList * GetListOfPrimitives() const override
virtual void ToggleToolBar()
Toggle toolbar.
TObject * fClickSelected
! Currently click-selected object
Double_t GetX2() const override
UInt_t fWindowWidth
Width of window (including borders, etc.)
void DrawEventStatus(Int_t event, Int_t x, Int_t y, TObject *selected)
Report name and title of primitive below the cursor.
void Paint(Option_t *option="") override
Paint all primitives in pad.
UInt_t GetWw() const override
Double_t GetTimeOffset() const
Implement TVirtualPadPainter which abstracts painting operations.
Short_t GetBorderMode() const override
virtual void ShowToolTips(Bool_t show=kTRUE)
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
const Size_t kDefaultCanvasSize
R__EXTERN TGuiFactory * gGuiFactory
virtual ~TCanvas()
Canvas destructor.
Int_t fSelectedX
! X of selected object
void SetBorderMode(Short_t bordermode) override
R__EXTERN TApplication * gApplication
char * StrDup(const char *str)
Duplicate the string str.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitives in this canvas in C++ macro file with GUI.
#define R__LOCKGUARD(mutex)
Short_t fBorderSize
pad bordersize in pixels
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual const char * GetTimeFormat() const
UInt_t GetWindowWidth() const
UInt_t GetWindowHeight() const
Int_t fWindowTopY
Top Y position of window (in pixels)
void SetTicky(Int_t value=1) override
void EmbedInto(Int_t winid, Int_t ww, Int_t wh)
Embedded a canvas into a TRootEmbeddedCanvas.
void SetName(const char *name="") override
Set canvas name. In case name is an empty string, a default name is set.
static TCanvasInit gCanvasInit
virtual void ShowEditor(Bool_t show=kTRUE)
void Init()
Initialize the TCanvas members. Called by all constructors.
virtual void ToggleToolTips()
Toggle tooltip display.
void SetSelected(TObject *obj) override
Set selected canvas.
Float_t GetPadLeftMargin() const
virtual Option_t * GetOption() const
Int_t fWindowTopX
Top X position of window (in pixels)
Bool_t GetPadGridY() const
void Iconify()
Iconify canvas.
virtual void ToggleEventStatus()
Toggle event statusbar.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SetStatusText(const char *text=0, Int_t partidx=0)
Size_t fXsizeUser
User specified size of canvas along X in CM.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
void PaintBorder(Color_t color, Bool_t tops)
Paint the pad border.
typedef void((*Func_t)())
void Build()
Build a canvas. Called by all constructors.
virtual void SetWindowPosition(Int_t x, Int_t y)
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Bool_t IsBatch() const override
TCanvasImp * fCanvasImp
! Window system specific canvas implementation
virtual void SetCanvasSize(UInt_t w, UInt_t h)
TContextMenu * fContextMenu
! Context menu pointer
TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj) override
Search for an object at pixel position px,py.
virtual Bool_t PerformUpdate()
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
static TCanvas * MakeDefCanvas()
Static function to build a default canvas.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
virtual TCanvasImp * CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
Create a batch version of TCanvasImp.
virtual Int_t InitWindow()
static TVirtualPadPainter * PadPainter(Option_t *opt="")
Create a pad painter of specified type.
virtual void Picked(TPad *selpad, TObject *selected, Int_t event)
Emit Picked() signal.
R__EXTERN TVirtualPS * gVirtualPS
TPad * fClickSelectedPad
! Pad containing currently click-selected object
Float_t GetPadRightMargin() const
void SetCanvasColor(Color_t color=19)
void ResizePad(Option_t *option="") override
Compute pad conversion coefficients.
Bool_t IsFolder() const override
Is folder ?
void SetCanvasBorderMode(Int_t mode=1)
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
A TGraph is an object made of two arrays X and Y with npoints each.
static void NeedGraphicsLibs()
Static method.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
void RaiseWindow()
Raise canvas window.
virtual void InitPainter()
Empty definition.
@ kNotDeleted
object has not been deleted
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, Float_t alpha=1.)
See TColor::SetPalette.
const char * GetTitle() const override
Returns title of object.
virtual void Copy(TAttPad &attpad) const
copy function
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void ROOT_TCanvas_Update(void *TheCanvas)
void ls(Option_t *option="") const override
List all pads.
void SetTicks(Int_t valuex=1, Int_t valuey=1) override
TClass instances represent classes, structs and namespaces in the ROOT type system.
Width_t GetCanvasBorderSize() const
void SetCanvasSize(UInt_t ww, UInt_t wh) override
Set Width and Height of canvas to ww and wh respectively.
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
void SetWindowSize(UInt_t ww, UInt_t wh)
Set canvas window size.
void SetName(const char *name)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void Add(TObject *obj)
TObject * GetObject() const
TObject * DrawClone(Option_t *option="") const override
Draw a clone of this canvas A new canvas is created that is a clone of this canvas.
Bool_t GetGridx() const override
Mother of all ROOT objects.
Int_t GetCanvasDefW() const
TH1 is the base class of all histogram classes in ROOT.
R__ALWAYS_INLINE Bool_t IsOnHeap() const
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
void CopyPixmap() override
Copy the pixmap of the pad to the canvas.
virtual void SetWindowTitle(const char *newTitle)
void ForceUpdate()
Force canvas update.
TCanvas * fCanvas
! Pointer to mother canvas
Bool_t fRetained
Retain structure flag.
virtual void Cleared(TVirtualPad *pad)
Emit pad Cleared signal.
static void CreateApplication()
UInt_t fWindowHeight
Height of window (including menubar, borders, etc.)
Bool_t GetPadGridX() const
void SetLogx(Int_t value=1) override
Set Lin/Log scale for X.
static const double x2[5]
virtual Color_t GetFillColor() const
Return the fill area color.
const char * GetName() const override
Returns name of object.
Bool_t GetGridy() const override
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
void Draw(Option_t *option="") override
Draw a canvas.
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
Int_t GetWindowTopX()
Returns current top x position of window on screen.
Fill Area Attributes class.
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
bool SetRealAspectRatio(const Int_t axis=1)
Function to resize a canvas so that the plot inside is shown in real aspect ratio.
Wrapper around a TObject so it can be stored in a TList.
virtual const char * GetName() const
Returns name of object.
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
R__EXTERN Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
Bool_t fUseGL
! True when rendering is with GL
Double_t GetX1() const override
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
void ToLower()
Change string to lower-case.
virtual void Pop()
Pop on object drawn in a pad to the top of the display list.
Int_t GetTickx() const override
virtual void ShowStatusBar(Bool_t show=kTRUE)
void DeleteCanvasPainter()
assert on IsBatch() == false?
void Flush()
Flush canvas buffers.
virtual void SelectDrawable(Int_t device)=0
Color_t fHighLightColor
Highlight color of active pad.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
void SetPad(const char *name, const char *title, Double_t xlow, Double_t ylow, Double_t xup, Double_t yup, Color_t color=35, Short_t bordersize=5, Short_t bordermode=-1) override
Set all pad parameters.
virtual TVirtualPadPainter * CreatePadPainter()
virtual void Clear(Option_t *="")
virtual void HighlightConnect(const char *slot)
This is "simplification" for function TCanvas::Connect with Highlighted signal for specific slot.
Bool_t fUpdating
! True when Updating the canvas
TPad * fMother
! pointer to mother of the list
void Update() override
Update canvas pad buffers.
Int_t fEvent
! Type of current or last handled event
virtual void RaiseWindow()
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
void SetLogy(Int_t value=1) override
Set Lin/Log scale for Y.
Array of integers (32 bits per element).
Int_t fPixmapID
! Off-screen pixmap identifier
Int_t GetWindowTopY()
Returns current top y position of window on screen.
virtual void ShowMenuBar(Bool_t show=kTRUE)
virtual void ToggleEditor()
Toggle editor.
Float_t GetPadBottomMargin() const
static const TArrayI & GetPalette()
Static function returning the current active palette.
TString fSelectedOpt
! Drawing option of selected object