Ignore:
Timestamp:
06/02/03 13:48:05 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r2109 r2150  
    5555#include <TH2.h>
    5656#include <TH3.h>
     57#include <TStyle.h>       // TStyle::GetScreenFactor
    5758#include <TGaxis.h>
    5859#include <TCanvas.h>
     
    128129// number of all existing canvases plus one)
    129130//
     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//
    130136TCanvas *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)
    132138{
    133139    const TList *list = (TList*)gROOT->GetListOfCanvases();
     
    139145        name += Form(" <%d>", list->GetSize()+1);
    140146
     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
    141156    return new TCanvas(name, title, w, h);
    142157}
     
    147162// and title are retrieved from the given TObject.
    148163//
     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//
    149169TCanvas *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
    152181    return MakeDefCanvas(obj->GetName(), obj->GetTitle(), w, h);
    153182}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r2117 r2150  
    3333
    3434    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);
    3637    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);
    3840
    3941    // FIXME: * --> & !!!
Note: See TracChangeset for help on using the changeset viewer.