// @(#)rootlibs:$Id TExPad.cc $ // Author: Koji Ebina 18/05/11 //_____________________________________________________________ /* Begin_Html <center><h2>The extended TExPad class of TPad</h2></center> <h4>Examples:</h4> <pre> { gSystem->Load("libExROOT.so"); TCanvas *canvas = new TCanvas("canvas","canvas",100,100,600,600); TExPad *pad = new TExPad("pad","pad"); pad->Draw(); pad->SetupPadComb(TExPad::TWBN); pad->Focus(1); TH1F *h1 = new TH1F("h1","h1",100,0,100); h1->Draw(); pad->Focus(2); TH1F *h2 = new TH1F("h2","h2",100,0,100); h2->Draw(); } </pre> End_Html */ #include "TPad.h" #include "TObjArray.h" //_____________________________________________________________ // A description of the class starts with the line above, and // will take place here ! // class TExPad : public TPad { protected: TObjArray* padArray; public: /* constractor */ TExPad(const char* name, const char* title, Double_t xlow = 0.0, Double_t ylow = 0.0, Double_t xup = 1.0, Double_t yup = 1.0, Color_t color = -1, Short_t bordersize = -1, Short_t bordermode = -2) : TPad(name,title,xlow,ylow,xup,yup,color,bordersize,bordermode), padArray(new TObjArray()) {} /* destractor */ virtual ~TExPad() {} /* Add subpad by your own hand. */ void AddPad(Float_t xlow, Float_t ylow, Float_t xup, Float_t yup); /* Get the number of added subpads. */ Int_t NPad() {return padArray->GetEntriesFast();} /* Move subpad by subpadnumber. */ void Focus(Int_t subpadnumber=0); /* Enum for Predefined Pad Arrangement */ enum { T1B2, // X T2B1, TNBW, TWBN, }; /* Set the predefined pad arrangment by enum. */ void SetupPadComb(Int_t padcomb); ClassDef(TExPad,0) };