Changeset 2150 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 06/02/03 13:48:05 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r2109 r2150 55 55 #include <TH2.h> 56 56 #include <TH3.h> 57 #include <TStyle.h> // TStyle::GetScreenFactor 57 58 #include <TGaxis.h> 58 59 #include <TCanvas.h> … … 128 129 // number of all existing canvases plus one) 129 130 // 131 // Normally the canvas size is scaled with gStyle->GetScreenFactor() so 132 // that on all screens it looks like the same part of the screen. 133 // To suppress this scaling use usescreenfactor=kFALSE. In this case 134 // you specify directly the size of the embedded pad. 135 // 130 136 TCanvas *MH::MakeDefCanvas(TString name, const char *title, 131 const UInt_t w, const UInt_t h)137 UInt_t w, UInt_t h, Bool_t usescreenfactor) 132 138 { 133 139 const TList *list = (TList*)gROOT->GetListOfCanvases(); … … 139 145 name += Form(" <%d>", list->GetSize()+1); 140 146 147 if (!usescreenfactor) 148 { 149 const Float_t cx = gStyle->GetScreenFactor(); 150 w += 4; 151 h += 28; 152 w = (int)(w/cx+1); 153 h = (int)(h/cx+1); 154 } 155 141 156 return new TCanvas(name, title, w, h); 142 157 } … … 147 162 // and title are retrieved from the given TObject. 148 163 // 164 // Normally the canvas size is scaled with gStyle->GetScreenFactor() so 165 // that on all screens it looks like the same part of the screen. 166 // To suppress this scaling use usescreenfactor=kFALSE. In this case 167 // you specify directly the size of the embedded pad. 168 // 149 169 TCanvas *MH::MakeDefCanvas(const TObject *obj, 150 const UInt_t w, const UInt_t h) 151 { 170 UInt_t w, UInt_t h, Bool_t usescreenfactor) 171 { 172 if (!usescreenfactor) 173 { 174 const Float_t cx = gStyle->GetScreenFactor(); 175 w += 4; 176 h += 28; 177 h = (int)(h/cx+1); 178 w = (int)(w/cx+1); 179 } 180 152 181 return MakeDefCanvas(obj->GetName(), obj->GetTitle(), w, h); 153 182 } -
trunk/MagicSoft/Mars/mhist/MH.h
r2117 r2150 33 33 34 34 static TCanvas *MakeDefCanvas(TString name="", const char *title="", 35 const UInt_t w=625, const UInt_t h=440); 35 UInt_t w=625, UInt_t h=440, 36 Bool_t usescreenfactor=kTRUE); 36 37 static TCanvas *MakeDefCanvas(const TObject *obj, 37 const UInt_t w=625, const UInt_t h=440); 38 UInt_t w=625, UInt_t h=440, 39 Bool_t usescreenfactor=kFALSE); 38 40 39 41 // FIXME: * --> & !!!
Note:
See TracChangeset
for help on using the changeset viewer.