introduced TStyle in order to control the appearance in a better way
This commit is contained in:
parent
beba182172
commit
493825f78a
@ -50,6 +50,7 @@ PMusrCanvas::PMusrCanvas()
|
|||||||
fValid = false;
|
fValid = false;
|
||||||
fPlotNumber = -1;
|
fPlotNumber = -1;
|
||||||
|
|
||||||
|
fStyle = 0;
|
||||||
fMainCanvas = 0;
|
fMainCanvas = 0;
|
||||||
fTitlePad = 0;
|
fTitlePad = 0;
|
||||||
fDataTheoryPad = 0;
|
fDataTheoryPad = 0;
|
||||||
@ -67,6 +68,7 @@ PMusrCanvas::PMusrCanvas(const int number, const char* title,
|
|||||||
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) :
|
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh) :
|
||||||
fPlotNumber(number)
|
fPlotNumber(number)
|
||||||
{
|
{
|
||||||
|
CreateStyle();
|
||||||
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
|
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +83,7 @@ PMusrCanvas::PMusrCanvas(const int number, const char* title,
|
|||||||
const PIntVector markerList, const PIntVector colorList) :
|
const PIntVector markerList, const PIntVector colorList) :
|
||||||
fPlotNumber(number), fMarkerList(markerList), fColorList(colorList)
|
fPlotNumber(number), fMarkerList(markerList), fColorList(colorList)
|
||||||
{
|
{
|
||||||
|
CreateStyle();
|
||||||
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
|
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,6 +97,10 @@ PMusrCanvas::~PMusrCanvas()
|
|||||||
{
|
{
|
||||||
cout << "~PMusrCanvas() called" << endl;
|
cout << "~PMusrCanvas() called" << endl;
|
||||||
// cleanup
|
// cleanup
|
||||||
|
if (fStyle) {
|
||||||
|
delete fStyle;
|
||||||
|
fStyle = 0;
|
||||||
|
}
|
||||||
if (fTitlePad) {
|
if (fTitlePad) {
|
||||||
fTitlePad->Clear();
|
fTitlePad->Clear();
|
||||||
delete fTitlePad;
|
delete fTitlePad;
|
||||||
@ -124,6 +131,20 @@ cout << "~PMusrCanvas() called" << endl;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// CreateStyle
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p> Set styles for the canvas. Perhaps one could transfer them to the startup-file in the future.
|
||||||
|
*/
|
||||||
|
void PMusrCanvas::CreateStyle()
|
||||||
|
{
|
||||||
|
fStyle = new TStyle("musrStyle", "musrStyle");
|
||||||
|
fStyle->SetOptStat(0); // no statistics options
|
||||||
|
fStyle->SetOptTitle(0); // no title
|
||||||
|
fStyle->cd();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// InitMusrCanvas
|
// InitMusrCanvas
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <TObject.h>
|
#include <TObject.h>
|
||||||
#include <TQObject.h>
|
#include <TQObject.h>
|
||||||
|
#include <TStyle.h>
|
||||||
#include <TCanvas.h>
|
#include <TCanvas.h>
|
||||||
#include <TPaveText.h>
|
#include <TPaveText.h>
|
||||||
#include <TLegend.h>
|
#include <TLegend.h>
|
||||||
@ -112,6 +113,8 @@ class PMusrCanvas : public TObject, public TQObject
|
|||||||
Bool_t fValid;
|
Bool_t fValid;
|
||||||
Int_t fPlotNumber;
|
Int_t fPlotNumber;
|
||||||
|
|
||||||
|
TStyle *fStyle;
|
||||||
|
|
||||||
TCanvas *fMainCanvas;
|
TCanvas *fMainCanvas;
|
||||||
TPaveText *fTitlePad;
|
TPaveText *fTitlePad;
|
||||||
TPad *fDataTheoryPad;
|
TPad *fDataTheoryPad;
|
||||||
@ -128,6 +131,7 @@ class PMusrCanvas : public TObject, public TQObject
|
|||||||
PIntVector fMarkerList;
|
PIntVector fMarkerList;
|
||||||
PIntVector fColorList;
|
PIntVector fColorList;
|
||||||
|
|
||||||
|
virtual void CreateStyle();
|
||||||
virtual void InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
|
virtual void InitMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
|
||||||
virtual void InitDataSet(PMusrCanvasDataSet &dataSet);
|
virtual void InitDataSet(PMusrCanvasDataSet &dataSet);
|
||||||
virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet);
|
virtual void CleanupDataSet(PMusrCanvasDataSet &dataSet);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user